libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incorrect definition of no_undefined_flag on solaris?


From: Alexandre Oliva
Subject: Re: incorrect definition of no_undefined_flag on solaris?
Date: 11 Apr 2001 23:38:58 -0300
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley)

On Mar 23, 2001, Diab Jerius <address@hidden> wrote:

> I can verify that Solaris 2.4 and SunOS 5.2 (which should be Solaris
> 2.2) both have the -z defs flag.

Thanks, I've finally got 'round to fix it.  I'm checking these patches
in mainline and MLB, respectively:

Index: ChangeLog
from  Alexandre Oliva  <address@hidden>

        * libtool.m4 (no_undefined_flag) [Solaris ld]: Change to -zdefs.

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.157
diff -u -p -r1.157 libtool.m4
--- libtool.m4 2001/04/08 11:14:56 1.157
+++ libtool.m4 2001/04/12 02:38:50
@@ -1594,7 +1594,7 @@ else
     ;;
 
   solaris*)
-    no_undefined_flag=' -z text'
+    no_undefined_flag=' -z defs'
     # $CC -shared without GNU ld will not create a library from C++
     # object files and a static libstdc++, better avoid it by now
     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs 
$deplibs $linker_flags'
Index: ChangeLog
from  Alexandre Oliva  <address@hidden>

        * ltcf-c.sh (no_undefined_flag) [Solaris ld]: Change to -zdefs.
        * ltcf-cxx.sh (no_undefined_flag) [Solaris ld]: Likewise.
        * ltcf-gcj.sh (no_undefined_flag) [Solaris ld]: Likewise.
        (archive_cmds, archive_expsym_cmds, output_verbose_link_cmds,
        whole_archive_flag_spec) [Solaris]: Copy from ltcf-cxx.sh.

Index: ltcf-c.sh
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltcf-c.sh,v
retrieving revision 1.1.2.33
diff -u -p -r1.1.2.33 ltcf-c.sh
--- ltcf-c.sh 2001/04/08 11:40:15 1.1.2.33
+++ ltcf-c.sh 2001/04/12 02:35:29
@@ -505,7 +505,7 @@ else
     ;;
 
   solaris*)
-    no_undefined_flag=' -z text'
+    no_undefined_flag=' -z defs'
     # $CC -shared without GNU ld will not create a library from C++
     # object files and a static libstdc++, better avoid it by now
     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs 
$deplibs $linker_flags'
Index: ltcf-cxx.sh
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltcf-cxx.sh,v
retrieving revision 1.1.2.39
diff -u -p -r1.1.2.39 ltcf-cxx.sh
--- ltcf-cxx.sh 2001/04/11 16:15:09 1.1.2.39
+++ ltcf-cxx.sh 2001/04/12 02:35:29
@@ -540,7 +540,7 @@ case $host_os in
     case $cc_basename in
       CC)
        # Sun C++ 4.2, 5.x and Centerline C++
-        no_undefined_flag=' -ztext'
+        no_undefined_flag=' -zdefs'
         archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols 
| sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname 
-o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm 
$lib.exp'
@@ -585,6 +585,7 @@ case $host_os in
       *)
         # GNU C++ compiler with Solaris linker
         if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
+         no_undefined_flag=' ${wl}-z ${wl}defs'
           if $CC --version | egrep -v '^2\.7' > /dev/null; then
             archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects 
$libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
             archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat 
$export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> 
$lib.exp~
Index: ltcf-gcj.sh
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltcf-gcj.sh,v
retrieving revision 1.1.2.18
diff -u -p -r1.1.2.18 ltcf-gcj.sh
--- ltcf-gcj.sh 2001/03/31 11:05:10 1.1.2.18
+++ ltcf-gcj.sh 2001/04/12 02:35:29
@@ -485,18 +485,22 @@ else
     ;;
 
   solaris*)
-    no_undefined_flag=' -z text'
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs 
$deplibs $linker_flags'
+    no_undefined_flag=' ${wl}-z ${wl}defs'
+    archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs 
$deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | 
sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib 
$libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec='-R$libdir'
+      $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects 
$libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+
+    # Commands to make compiler produce verbose output that lists
+    # what "hidden" libraries, object files and flags are used when
+    # linking a shared library.
+    output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | 
egrep \"\-L\""
+
+    hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
     hardcode_shlibpath_var=no
     case $host_os in
     solaris2.[0-5] | solaris2.[0-5].*) ;;
     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z 
${wl}defaultextract' ;;
     esac
     link_all_deplibs=yes
     ;;

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  address@hidden, redhat.com}
CS PhD student at IC-Unicamp        address@hidden, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

reply via email to

[Prev in Thread] Current Thread [Next in Thread]