[Top][All Lists]

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

Re: Libtool 2.2.6 uses unknown -b option w/HP-UX cc

From: Ralf Wildenhues
Subject: Re: Libtool 2.2.6 uses unknown -b option w/HP-UX cc
Date: Tue, 11 Nov 2008 22:48:25 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Daniel,

* Daniel Richard G. wrote on Mon, Nov 10, 2008 at 09:12:22PM CET:
> On Mon, 2008 Nov 10 20:09:33 +0100, Ralf Wildenhues wrote:
> >
> > > cc: warning 422: Unknown option "b" ignored.
> > > /usr/ccs/bin/ld: Unsatisfied symbols:
> > >    main (Not referenced yet! Probably due to -u option)
> > > gmake[5]: *** [libfoo.la] Error 1
> > 
> > Does it work if you replace -b with -Z in archive_cmds,
> > archive_expsym_cmds inside the libtool script?
> Not quite, I'm afraid:

> libtool: link: cc -Z -Wl,+h -Wl,libfoo.sl -Wl,+b -Wl,/tmp/project/lib -o 
> .libs/libfoo.sl  .libs/xxjni.o .libs/mcatobj.o   -L/opt/lib/pic -L/opt/lib 
> /opt/lib/pic/libxxlib.a -L/opt/lib /opt/lib/libxml2.a -lz /opt/lib/libiodbc.a 
> /opt/lib/libiodbcinst.a -lcl -lpthread /opt/lib/libpcre.a -lm -lc  +DA2.0
> /usr/ccs/bin/ld: Unsatisfied symbols:
>    main (Not referenced yet! Probably due to -u option)

> (Besides, according to the cc(1) man page, all -Z does is allow the 
> dereferencing of null pointers...)

Oops.  First I looked at +Z, then, all that does is generate PIC code.

> I remember working around this in 1.5.x by hacking the Libtool 
> configure-script section to choose the hpux10* commands instead of hpux11*. 
> (The former uses "ld -b ...", which works on this system.) This hack still 
> seems to do the trick, so that would seem to be the appropriate fallback.

Ah, yes, and now I do remember the problems.  Using ld directly was the
source of quite a few problems.  Oh well, let's go with a link test
then.  :-/

AFAICS this only concerned the C compiler, not the C++ one.

Please try whether the following patch selects $LD for your system.

Others, ok to apply and put Daniel in THANKS?


    Fix archive_cmds for older cc on HP-UX 11.
    * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) [hp-ux11*, !GCC]
    [!hppa*64*, !ia64*] <archive_cmds>: Older releases of the HP-UX
    11.00 C compiler do not support -b yet; use a link test to
    decide whether $LD should be used for library creation.
    * THANKS: Update.
    Report by Daniel Richard G.

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 75dfbed..e397b96 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -4714,7 +4714,14 @@ _LT_EOF
          _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname 
${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b 
${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       m4_if($1, [], [
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP 
+         _LT_LINKER_OPTION([if $CC understands -b],
+           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b 
${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir 
-o $lib $libobjs $deplibs $linker_flags'])],
+         [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b 
${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])

reply via email to

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