[Top][All Lists]

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

Re: libtool chooses the wrong library version to link against

From: Roumen Petrov
Subject: Re: libtool chooses the wrong library version to link against
Date: Sat, 01 Dec 2007 18:39:07 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20071109 SeaMonkey/1.1.6

Peter O'Gorman wrote:
Andreas Metzler wrote:
Peter O'Gorman <address@hidden> wrote:
Andreas Metzler wrote:
this is about <>.
when I am building gnutls on a system with a different version of
gnutls already installed, libtool links the library libgnutls-extra
against /usr/lib/ instead of against the correct new
version DESTDIR/usr/lib/
The actual breakage does not happen at build time but at
install time - ../lib/ is translated into -lgnutls:
libtool: install: warning: relinking `'
(cd /tmp/GNUTLS/gnutls25-2.1.6/libextra; /bin/bash ../libtool  --tag=CC 
--mode=relink cc -std=gnu99 -g -Wall -O2 -D_REENTRANT -D_THREAD_SAFE -pipe -g 
-Wall -O2 -D_REENTRANT -D_THREAD_SAFE -Wno-pointer-sign -no-undefined 
-L/usr/lib -lopencdk -L/usr/lib -lgcrypt -L/usr/lib -lgpg-error -L/usr/lib 
-lnsl -L/usr/lib -lz -version-info 25:1:0 -llzo2 
-Wl,--version-script=./libgnutls-extra.vers -o -rpath 
/usr/lib gnutls_extra.lo gnutls_openpgp.lo gnutls_ia.lo 
openpgp/ ../lgl/ ../lib/ 
-inst-prefix-dir /tmp/GNUTLS/gnutls25-2.1.6/debian/tmp/)
Do you know where the -L/usr/lib is coming from?
It should from a dependent library.
I guess that first this is from opencdk and second from gpg-error.
I think from opencdk (/usr/lib/ ?) in reported case result is:

-L/usr/lib -lopencdk -L/usr/lib -lgcrypt

Since GNU crypto use xxx-config files to find location may be opencdk-config report -L/usr/lib ... and as result -L... appear in Makefile.

Andreas what is content of Makefile (i.e. please check for -L.. flag) ?
As example you could run:
grep -e -L */Makefile

I did not realize they were unusual, I seem to get them for every
single library. - Any hint where I could start digging? Might this be
related to the fact that I am running an i486 installation on a amd64
cu andreas

I have not even tried to reproduce, so have no idea where you might be
getting them from. However, I do not know of a linker that does not
search /usr/lib for libraries by default (not to say that  there is not
one, just that I do not know of one), so I would think that these are
safe to remove. It is their presence that causes the incorrect library
to be used. Libtool did add a
-L/tmp/GNUTLS/gnutls25-2.1.6/debian/tmp//usr/lib but it came after a
previously mentioned -L/usr/lib which causes the incorrect lib to be used.

It guess you could still call it a libtool bug though, we probably
should be ensuring that -L$(DESTDIR)${libdir} comes before any other -L
on the link line.

Peter, should -L$(DESTDIR)${libdir} precede -rpath ?
Also some projects use flag -rpath-link .



reply via email to

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