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]

Re: [build, doc, v3] Support Sun symbol versioning in libstdc++-v3, rev. 2


IainS <developer@sandoe-acoustics.co.uk> writes:

> from ld (tools version 2.5) manual page linked earlier:
> -M (32-bit only) Produce a load map, listing all the segments and
> sections. The list includes the address where each input file's  section
> appears in the output file, as well as the section's size.  This option
> overlaps with a compiler option. If you use the compiler  driver cc(1) to
> invoke ld, invoke this option in this way: -Wl,-M.
> so, although it's not listed in the 3.2.x tools, I imagine that it is
> silently ignored for backward-compatibility.

That's what I feared.  At first, I was tempted to use the same hack as
in the libjava configure.ac, but since the check for Sun style symbol
versioning makes sense only on Solaris, I'd go for the following
instead.

Could you please give it a try on Darwin?

If it works for you, I'll commit as obvious.

Thanks.
	Rainer


2010-07-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libssp:
	* configure.ac (ssp_use_symver): Only check for Sun-style symbol
	versioning on Solaris 2.
	* configure: Regenerate.

diff -r 08cc828c8afb libssp/configure.ac
--- a/libssp/configure.ac	Mon Jun 28 16:33:40 2010 +0200
+++ b/libssp/configure.ac	Fri Jul 02 17:23:54 2010 +0200
@@ -86,15 +86,19 @@
 EOF
   AC_TRY_LINK([int foo;],[],[ssp_use_symver=gnu],[ssp_use_symver=no])
   if test x$ssp_use_symver = xno; then
-    LDFLAGS="$save_LDFLAGS"
-    LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
-    # Sun ld cannot handle wildcards and treats all entries as undefined.
-    cat > conftest.map <<EOF
+    case "$target_os" in
+      solaris2*)
+        LDFLAGS="$save_LDFLAGS"
+        LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+        # Sun ld cannot handle wildcards and treats all entries as undefined.
+        cat > conftest.map <<EOF
 FOO_1.0 {
   global: foo; local: *;
 };
 EOF
-    AC_TRY_LINK([int foo;],[],[ssp_use_symver=sun],[ssp_use_symver=no])
+        AC_TRY_LINK([int foo;],[],[ssp_use_symver=sun],[ssp_use_symver=no])
+    	;;
+    esac
   fi
   LDFLAGS="$save_LDFLAGS"
 fi


-- 
-----------------------------------------------------------------------------
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]