[csw-maintainers] libtool rearranges linker arguments and puts -L/opt/csw/lib last

Sebastian Kayser skayser at opencsw.org
Sun Jan 10 11:54:24 CET 2010


Sebastian Kayser wrote on 10.01.2010 00:00:
> When I try to build dante with kerberos support (enabled per default),
> libtool IMHO messes up the call to ld which then fails to find the CSW
> kerberos libraries.
> 
> 
> /bin/bash ../libtool --tag=CC --mode=link /opt/studio/SOS11/SUNWspro/bin/cc -DSOCKS_CLIENT=1 -DSOCKS_SERVER=0 -DSOCKSLIBRARY_DYNAMIC=0 -xO3 -xarch=v8 -Xt   -xarch=v8 -L/opt/csw/lib -L/opt/csw/lib -R/opt/csw/lib -R/opt/csw/lib/ -R/opt/csw/lib -L/opt/csw/lib -z combreloc -z text -z ignore -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lresolv -lsocket -lnsl -o libsocks.la -rpath /opt/csw/lib -version-info 1:1:1 config_parse.lo config_scan.lo Raccept.lo Rbind.lo Rgetpeername.lo Rgetsockname.lo Rrresvport.lo io.lo address.lo authneg.lo client.lo clientconfig.lo clientprotocol.lo udp.lo userio.lo connectchild.lo config.lo log.lo protocol.lo socket.lo udp_util.lo util.lo Rbindresvport.lo Rconnect.lo Rgethostbyname.lo debug.lo Rcompat.lo msproxy_clientprotocol.lo hostcache.lo broken.lo serr.lo httpproxy.lo tostring.lo addressmatch.lo Rlisten.lo upnp.lo gssapi.lo iobuf.lo ../libscompat/libscompat.la -L/opt/csw/lib -R/opt/csw/lib -R/opt/csw/lib/ -R/opt/csw/lib -L/opt/csw/
li
> b -z combreloc -z text -z ignore -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lresolv -lsocket -lnsl -lpam  -lnsl -lsocket  -lresolv  -ldl
> /usr/ccs/bin/ld -G -h libsocks.so.0 -o .libs/libsocks.so.0.1.1  .libs/config_parse.o .libs/config_scan.o .libs/Raccept.o .libs/Rbind.o .libs/Rgetpeername.o .libs/Rgetsockname.o .libs/Rrresvport.o .libs/io.o .libs/address.o .libs/authneg.o .libs/client.o .libs/clientconfig.o .libs/clientprotocol.o .libs/udp.o .libs/userio.o .libs/connectchild.o .libs/config.o .libs/log.o .libs/protocol.o .libs/socket.o .libs/udp_util.o .libs/util.o .libs/Rbindresvport.o .libs/Rconnect.o .libs/Rgethostbyname.o .libs/debug.o .libs/Rcompat.o .libs/msproxy_clientprotocol.o .libs/hostcache.o .libs/broken.o .libs/serr.o .libs/httpproxy.o .libs/tostring.o .libs/addressmatch.o .libs/Rlisten.o .libs/upnp.o .libs/gssapi.o .libs/iobuf.o -z allextract ../libscompat/.libs/libscompat.a -z defaultextract  -R/opt/csw/lib -R/opt/csw/lib/ -ldl -lresolv -lsocket -lnsl -lpam -lkrb5support -lcom_err -lk5crypto -lkrb5 -lgssapi_krb5 -L/opt/csw/lib -lc
> ld: fatal: library -lkrb5support: not found
> ld: fatal: library -lcom_err: not found
> ld: fatal: library -lk5crypto: not found
> ld: fatal: library -lkrb5: not found
> ld: fatal: library -lgssapi_krb5: not found
> ld: fatal: File processing errors. No output written to .libs/libsocks.so.0.1.1
> gmake[3]: *** [libsocks.la] Error 1
> gmake[3]: Leaving directory `/home/skayser/mgar/pkg/dante/trunk/work/solaris8-sparc/build-isa-sparcv8/dante-1.2.0/lib'
> 
> 
> To me it looks like libtool is rearranging linker flags. When it calls
> /usr/ccs/bin/ld it puts -L/opt/csw/lib after all the -l options which
> obviously breaks any references to CSW libs. The invocation of libtool
> itself still contains the correct -L/-l order. Any idea how to fix or
> circumvent this?
> 
> $ work/solaris8-sparc/build-isa-sparcv8/dante-1.2.0/libtool --version
> ltmain.sh (GNU libtool) 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)

The Debian patch section for Dante showed that they patch ./configure to
use the platform libtool instead of the one shipped with Dante. That's
what I ended up doing also.

$ gsed -ie 's,^LIBTOOL=.*,LIBTOOL=/opt/csw/bin/libtool,' \
	work/solaris8-sparc/build-isa-sparcv8/dante-1.2.0/configure
$ grep ^LIBTOOL= \
 	work/solaris8-sparc/build-isa-sparcv8/dante-1.2.0/configure
LIBTOOL=/opt/csw/bin/libtool

The problem went away. There still is a downrev libtool in $(WORKSRC)
which seems to get re-generated by ./configure, but looking at the build
logs its the /opt/csw/bin/libtool which now takes care of the linking.

Sebastian


More information about the maintainers mailing list