bug-libtool
[Top][All Lists]
Advanced

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

Re: icc/ecc full path and solaris link line fixes


From: Ralf Wildenhues
Subject: Re: icc/ecc full path and solaris link line fixes
Date: Fri, 19 Nov 2004 10:08:54 +0100
User-agent: Mutt/1.4.1i

* Bob Friesenhahn wrote on Wed, Nov 17, 2004 at 05:46:44PM CET:
> On Wed, 17 Nov 2004, Ralf Wildenhues wrote:
> >
> >Now we have two choices (w.r.t the message I quoted above):
> >Enable -mimpure-text on sparc-solaris/gcc which would allow non-PIC code
> >in dso's.  Or disallow non-PIC in dso's (and adjust demo-nopic.test).
> >Or create a dedicated flag (let's call it `impure_flag') for non-PIC
> >code in dso's.
> >
> >I vote for the second option, since portable code should not depend on
> >it (in the name of a sensible common subset of features).  What do the
> >others think?
> 
> I agree that we should disallow non-PIC code in SPARC Solaris DSOs. 
> This appears to be the purpose of '-z text' and I think we should use 
> it.  Libtool is already working hard to avoid accidental use of 
> non-PIC code in Solaris DSOs (even though Solaris can often deal with 
> it).  Enforcing it is a good idea since use of this option is 
> recommended.  Expect someone to complain when their software stops 
> linking.
> 
> >Second, I think Ralf Menzel is right that Solaris wants
> >-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
> >+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z defs'
> >
> >Do the others agree?
> 
> I agree that '-z defs' is the equivalent of no-undefined.  Using
> '-z text' for this purpose is clearly wrong.

OK.

Unfortunately, we've been here before.  Let's dig back:

,--- ChangeLog.2001:
| 2001-09-06  Gary V. Vaughan  <address@hidden>
| 
|         * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [solaris*]: Typo. s/GXX/GCC/.
| 
|         * libtool.m4 (archive_cmds, archive_expsym_cmds) [solaris*]: Changing
|         no_undefined_flag from `-z text' to `-z defs' (see entry below at
|         2001-04-11  Alexandre Oliva  <address@hidden>) has a problem.
|         when linking a shared library with gcc calling /usr/ccs/bin/ld (eg.
|         the gcc supplied with Solaris 8 companion CD), using the flag
|         -no-undefined, shared library linking will always fail because of
|         the unresolved symbols from libgcc.a.  Consequently we have to
|         provide a path to libgcc.a when linking shared libraries in
|         conjunction with -no-undefined!
[...]
| 2001-04-11  Alexandre Oliva  <address@hidden>
| 
|         * libtool.m4 (no_undefined_flag) [Solaris ld]: Change to -zdefs.


I don't have access to Solaris, so I won't check in an untested patch.
Has the situation changed since then or can we do something to change it?
Can we do this patch?

--- m4/libtool.m4       19 Nov 2004 07:18:30 -0000      1.138
+++ m4/libtool.m4       19 Nov 2004 09:00:15 -0000
@@ -4120,5 +4120,5 @@
       ;;
 
     solaris*)
-      _LT_TAGVAR(no_undefined_flag, $1)=' -z text'
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
       if test "$GCC" = yes; then


Where would I put a ` -z text'?  Add to archive_cmds and
archive_expsym_cmds?  For $GCC only?  Do I need ${wl} also?
This patch ok?

--- m4/libtool.m4       19 Nov 2004 07:18:30 -0000      1.138
+++ m4/libtool.m4       19 Nov 2004 09:00:15 -0000
@@ -4120,11 +4120,11 @@
       ;;
 
     solaris*)
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
       if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib 
$libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h 
${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
        _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "{ global:" > $lib.exp~cat 
$export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$ECHO "local: *; };" >> 
$lib.exp~
-         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib 
$libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h 
${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
        case `$CC -V 2>&1` in
        *"Compilers 5.0"*)



Independently, can I apply this patch?

--- tests/demo-nopic.test       23 Sep 2004 14:50:36 -0000      1.12
+++ tests/demo-nopic.test       19 Nov 2004 09:09:14 -0000
@@ -27,6 +27,9 @@
 hppa*|x86_64*|s390*)
        func_skip "$host doesn't like non-PIC shared libs"
        ;;
+       *-solaris*|*-sunos*)
+       func_skip "libtool does not build non-PIC shared libs on $host_os"
+       ;;
 esac
 
 func_rmprefixdir


Regards,
Ralf




reply via email to

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