diff mbox

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

Message ID yddiq4xhpoa.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth July 2, 2010, 3:24 p.m. UTC
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.

Comments

Iain Sandoe July 2, 2010, 3:41 p.m. UTC | #1
On 2 Jul 2010, at 16:24, Rainer Orth wrote:

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

It works for libssp.

I think a similar change is needed for libgfortran (at least) but  
you'd know better than me the scope of the changes.

thanks
Iain.
Rainer Orth July 2, 2010, 4:13 p.m. UTC | #2
IainS <developer@sandoe-acoustics.co.uk> writes:

> yeah - both OK with those patches and autoreconf.
> I'll do a clean bootstrap now - but I think you're fairly safe.,..

Thanks for the confirmation.  Given that I'm leaving for the weekend in
about two hours and will be away from my mail till monday, I'll check in
this patch now to avoid leaving the tree broken at least for Darwin that
long.

	Rainer
Mike Stump July 2, 2010, 4:31 p.m. UTC | #3
On Jul 2, 2010, at 9:13 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 
> Given that I'm leaving for the weekend in
> about two hours and will be away from my mail till monday, I'll check in
> this patch now to avoid leaving the tree broken at least for Darwin that
> long.

Thanks.
>
diff mbox

Patch

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