Re: scheme48-1.8 and --as-needed, DESTDIR, -D_GNU_SOURCE
Panagiotis Christopoulos <pchrist <at> gentoo.org>
2008-07-01 08:03:32 GMT
On 08:40 Tue 01 Jul , Michael Sperber wrote:
> Thanks for the report!
> Could you briefly explain what --as-needed does, and why it's in
> Gentoo's LDFLAGS? Should we add it generally?
From GNU linker's man page:
This option affects ELF DT_NEEDED tags for dynamic libraries mentioned
on the command line after the --as-needed option. Normally, the linker
will add a DT_NEEDED tag for each dynamic library mentioned on the
command line, regardless of whether the library is actually needed.
--as-needed causes DT_NEEDED tags to only be emitted for libraries
that satisfy some symbol reference from regular objects which is
undefined at the point that the library was linked. --no-as-needed
restores the default behaviour.
In reality, it is an experimental flag, used by some of our fellow users, and
from time to time, we fix bugs related with linker failures when it is
used. But it is not considered safe, for production use and it's buggy in
earlier versions of binutils. However, theoritically, the idea behind it,
is not bad (the use of the --as-needed flag allows the linker to avoid
linking extra libraries in a binary.) For more information, you can read
our documentation about this issue.