libtool
[Top][All Lists]
Advanced

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

Re: multiple libraries with inter-dependencies and relinking with DESTDI


From: Ralf Wildenhues
Subject: Re: multiple libraries with inter-dependencies and relinking with DESTDIR
Date: Thu, 10 Jan 2008 20:09:41 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Mike,

* Mike Frysinger wrote on Mon, Dec 31, 2007 at 09:52:36PM CET:
> archives seem to indicate this has always been an issue, and while it's been 
> getting better over time, it hasnt really been considered "fully fixed".  
> what i'm looking at here is:
> src/one/libone.la:
>       SOURCES = some files
> src/two/libtwo.la:
>       SOURCES = some files
>       LDFLAGS = ../one/libone.la
> when doing `make install DESTDIR=/some/place`, the relinking is fine for 
> libone.la.  but when relinking libtwo.la, -L$libdir is incorrectly added to 
> the linking step.  an -L flag pointing to the $DESTDIR/$libdir is added 
> before this and that's great ... it means libtwo.la is relinked against the 
> new/current version of libone.la and not some random old version in $libdir.  
> the problem with -L$libdir being added *at all* is cross-compiling.  this 
> path can easily be a host libpath which means it gets searched before the 
> normal cross-compiler library paths.

Indeed, and there has just been another bug report about this.

AFAICS, the
  add_dir="-L$libdir"
  ...
  add_dir="$add_dir -L$inst_prefix_dir$libdir"

idiom happens twice in ltmain.  

My qualm with changing that code is: sometimes we do *need* to add both
of those paths.  Otherwise, users will scream about breaking their
legitimate setups.  Now, how to find out when it is needed and when not?

FWIW, it's not only cross-compiling that suffers.  But it suffers most
obviously (through hard link failures), not less obviously (through
mistakenly linking against the wrong library).

Cheers,
Ralf




reply via email to

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