Patchwork [build,libjava] Support Sun symbol versioning in libjava

login
register
mail settings
Submitter Rainer Orth
Date July 5, 2010, 5:05 p.m.
Message ID <yddr5jh2711.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/57921/
State New
Headers show

Comments

Rainer Orth - July 5, 2010, 5:05 p.m.
Andrew Haley <aph@redhat.com> writes:

>>> Did you test this on GNU/Linux ?
>> 
>> Not yet: no access.  Perhaps via VirtualBox or the GCC test farm.

We do have a single machine running RHEL4, so I've bootstrapped the
patch on x86_64-unknown-linux-gnu without regressions.

To avoid the Darwin problem of silently accepting the ld -M option, I've
added the same guard in configure.ac as in libgfortran and libssp:


Ok now?

Thanks.
	Rainer
Andrew Haley - July 5, 2010, 5:17 p.m.
On 07/05/2010 06:05 PM, Rainer Orth wrote:
> Andrew Haley <aph@redhat.com> writes:
> 
>>>> Did you test this on GNU/Linux ?
>>>
>>> Not yet: no access.  Perhaps via VirtualBox or the GCC test farm.
> 
> We do have a single machine running RHEL4, so I've bootstrapped the
> patch on x86_64-unknown-linux-gnu without regressions.
> 
> To avoid the Darwin problem of silently accepting the ld -M option, I've
> added the same guard in configure.ac as in libgfortran and libssp:
> 
> --- a/libjava/configure.ac	Sat Jul 03 09:28:21 2010 +0200
> +++ b/libjava/configure.ac	Sat Jul 03 09:32:51 2010 +0200
> @@ -1780,13 +1780,28 @@
>    [libjava_cv_anon_version_script],
>    [save_CFLAGS="$CFLAGS"; save_LDFLAGS="$LDFLAGS"
>     libjava_cv_anon_version_script=no
> -   CFLAGS="$CFLAGS -fPIC"; LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
> +   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=yes], [])
> +	       [libjava_cv_anon_version_script=gnu], [])
> +   if test x$libjava_cv_anon_version_script = xno; then
> +     case "$target_os" in
> +       solaris2*)
> +         LDFLAGS="$save_LDFLAGS"
> +         LDFLAGS="$LDFLAGS -shared -Wl,-M,conftest.map"
> +         # Sun ld doesn't understand wildcards here.
> +         echo '{ global: globalsymbol; local: *; };' > conftest.map
> +         AC_TRY_LINK(void globalsymbol (void) {} void localsymbol (void) {},,
> +	 	     [libjava_cv_anon_version_script=sun], [])
> +         ;;
> +     esac
> +   fi
>     CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"
>    ])
> -AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" = yes)
> +AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" != no)
> +AM_CONDITIONAL(ANONVERSCRIPT_GNU, test "$libjava_cv_anon_version_script" = gnu)
> +AM_CONDITIONAL(ANONVERSCRIPT_SUN, test "$libjava_cv_anon_version_script" = sun)
>  
>  # Check if linker supports static linking on a per library basis
>  LD_START_STATIC_SPEC=
> 
> Ok now?

OK.

Thanks,
Andrew.

Patch

--- a/libjava/configure.ac	Sat Jul 03 09:28:21 2010 +0200
+++ b/libjava/configure.ac	Sat Jul 03 09:32:51 2010 +0200
@@ -1780,13 +1780,28 @@ 
   [libjava_cv_anon_version_script],
   [save_CFLAGS="$CFLAGS"; save_LDFLAGS="$LDFLAGS"
    libjava_cv_anon_version_script=no
-   CFLAGS="$CFLAGS -fPIC"; LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
+   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=yes], [])
+	       [libjava_cv_anon_version_script=gnu], [])
+   if test x$libjava_cv_anon_version_script = xno; then
+     case "$target_os" in
+       solaris2*)
+         LDFLAGS="$save_LDFLAGS"
+         LDFLAGS="$LDFLAGS -shared -Wl,-M,conftest.map"
+         # Sun ld doesn't understand wildcards here.
+         echo '{ global: globalsymbol; local: *; };' > conftest.map
+         AC_TRY_LINK(void globalsymbol (void) {} void localsymbol (void) {},,
+	 	     [libjava_cv_anon_version_script=sun], [])
+         ;;
+     esac
+   fi
    CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"
   ])
-AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" = yes)
+AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" != no)
+AM_CONDITIONAL(ANONVERSCRIPT_GNU, test "$libjava_cv_anon_version_script" = gnu)
+AM_CONDITIONAL(ANONVERSCRIPT_SUN, test "$libjava_cv_anon_version_script" = sun)
 
 # Check if linker supports static linking on a per library basis
 LD_START_STATIC_SPEC=