Am Wed, 11 Apr 2012 14:51:14 -0400
schrieb "Nick Sabalausky" <[email protected]>:

> "Steven Schveighoffer" <[email protected]> wrote in message 
> news:[email protected]...
> >
> > I'm not a linker expert, but I found this page which describes the changes 
> > and the reasoning:
> >
> > See this post: https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition
> >
> 
> That says the order-dependent  behavior is caused by --as-needed being 
> default. I'm no linker expert either, but the description of the purpose 
> of --as-needed sounds...goofy and pointless (although maybe it makes sense 
> for C's lack of a proper module system?).
> 
> It can be disabled, apperently, by using --no-as-needed. That page tries to 
> discourage people from doing that though, but the reason it gives seems 
> vague. Personally, I'd wonder whether going along with --as-needed is really 
> even worth doing. (Of course, if it turns out to be easy to fix the 
> ordering, then we may as well.)

I didn't know that --as-needed causes so much trouble. We've been using it on 
Gentoo a while before Ubuntu made that step and I know it took a while (~a 
year) until all packages would compile with it.
The problem that this solved was that libraries and applications are linked to 
other libraries they don't actually call into. On a long stream of dependencies 
an application would dynamically load way more libraries than it actually uses, 
increasing the start time. So the linker lacked the intelligence to filter out 
unnecessary libraries before.
Since there are some cases, where you must link to a library anyway, you can 
put --no-as-needed in front of them. Look at the positive side: You can now by 
default link against all libraries on your system without bloating the 
executable! :)

-- 
Marco

Reply via email to