libtool
[Top][All Lists]
Advanced

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

Re: should libtool --relink expand lib*.la files before -L options?


From: Mark Wright
Subject: Re: should libtool --relink expand lib*.la files before -L options?
Date: Fri, 13 Jun 2008 21:20:57 +1000

On Thu, 12 Jun 2008 23:32:29 +0200
Ralf Wildenhues <address@hidden> wrote:

> * Mark Wright wrote on Thu, Jun 12, 2008 at 06:06:58PM CEST:
> > Ralf Wildenhues <address@hidden> wrote:
> > > While link mode will try to use the uninstalled libraries
> > > throughout (so you don't pick up an old, previously installed
> > > one), relink mode will try to use the installed versions of the
> > > other just-built libraries.
> > 
> > Yes it does, however it finds an old library in LDFLAGS before the
> > installed one in:
> > 
> > -L/h/goanna/2/eng/dev/autotools/t/pkgbuild/opt/foss/lib
> 
> That's the sort of conflict that is just impossible to resolve.
> For your specific case, the path to the newly installed library
> should go early, for other users it shouldn't (because they have
> other, unrelated libraries in both the newly installed path and
> some other path listed early).
> 
> Sorry, you can't have that sort of flexibility portably.

Hello Ralf,

OK, thanks.  I used the workaround of placing the newly installed
library location first in LDFLAGS, something like:

export LDFLAGS="-L/h/goanna/2/eng/dev/autotools/t/pkgbuild/opt/foss/lib 
$LDFLAGS"

> If you need other libraries from that path where the old,
> unwanted one lives, make symlinks to them in some new directory.

That would probably help in some other people's situations, but
I don't have that luxury as we are trying to create a build environment
so that other developers can build KDE4.

For this particular library, it relinked OK with the package
installation directory at the front of the LDFLAGS.
On Solaris the runpath is determined by the -R options (like
GNU ld -runpath).  So with the real library the runpath does not
contain the directory that I added at the front of the LDFLAGS:

goanna% dump -Lv /opt/foss/lib/libtag_c.so | grep RUNPATH
[13]
RUNPATH         
/opt/foss/lib:/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
goanna% 

So it finds the other libraries OK without creating symlinks.

> Generally, if you want to have several versions of some library at the
> same time, put them in distinct $prefix'es, apart from other
> libraries. That helps to minimize such conflicts.
> 
> Cheers,
> Ralf

One the KDE4 Solaris project we have to somehow copy with incompatible
libraries installed in /usr by the JDS Gnome project.  Unfortunately we
do not have that luxury.

But of course none of us get paid to work on KDE4 or libtool.

For the libtool relink issue above and discussed earlier, on some projects
it might help avoid other developers hitting the relink problem if libtool had
an option to look for libraries in the build directories first.  But
I guess that would be hard to code in libtool, I would not know where to
start.  The workaround seems easy after we understand the problem.

However here is a similar failure, this time during a link:

pkgbuild: /bin/bash ../libtool --tag=CC --mode=link 
/opt/SunStudio12/SUNWspro/bin/cc  -xc99=%all  -errshort=full -errfmt=error 
-errwarn=%none -g -xdebugformat=stabs -xcsi -xustr=ascii_utf16_ushort 
-xalias_level=std -features=extinl -xF=%none -xbuiltin=%all -xinline=%auto 
-xprefetch=auto -xprefetch_auto_type=indirect_array_access -xprefetch_level=3 
-xthreadvar=%all -z combreloc -z redlocsym -z nodefaultlib -z ignore -z now -z 
rescan -z absexec -xldscope=symbolic -xlibmil -xipo=0 -xO3 -g -xipo=0 -xO3 
-xregs=no%frameptr -xjobs=2 -KPIC -xrestrict=%all -xtarget=pentium4 -m32 
-xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8 -L/opt/foss/lib -L/usr/lib 
-R/opt/foss/lib:/usr/lib  -lc -lm -ldl -lpthread -lposix4 -lrt -mt -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_XOPEN_SOURCE=600 -D_XPG6 -D_POSIX_C_SOURCE=200112L 
-D__XOPEN_OR_POSIX -D_STRICT_STDC -D_STRICT_STDC__ -D_STDC_C99 -D_ISOC99_SOURCE 
 -I/opt/foss/include   -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 cd-info  cd-info.o cddb.o util.o getopt.o getopt1.o 
../lib/iso9660/libiso9660.la ../lib/driver/libcdio.la  -L/opt/foss/lib 
-lvcdinfo -liso9660 -lcdio -lsocket -lncursesw -lnsl -lm -liconv -liconv 
-lsocket -lncursesw -ltinfow -lnsl -lm
pkgbuild: libtool: link: /opt/SunStudio12/SUNWspro/bin/cc -xc99=%all 
-errshort=full -errfmt=error -errwarn=%none -g -xdebugformat=stabs -xcsi 
-xustr=ascii_utf16_ushort -xalias_level=std -features=extinl -xF=%none 
-xbuiltin=%all -xinline=%auto -xprefetch=auto 
-xprefetch_auto_type=indirect_array_access -xprefetch_level=3 -xthreadvar=%all 
-z combreloc -z redlocsym -z nodefaultlib -z ignore -z now -z rescan -z absexec 
-xldscope=symbolic -xlibmil -xipo=0 -xO3 -g -xipo=0 -xO3 -xregs=no%frameptr 
-xjobs=2 -KPIC -xrestrict=%all -xtarget=pentium4 -m32 -xarch=sse2 
-xchip=pentium4 -xcache=8/64/4:256/128/8 -mt -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_XOPEN_SOURCE=600 
-D_XPG6 -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX -D_STRICT_STDC 
-D_STRICT_STDC__ -D_STDC_C99 -D_ISOC99_SOURCE -I/opt/foss/include -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 -mt -o .libs/cd-info cd-info.o cddb.o 
util.o getopt.o getopt1.o  -L/opt/foss/lib -L/usr/lib 
../lib/iso9660/.libs/libiso9660.so 
/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/lib/driver/.libs/libcdio.so
 ../lib/driver/.libs/libcdio.so -lc -ldl -lpthread -lposix4 -lrt -lvcdinfo 
