PATCH: Support LD_AS_NEEDED

Jakub Jelinek jakub@redhat.com
Thu May 7 15:07:00 GMT 2009


On Thu, May 07, 2009 at 04:01:17PM +0100, Nick Clifton wrote:
> >I got a request to support LD_AS_NEEDED.  OK for trunk?
> 
> Nope.
> 
> No patch that adds the passing of command line switches via environment 
> variables is ever going to be accepted.
> 
> It confuses users when the linker does not behave in way that looking at 
> the linker command line would suggest.  Plus it makes debugging even 
> more difficult since it can be very difficult to determine exactly what 
> the environment variables contain at the time that the linker is executed.

Yeah, 100% agreed.
Plus users that want --as-needed to be by default the first
option can always do
mkdir -p ~/bin
echo '#!/bin/sh' > ~/bin/ld
echo 'exec /usr/bin/ld --as-needed "$@"' >> ~/bin/ld
chmod 755 ~/bin/ld
PATH=~/bin:$PATH make

	Jakub



More information about the Binutils mailing list