This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[build] Honor --disable-symvers (PR bootstrap/48135)


Prompted by PR bootstrap/48135, I found that only libstdc++-v3 honors
--disable-symvers.  The following patch corrects this, but also notices
again the mess we've created by having at least 3 different sets of
checks for symbol versioning, each with its own variations ;-(  But this
is not the time to correct this (yet).

Tested by a i386-pc-solaris2.11 bootstrap and checking that all
libraries were still versioned by default.  Then I removed and
configured/built the affected libraries again and checked that
versioning was correctly disabled.

The patch below was created with -w to hide indentation changes.

Ok for mainline now and perhaps 4.6.1?

Thanks.
	Rainer


2011-03-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgfortran:
	PR bootstrap/48135
	* configure.ac (gfortran_use_symver): Handle --disable-symvers.
	* configure: Regenerate.

	libgomp:
	PR bootstrap/48135
	* acinclude.m4 (enable_symvers): Handle --disable-symvers.
	* configure: Regenerate.

	libjava:
	PR bootstrap/48135
	* configure.ac (libjava_cv_anon_version_script): Handle
	--disable-symvers.
	* configure: Regenerate.

	libquadmath:
	PR bootstrap/48135
	* configure.ac (quadmath_use_symver): Handle --disable-symvers.
	* configure: Regenerate.

	libssp:
	PR bootstrap/48135
	* configure.ac (ssp_use_symver): Handle --disable-symvers.
	* configure: Regenerate.

diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -144,6 +144,12 @@
 
 # Check for symbol versioning (copied from libssp).
 AC_MSG_CHECKING([whether symbol versioning is supported])
+AC_ARG_ENABLE(symvers,
+AS_HELP_STRING([--disable-symvers],
+  [disable symbol versioning for libgfortran]),
+gfortran_use_symver=$enableval,
+gfortran_use_symver=yes)
+if test "x$gfortran_use_symver" = xyes; then
 save_LDFLAGS="$LDFLAGS"
 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
 cat > conftest.map <<EOF
@@ -168,6 +174,7 @@
   esac
 fi
 LDFLAGS="$save_LDFLAGS"
+fi
 AC_MSG_RESULT($gfortran_use_symver)
 AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno])
 AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu])
diff --git a/libgomp/acinclude.m4 b/libgomp/acinclude.m4
--- a/libgomp/acinclude.m4
+++ b/libgomp/acinclude.m4
@@ -228,6 +228,9 @@
 # If we never went through the LIBGOMP_CHECK_LINKER_FEATURES macro, then we
 # don't know enough about $LD to do tricks...
 AC_REQUIRE([LIBGOMP_CHECK_LINKER_FEATURES])
+
+# Turn a 'yes' into a suitable default.
+if test x$enable_symvers = xyes ; then
 # FIXME  The following test is too strict, in theory.
 if test $enable_shared = no || test "x$LD" = x; then
   enable_symvers=no
@@ -244,6 +247,7 @@
     esac
   fi
 fi
+fi
 
 # Check if 'sun' was requested on non-Solaris 2 platforms.
 if test x$enable_symvers = xsun ; then
diff --git a/libjava/configure.ac b/libjava/configure.ac
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -1800,13 +1800,24 @@
 # See if linker supports anonymous version scripts.
 AC_CACHE_CHECK([whether ld supports anonymous version scripts],
   [libjava_cv_anon_version_script],
-  [save_CFLAGS="$CFLAGS"; save_LDFLAGS="$LDFLAGS"
-   libjava_cv_anon_version_script=no
+  [AC_ARG_ENABLE(symvers,
+     AS_HELP_STRING([--disable-symvers],
+		    [disable symbol versioning for libjava]),
+       [case "$enableval" in
+         yes) libjava_cv_anon_version_script=yes ;;
+         no)  libjava_cv_anon_version_script=no ;;
+         *)   AC_MSG_ERROR([Unknown argument to enable/disable symvers]);;
+        esac],
+       [libjava_cv_anon_version_script=yes]
+   )
+   if test x$libjava_cv_anon_version_script = xyes; then
+     save_CFLAGS="$CFLAGS"; save_LDFLAGS="$LDFLAGS"
    CFLAGS="$CFLAGS -fPIC";
    LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
    echo '{ global: globalsymb*; local: *; };' > conftest.map
    AC_TRY_LINK(void globalsymbol (void) {} void localsymbol (void) {},,
-	       [libjava_cv_anon_version_script=gnu], [])
+	         [libjava_cv_anon_version_script=gnu],
+		 [libjava_cv_anon_version_script=no])
    if test x$libjava_cv_anon_version_script = xno; then
      case "$target_os" in
        solaris2*)
@@ -1820,6 +1831,7 @@
      esac
    fi
    CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"
+   fi
   ])
 AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" != no)
 AM_CONDITIONAL(ANONVERSCRIPT_GNU, test "$libjava_cv_anon_version_script" = gnu)
diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
--- a/libquadmath/configure.ac
+++ b/libquadmath/configure.ac
@@ -164,6 +164,12 @@
 
 # Check for symbol versioning (copied from libssp).
 AC_MSG_CHECKING([whether symbol versioning is supported])
+AC_ARG_ENABLE(symvers,
+AS_HELP_STRING([--disable-symvers],
+  [disable symbol versioning for libquadmath]),
+quadmath_use_symver=$enableval,
+quadmath_use_symver=yes)
+if test "x$quadmath_use_symver" = xyes; then
 if test x$gcc_no_link = xyes; then
   # If we cannot link, we cannot build shared libraries, so do not use
   # symbol versioning.
@@ -194,6 +200,7 @@
   fi
   LDFLAGS="$save_LDFLAGS"
 fi
+fi
 AC_MSG_RESULT($quadmath_use_symver)
 AM_CONDITIONAL(LIBQUAD_USE_SYMVER, [test "x$quadmath_use_symver" != xno])
 AM_CONDITIONAL(LIBQUAD_USE_SYMVER_GNU, [test "x$quadmath_use_symver" = xgnu])
diff --git a/libssp/configure.ac b/libssp/configure.ac
--- a/libssp/configure.ac
+++ b/libssp/configure.ac
@@ -72,6 +72,12 @@
 fi
 
 AC_MSG_CHECKING([whether symbol versioning is supported])
+AC_ARG_ENABLE(symvers,
+AS_HELP_STRING([--disable-symvers],
+  [disable symbol versioning for libssp]),
+ssp_use_symver=$enableval,
+ssp_use_symver=yes)
+if test "x$ssp_use_symver" = xyes; then
 if test x$gcc_no_link = xyes; then
   # If we cannot link, we cannot build shared libraries, so do not use
   # symbol versioning.
@@ -102,6 +108,7 @@
   fi
   LDFLAGS="$save_LDFLAGS"
 fi
+fi
 AC_MSG_RESULT($ssp_use_symver)
 AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" != xno])
 AM_CONDITIONAL(LIBSSP_USE_SYMVER_GNU, [test "x$ssp_use_symver" = xgnu])

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


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