-liso9660 -lcdio -liconv -lsocket -lncursesw -ltinfow -lnsl -lm -mt 
-R/opt/foss/lib -R/opt/foss/lib:/usr/lib
pkgbuild: ld: warning: file ../lib/driver/.libs/libcdio.so: linked to 
/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/lib/driver/.libs/libcdio.so:
 attempted multiple inclusion of file
pkgbuild: ld: fatal: recording name conflict: file 
`../lib/iso9660/.libs/libiso9660.so' and file `/usr/lib/libiso9660.so' provide 
identical dependency names: libiso9660.so.5  (possible multiple inclusion of 
the same file)
pkgbuild: ld: fatal: recording name conflict: file 
`/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/lib/driver/.libs/libcdio.so'
 and file `/usr/lib/libcdio.so' provide identical dependency names: 
libcdio.so.7  (possible multiple inclusion of the same file)
pkgbuild: ld: fatal: File processing errors. No output written to .libs/cd-info
pkgbuild: make[4]: *** [cd-info] Error 1
pkgbuild: make[4]: Leaving directory 
`/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/src'
pkgbuild: make[3]: *** [all-recursive] Error 1
pkgbuild: make[3]: Leaving directory 
`/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/src'
pkgbuild: make[2]: *** [all-recursive] Error 1
pkgbuild: make[2]: Leaving directory 
`/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2'
pkgbuild: make[1]: *** [all] Error 2
pkgbuild: make[1]: Leaving directory 
`/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2'
pkgbuild: Bad exit status from /var/tmp/pkgbuild-mwright/pkgbuild-tmp-2.28057 
(%build)
--- command output ends --- finished at Fri Jun 13 13:27:11 EST 2008

INFO: pkgbuild -ba finished at Fri Jun 13 13:27:11 EST 2008

ERROR: FOSSlibcdio FAILED
INFO: Check the build log
in /h/goanna/2/os_5.10/cbe/build-logs/FOSSlibcdio.log for details

The -L and -R options are duplicated in CFLAGS, CXXFLAGS and LDFLAGS.

So I manually re-order the link line to try my suggestion of
a libtool option to place the build directory libraries on
the link line before the -L options, it still fails though:

goanna% /opt/SunStudio12/SUNWspro/bin/cc -xc99=%all -errshort=full 
-errfmt=error -errwarn=%none -g -xdebugformat=stabs -xcsi 
-xustr=ascii_utf16_ushort -xalias_level=std -features=extinl -xF=%none 
-xbuiltin=%all -xinline=%auto -xprefetch=auto 
-xprefetch_auto_type=indirect_array_access -xprefetch_level=3 -xthreadvar=%all 
-z combreloc -z redlocsym -z nodefaultlib -z ignore -z now -z rescan -z absexec 
-xldscope=symbolic -xlibmil -xipo=0 -xO3 -g -xipo=0 -xO3 -xregs=no%frameptr 
-xjobs=2 -KPIC -xrestrict=%all -xtarget=pentium4 -m32 -xarch=sse2 
-xchip=pentium4 -xcache=8/64/4:256/128/8 -mt -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_XOPEN_SOURCE=600 
-D_XPG6 -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX -D_STRICT_STDC 
-D_STRICT_STDC__ -D_STDC_C99 -D_ISOC99_SOURCE -I/opt/foss/include -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 -mt -o .libs/cd-info cd-info.o cddb.o 
util.o getopt.o getopt1.o ../lib/iso9660/.libs/libiso9660.so 
/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/lib/driver/.libs/libcdio.so
 ../lib/driver/.libs/libcdio.so -L/opt/foss/lib -L/usr/lib -lc -ldl -lpthread 
-lposix4 -lrt -lvcdinfo -liso9660 -lcdio -liconv -lsocket -lncursesw -ltinfow 
-lnsl -lm -mt -R/opt/foss/lib -R/opt/foss/lib:/usr/lib
ld: warning: file ../lib/driver/.libs/libcdio.so: linked to 
/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/lib/driver/.libs/libcdio.so:
 attempted multiple inclusion of file
ld: fatal: recording name conflict: file `../lib/iso9660/.libs/libiso9660.so' 
and file `/usr/lib/libiso9660.so' provide identical dependency names: 
libiso9660.so.5  (possible multiple inclusion of the same file)
ld: fatal: recording name conflict: file 
`/h/goanna/2/os_5.10/cbe/BUILD/FOSSlibcdio-0.78.2/i386/LIBCDIO/0.78.2/lib/driver/.libs/libcdio.so'
 and file `/usr/lib/libcdio.so' provide identical dependency names: 
libcdio.so.7  (possible multiple inclusion of the same file)
ld: fatal: File processing errors. No output written to .libs/cd-info
goanna% 

OK, so obviously having conflicting libraries in /usr/lib causes
problems.  I must be a masochist :-)

Thanks, I will somehow code around these issues, or not
build the conflicting library if coding around it looks impossible.

Thanks, Mark

-- 




reply via email to

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