This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Check for Phil's ld patch


Hi!

The following patch tests whether binutils < 2.12 has Phil's ld version
globbing patch.
Tested both with 2.11.93 binutils without the patch and with 2.11.94 which
includes it.
Ok to commit?

2002-03-05  Jakub Jelinek  <jakub@redhat.com>

	* acinclude.m4 (GLIBCPP_ENABLE_SYMVERS): Check for version
	script globbing in ld.
	* aclocal.m4: Rebuilt.
	* configure: Rebuilt.

--- libstdc++-v3/acinclude.m4.jj	Tue Feb 26 10:49:06 2002
+++ libstdc++-v3/acinclude.m4	Tue Mar  5 14:40:42 2002
@@ -2082,10 +2082,27 @@ glibcpp_min_gnu_ld_version=21200
 # above.  
 if test $enable_symvers = yes ; then
   if test $with_gnu_ld = yes &&
-    test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version &&
     test $glibcpp_shared_libgcc = yes ;
   then
-    enable_symvers=gnu
+    if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
+        enable_symvers=gnu
+    else
+      ac_test_CFLAGS="${CFLAGS+set}"
+      ac_save_CFLAGS="$CFLAGS"
+      CFLAGS='-shared -Wl,--version-script,conftest.map'
+      enable_symvers=no
+      changequote(,)
+      echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
+      changequote([,])
+      AC_TRY_LINK([int foo;],, enable_symvers=gnu)
+      if test "$ac_test_CFLAGS" = set; then
+	CFLAGS="$ac_save_CFLAGS"
+      else
+	# this is the suspicious part
+	CFLAGS=''
+      fi
+      rm -f conftest.map
+    fi
   else
     # just fail for now
     enable_symvers=no
--- libstdc++-v3/aclocal.m4.jj	Tue Feb 26 10:49:06 2002
+++ libstdc++-v3/aclocal.m4	Tue Mar  5 14:40:56 2002
@@ -2094,10 +2094,27 @@ glibcpp_min_gnu_ld_version=21200
 # above.  
 if test $enable_symvers = yes ; then
   if test $with_gnu_ld = yes &&
-    test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version &&
     test $glibcpp_shared_libgcc = yes ;
   then
-    enable_symvers=gnu
+    if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
+        enable_symvers=gnu
+    else
+      ac_test_CFLAGS="${CFLAGS+set}"
+      ac_save_CFLAGS="$CFLAGS"
+      CFLAGS='-shared -Wl,--version-script,conftest.map'
+      enable_symvers=no
+      changequote(,)
+      echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
+      changequote([,])
+      AC_TRY_LINK([int foo;],, enable_symvers=gnu)
+      if test "$ac_test_CFLAGS" = set; then
+	CFLAGS="$ac_save_CFLAGS"
+      else
+	# this is the suspicious part
+	CFLAGS=''
+      fi
+      rm -f conftest.map
+    fi
   else
     # just fail for now
     enable_symvers=no
--- libstdc++-v3/configure.jj	Tue Feb 26 10:49:25 2002
+++ libstdc++-v3/configure	Tue Mar  5 14:41:32 2002
@@ -19349,10 +19349,42 @@ glibcpp_min_gnu_ld_version=21200
 # above.  
 if test $enable_symvers = yes ; then
   if test $with_gnu_ld = yes &&
-    test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version &&
     test $glibcpp_shared_libgcc = yes ;
   then
-    enable_symvers=gnu
+    if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
+        enable_symvers=gnu
+    else
+      ac_test_CFLAGS="${CFLAGS+set}"
+      ac_save_CFLAGS="$CFLAGS"
+      CFLAGS='-shared -Wl,--version-script,conftest.map'
+      enable_symvers=no
+      
+      echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
+      
+      cat > conftest.$ac_ext <<EOF
+#line 19344 "configure"
+#include "confdefs.h"
+int foo;
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:19351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  enable_symvers=gnu
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+      if test "$ac_test_CFLAGS" = set; then
+	CFLAGS="$ac_save_CFLAGS"
+      else
+	# this is the suspicious part
+	CFLAGS=''
+      fi
+      rm -f conftest.map
+    fi
   else
     # just fail for now
     enable_symvers=no

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]