diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-01-07 23:49:29 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-01-07 23:49:29 +0100 |
commit | 1f93f6871ed8248e799690c7029cf1d5b12ff2f2 (patch) | |
tree | c51588bf25bcc97ad673fc18f899ae85d03c2a0f /libstdc++-v3 | |
parent | 876080ffb70bdcb889f47aa334547cf25398e943 (diff) | |
download | gcc-1f93f6871ed8248e799690c7029cf1d5b12ff2f2.zip gcc-1f93f6871ed8248e799690c7029cf1d5b12ff2f2.tar.gz gcc-1f93f6871ed8248e799690c7029cf1d5b12ff2f2.tar.bz2 |
re PR libstdc++/38092 (libstdc++ doesn't build with GNU ld 2.19 and Sun as: no .symver support)
PR libstdc++/38092
* acinclude.m4 (HAVE_AS_SYMVER_DIRECTIVE): New test.
* src/compatibility.cc: Don't use .symver directives if
_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE is not defined.
* config.h.in: Regenerated.
* configure: Likewise.
From-SVN: r143169
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 9 | ||||
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 10 | ||||
-rw-r--r-- | libstdc++-v3/config.h.in | 3 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 62 | ||||
-rw-r--r-- | libstdc++-v3/src/compatibility.cc | 8 |
5 files changed, 89 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7027b77..8748808 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2009-01-07 Jakub Jelinek <jakub@redhat.com> + + PR libstdc++/38092 + * acinclude.m4 (HAVE_AS_SYMVER_DIRECTIVE): New test. + * src/compatibility.cc: Don't use .symver directives if + _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE is not defined. + * config.h.in: Regenerated. + * configure: Likewise. + 2009-01-07 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/38466 diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index d7e93a8..71cc7e9 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -2819,6 +2819,16 @@ if test x$enable_symvers != xno ; then [Define to use symbol versioning in the shared library.]) fi +AC_CACHE_CHECK([whether the target supports .symver directive], + glibcxx_cv_have_as_symver_directive, [ + AC_TRY_COMPILE([void foo (void); __asm (".symver foo, bar@SYMVER");], + [], glibcxx_cv_have_as_symver_directive=yes, + glibcxx_cv_have_as_symver_directive=no)]) +if test $glibcxx_cv_have_as_symver_directive = yes; then + AC_DEFINE(HAVE_AS_SYMVER_DIRECTIVE, 1, + [Define to 1 if the target assembler supports .symver directive.]) +fi + AC_SUBST(SYMVER_FILE) AC_SUBST(port_specific_symbol_files) GLIBCXX_CONDITIONAL(ENABLE_SYMVERS, test $enable_symvers != no) diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 55edd8c..5d63b7f 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -12,6 +12,9 @@ /* Define to 1 if you have the `asinl' function. */ #undef HAVE_ASINL +/* Define to 1 if the target assembler supports .symver directive. */ +#undef HAVE_AS_SYMVER_DIRECTIVE + /* Define to 1 if you have the `atan2f' function. */ #undef HAVE_ATAN2F diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index d5e6752..759b241 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -107738,6 +107738,68 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether the target supports .symver directive" >&5 +echo $ECHO_N "checking whether the target supports .symver directive... $ECHO_C" >&6 +if test "${glibcxx_cv_have_as_symver_directive+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +void foo (void); __asm (".symver foo, bar@SYMVER"); +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + glibcxx_cv_have_as_symver_directive=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +glibcxx_cv_have_as_symver_directive=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $glibcxx_cv_have_as_symver_directive" >&5 +echo "${ECHO_T}$glibcxx_cv_have_as_symver_directive" >&6 +if test $glibcxx_cv_have_as_symver_directive = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_SYMVER_DIRECTIVE 1 +_ACEOF + +fi + diff --git a/libstdc++-v3/src/compatibility.cc b/libstdc++-v3/src/compatibility.cc index b29040c..06f6b9a 100644 --- a/libstdc++-v3/src/compatibility.cc +++ b/libstdc++-v3/src/compatibility.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions -*- C++ -*- -// Copyright (C) 2005, 2006 +// Copyright (C) 2005, 2006, 2009 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -30,7 +30,8 @@ #include <bits/c++config.h> -#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) +#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ + && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) #define istreambuf_iterator istreambuf_iteratorXX #define basic_fstream basic_fstreamXX #define basic_ifstream basic_ifstreamXX @@ -204,7 +205,8 @@ _GLIBCXX_END_NAMESPACE // NB: These symbols renames should go into the shared library only, // and only those shared libraries that support versioning. -#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) +#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ + && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) /* gcc-3.4.4 _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv |