Hi,

Below is an email I am thinking of asking on the libtool gnu
mailing list, but I thought I'd try asking here first in
case I am missing something?  And of course also to let you
know what I'm hitting this issue with libtool 2.2.4.

The error occurs when compiling FOSStaglib on my Solaris10u5
box which has a broken /usr/lib/libtag.so courtesy of
JDS gnome 2.22.2 (old version, linked with -lCstd, no corresponding
64 bit library).  So I assume the same problem would occur on SXCE
and OpenSolaris with libtool 2.2.4.  Maybe the KBE hacked
libtool 1.5.X does something to avoid this?

Thanks, Mark

Hi,

In the libtool 2.2.4 relink command below, the ../../taglib/libtag.la
refers to a libtag.so library in the build directory.  I'm, sorry about
the zillion compiler options, however I think only the -L options,
the ../../taglib/libtag.la and its corresponding
-L/var/tmp/pkgbuild-mwright/FOSStaglib-1.5.0-build/opt/foss/lib -ltag
options are relevant.

My hopefully simple question is: is there some way to persuade
libtool/autotools to look for the libtag.so shared library first in
/var/tmp/pkgbuild-mwright/FOSStaglib-1.5.0-build/opt/foss/lib/libtag.so.1.5.0?

As instead what happens is it finds an old, incompatible one in
/usr/lib/libtag.so.1.4.0, which causes the unresolved symbol errors.

In the Makefile.am it just does:

libtag_c_la_LIBADD = ../../taglib/libtag.la

This is Solaris 10u5, Sun Studio 12, libtool 2.2.4, KDE 4 project.

So this libtool 2.2.4 finding the wrong library in /usr/lib/libtag.so.1.4.0:

goanna% /bin/bash 
/h/goanna/2/os_5.10/cbe/BUILD/FOSStaglib-1.5.0/i386/TAGLIB/1.5.0/libtool  --tag 
CXX --mode=relink /opt/SunStudio12/SUNWspro/bin/CC -D_REENTRANT 
-D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-D_POSIX_PTHREAD_SEMANTICS -DSOLARIS -DSOLARIS10 -DNDEBUG -DNO_DEBUG -D_UNICODE 
-DUNICODE -D_RWSTD_REENTRANT -D_XOPEN_SOURCE=500 -D_XPG5 
-I/opt/foss/include/ansi -I/opt/foss/include -I/opt/foss/include/ansi 
-library=no%Cstd 
-features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
 -instances=global -template=geninlinefuncs -g0 -xdebugformat=stabs -xlang=c99 
-xustr=ascii_utf16_ushort -Qoption ccfe -features=gcc -Qoption ccfe 
-features=zla -Qoption ccfe ++boolflag:sunwcch=false -xF=%none -xbuiltin=%all 
-xinline=%auto -xprefetch=auto -xprefetch_auto_type=indirect_array_access 
-xprefetch_level=3 -xalias_level=compatible -KPIC -xipo=0 -xO3 
-xregs=no%frameptr -xjobs=2 -xrestrict=%all -xthreadvar=%all -z combreloc -z 
redlocsym -z nodefaultlib -z ignore -z now -z rescan -z absexec 
-xldscope=symbolic -xlibmil -xipo=0 -xO3 -g -xtarget=pentium4 -m32 -xarch=sse2 
-xchip=pentium4 -xcache=8/64/4:256/128/8 -lc -lm -ldl -lpthread -lposix4 -lrt 
-mt -L/opt/foss/lib -L/usr/lib -R/opt/foss/lib:/usr/lib -Y 
P,/opt/foss/lib:/usr/lib -i -L/opt/foss/lib -L/usr/lib -R/opt/foss/lib:/usr/lib 
-Bdynamic -lc -lm -lCrun -lstdcxx -Y P,/opt/foss/lib:/usr/lib -i 
-L/opt/foss/lib -L/usr/lib -R/opt/foss/lib:/usr/lib -Bdynamic -lc -lm -lCrun 
-lstdcxx -xtarget=pentium4 -m32 -xarch=sse2 -xchip=pentium4 
-xcache=8/64/4:256/128/8 -xipo=0 -xO3 -no-undefined -version-info 0:0 
-L/opt/foss/lib -L/usr/lib -R/opt/foss/lib:/usr/lib -z combreloc -z redlocsym 
-z nodefaultlib -z ignore -z now -z rescan -z absexec -xldscope=symbolic 
-xlibmil -xipo=0 -xO3 -g -xtarget=pentium4 -m32 -xarch=sse2 -xchip=pentium4 
-xcache=8/64/4:256/128/8 -lc -lm -ldl -lpthread -lposix4 -lrt -mt -o 
libtag_c.la -rpath /opt/foss/lib tag_c.lo ../../taglib/libtag.la 
-inst-prefix-dir /var/tmp/pkgbuild-mwright/FOSStaglib-1.5.0-build
libtool: relink: /opt/SunStudio12/SUNWspro/bin/CC -G -zdefs -hlibtag_c.so.0 -o 
.libs/libtag_c.so.0.0.0   .libs/tag_c.o   -R/opt/foss/lib 
-R/opt/foss/lib:/usr/lib -L/opt/foss/lib -L/usr/lib 
-L/var/tmp/pkgbuild-mwright/FOSStaglib-1.5.0-build/opt/foss/lib -ltag -lz 
-library=no%Cstd -lCrun -lstdcxx -lc -lm -ldl -lpthread -lposix4 -lrt -lc   
-xtarget=pentium4 -m32 -xarch=sse2 -mt -xtarget=pentium4 -m32 -xarch=sse2 
-xtarget=pentium4 -m32 -xarch=sse2 -mt   -mt
Undefined                       first referenced
 symbol                             in file
TagLib::TrueAudio::File::File(const 
char*,bool,TagLib::AudioProperties::ReadStyle) .libs/tag_c.o
TagLib::Ogg::Speex::File::File(const 
char*,bool,TagLib::AudioProperties::ReadStyle) .libs/tag_c.o
TagLib::WavPack::File::File(const 
char*,bool,TagLib::AudioProperties::ReadStyle) .libs/tag_c.o
TagLib::Ogg::FLAC::File::File(const 
char*,bool,TagLib::AudioProperties::ReadStyle) .libs/tag_c.o
ld: fatal: Symbol referencing errors. No output written to 
.libs/libtag_c.so.0.0.0
goanna% 

And this is how I would like libtool to link it, is there some
option for libtool 2.2.4 to move the:

-L/var/tmp/pkgbuild-mwright/FOSStaglib-1.5.0-build/opt/foss/lib -ltag 

first, before the -L options, like the following link command that works:

goanna% /opt/SunStudio12/SUNWspro/bin/CC -D_REENTRANT -D__EXTENSIONS__ 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS 
-DSOLARIS10 -DNDEBUG -DNO_DEBUG -D_UNICODE -DUNICODE -D_RWSTD_REENTRANT 
-D_XOPEN_SOURCE=500 -D_XPG5 -I/opt/foss/include/ansi -I/opt/foss/include 
-I/opt/foss/include/ansi -library=no%Cstd 
-features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
 -instances=global -template=geninlinefuncs -g0 -xdebugformat=stabs -xlang=c99 
-xustr=ascii_utf16_ushort -Qoption ccfe -features=gcc -Qoption ccfe 
-features=zla -Qoption ccfe ++boolflag:sunwcch=false -xF=%none -xbuiltin=%all 
-xinline=%auto -xprefetch=auto -xprefetch_auto_type=indirect_array_access 
-xprefetch_level=3 -xalias_level=compatible -KPIC -xipo=0 -xO3 
-xregs=no%frameptr -xjobs=2 -xrestrict=%all -xthreadvar=%all -z combreloc -z 
redlocsym -z nodefaultlib -z ignore -z now -z rescan -z absexec 
-xldscope=symbolic -xlibmil -xipo=0 -xO3 -g -xtarget=pentium4 -m32 -xarch=sse2 
-xchip=pentium4 -xcache=8/64/4:256/128/8 -lc -lm -ldl -lpthread -lposix4 -lrt 
-mt -L/var/tmp/pkgbuild-mwright/FOSStaglib-1.5.0-build/opt/foss/lib -ltag 
-L/opt/foss/lib -L/usr/lib -R/opt/foss/lib:/usr/lib -Y P,/opt/foss/lib:/usr/lib 
-i -L/opt/foss/lib -L/usr/lib -R/opt/foss/lib:/usr/lib -Bdynamic -lc -lm -lCrun 
-lstdcxx -Y P,/opt/foss/lib:/usr/lib -i -L/opt/foss/lib -L/usr/lib 
-R/opt/foss/lib:/usr/lib -Bdynamic -lc -lm -lCrun -lstdcxx -xtarget=pentium4 
-m32 -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8 -xipo=0 -xO3 -z defs 
-L/opt/foss/lib -L/usr/lib -R/opt/foss/lib:/usr/lib -z combreloc -z redlocsym 
-z nodefaultlib -z ignore -z now -z rescan -z absexec -xldscope=symbolic 
-xlibmil -xipo=0 -xO3 -g -xtarget=pentium4 -m32 -xarch=sse2 -xchip=pentium4 
-xcache=8/64/4:256/128/8 -lc -lm -ldl -lpthread -lposix4 -lrt -mt -G -zdefs 
-hlibtag_c.so.0 -o .libs/libtag_c.so.0.0.0   .libs/tag_c.o   -R/opt/foss/lib 
-R/opt/foss/lib:/usr/lib -L/opt/foss/lib -L/usr/lib -lz -library=no%Cstd -lCrun 
-lstdcxx -lc -lm -ldl -lpthread -lposix4 -lrt -lc   -xtarget=pentium4 -m32 
-xarch=sse2 -mt -xtarget=pentium4 -m32 -xarch=sse2 -xtarget=pentium4 -m32 
-xarch=sse2 -mt   -mt
CC: Warning: "-g" overrides "-g0", debugging information will be produced and 
inlining will be disabled.
ld: warning: option -z[defs|nodefs] appears more than once, first setting taken
goanna% 

Some other changes I made in the above link line:

-no-undefined changed to -z defs
-version-info dropped
passed all the other options to CC.

The rpath is OK with my manual link line, as the libtag.so and
libtag_c.so shared libraries will be installed in /opt/foss/lib:

goanna% dump -Lv .libs/libtag_c.so.0.0.0 

.libs/libtag_c.so.0.0.0:

  **** DYNAMIC SECTION INFORMATION ****
.dynamic:
[INDEX] Tag         Value
[1]     NEEDED          libc.so.1
[2]     NEEDED          libtag.so.1
[3]     NEEDED          libCrun.so.1
[4]     NEEDED          libstdcxx.so.4
[5]     INIT            0x4f38
[6]     FINI            0x5008
[7]     SONAME          libtag_c.so.0
[8]     RUNPATH         
/opt/foss/lib:/usr/lib:/opt/SunStudio12/SUNWspro/lib/rw7:/opt/SunStudio12/SUNWspro/lib/sse2:/opt/SunStudio12/SUNWspro/lib:/opt/SUNWspro/lib/sse2:/opt/SUNWspro/lib:/usr/ccs/lib:/lib:/usr/lib
[9]     RPATH           
/opt/foss/lib:/usr/lib:/opt/SunStudio12/SUNWspro/lib/rw7:/opt/SunStudio12/SUNWspro/lib/sse2:/opt/SunStudio12/SUNWspro/lib:/opt/SUNWspro/lib/sse2:/opt/SUNWspro/lib:/usr/ccs/lib:/lib:/usr/lib
[10]    HASH            0xc4
[11]    STRTAB          0x10c8
[12]    STRSZ           0x1db7
[13]    SYMTAB          0x628
[14]    SYMENT          0x10
[15]    CHECKSUM        0x81e4
[16]    VERNEED         0x2e80
[17]    VERNEEDNUM      0x2
[18]    RELCOUNT        0x11
[19]    PLTSZ           0xf8
[20]    PLTREL          0x11
[21]    JMPREL          0x2fd0
[22]    REL             0x2ed0
[23]    RELSZ           0x1f8
[24]    RELENT          0x8
[25]    FEATURE_1       PARINIT
[26]    SUNW_CAP        0xb4
[27]    FLAGS           BIND_NOW
[28]    FLAGS_1         [ NOW NODEFLIB ]
[29]    PLTGOT          0x1518c
goanna% 

Thanks, Mark


-- 

Reply via email to