-Wl,--as-needed

Panu Matilainen pmatilai at laiskiainen.org
Fri Jun 30 09:16:02 PDT 2006


On Fri, 30 Jun 2006, Ralf Corsepius wrote:

> On Fri, 2006-06-30 at 13:42 +0200, Axel Thimm wrote:
>> On Fri, Jun 30, 2006 at 11:47:29AM +0200, Ralf Corsepius wrote:
>>> On thing I know for sure is --as-needed having occasionally failed due
>>> to bugs somewhere.
>>
>>> ATM, IMO, --as-needed is a promise and probably works in many cases,
>>> but ... one counter example (which I am 99% sure can be found - I one
>>> had a code example, I don't have anymore) suffices to prove it as "too
>>> unreliable".
>>
>> What happens when it fails?
> Sorry, I don't recall the details (All this took place several years
> ago).
>
> IIRC, it had been plain linker breakdowns during linkage and "weird
> run-time behavior at program startup" (symbol table corruption). I don't
> know if things have stabilized sufficiently since then.
>
> Another issue I recall, was people applying --as-needed to libraries
> when combing several shared libs and interaction with --whole-archive
> (Debian policy is to use --whole-archive on shared libs, i.e. the
> contrary to what Fedora is tempted to do.)
>
> Yet another issue is portability: --as-needed is non-portable.

Right... so it's only available on reasonably new systems, is non-portable 
and unreliable to some extent, lets just forget about it as an upstream 
default thingy.

 	- Panu -



More information about the Apt-Rpm mailing list