OSDN Git Service

PR libstdc++/38092
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jan 2009 22:49:29 +0000 (22:49 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jan 2009 22:49:29 +0000 (22:49 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143169 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/src/compatibility.cc

index 7027b77..8748808 100644 (file)
@@ -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
index d7e93a8..71cc7e9 100644 (file)
@@ -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)
index 55edd8c..5d63b7f 100644 (file)
@@ -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
 
index d5e6752..759b241 100755 (executable)
@@ -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
+
 
 
 
index b29040c..06f6b9a 100644 (file)
@@ -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