RPM Community Forums

Mailing List Message of <rpm-devel>

Re: -Wl,--as-needed so what?

From: Ralf S. Engelschall <rse+rpm-devel@rpm5.org>
Date: Sun 29 Jul 2007 - 16:04:51 CEST
Message-ID: <20070729140451.GA59513@engelschall.com>
On Thu, Jul 26, 2007, Jeff Johnson wrote:

> On Jul 26, 2007, at 4:19 AM, Ralf S. Engelschall wrote:
>
>> Ok, as in every second mail Jeff already talks about this
>> -Wl,--as-needed flag, I got tired and investigated on this stuff ;-)
>
> ;-) It's actually PLD and ALT linux that want the -Wl,--as-needed flag.
> Both are trying
> to deploy distros using the option.
>
>> Well, it's just an option which tells ld(1) to leave out any libraries
>> which are _not_ really referenced by an object. I'm not sure whether
>> I really understand all the commotion about this flag, but AFAIK the
>> current internal RPM library dependencies are already correct. Only
>> minimalized external dependencies through the bottleneck librpmmisc
>> cause trouble under -Wl,--as-needed.
>>
>> So, I've added a --with-build-maxlibdep which does for the remaining
>> librpmxxx the same as --with-build-extlibdep does for librpmisc: it
>> links against the $LIBS -- which carries the external third-party
>> libraries. This way _TRY_ to link against more libs, but -Wl,--as-needed
>> reduces automatically again. With the appended patch I was at least able
>> to build under FreebSD 6 and Fedora 7 with
>>
>> $ LDFLAGS="-Wl,--as-needed" ./configure --with-build-maxlibdep [...]
>>
>> So, is this enough to get rid of this topic or do I still miss an
>> important point?
>
> Poifect for rpm. Thank you!

Ok, committed after just renaming to --with-build-maxextlibdep
as it really is about "maximum _external_ library dependencies".

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Received on Sun Jul 29 16:07:17 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.