Paul Eggert wrote:
> in coreutils CVS we're using a new gl_IGNORE_UNUSED_LIBRARIES
> macro (defined in m4/lib-ignore.m4) that tells the linker to omit
> references to libraries that are not actually used (this is the '-z
> ignore' option of the Solaris linker).
>
> At some point I was going to propose to move this into gnulib.
Does the GNU linker support this feature too? ld-2.16.1 does not document
a "-z ignore" option.
And what about the other platforms, from FreeBSD to mingw? I would prefer
to see this feature implemented in a portable way, maybe in the form
of a wrapper script
linktool gcc -o cp cp.o ../lib/libcoreutils.a $(LDADD)
The idea would be that it removes -l options from the command line as long
as the link continues to succeed. 'vim' links this way.
The interaction between linktool and libtool, when someone would be using
linktool ../libtool gcc -o cp cp.o ../lib/libcoreutils.la $(LDADD)
need some thought, though.
Bruno