help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why $(LD) is defined but not used in any implicit rules?


From: Mike Gran
Subject: Re: Why $(LD) is defined but not used in any implicit rules?
Date: Thu, 24 Jan 2019 13:17:44 -0800
User-agent: Mutt/1.10.1 (2018-07-13)

On Thu, Jan 24, 2019 at 01:09:19PM -0500, Paul Smith wrote:
> On Mon, 2018-12-31 at 17:28 -0600, Peng Yu wrote:
> > I see that LD is defined in as shown in --print-data-base. But no
> > rules use it. Then what is the purpose to define it? Should either
> > adding a rule use LD, or deleting its definition? Thanks.
> 
> There is no rule to use it because none of the built-in rules need it:
> linking rules use the compiler front-end to do linking correctly.
> 
> It exists in the default database because... it's always been there...
> 
> I don't see any reason to remove it, and there are undoubtedly some
> makefiles out there relying on it existing and being defined by default
> which would be broken if we did remove it.

I actually use LD in a makefile.  I use the value of LD to choose
between the gcc CFLAGS options "-fuse-ld=bfd", "-fuse-ld=gold" or
"-fuse-ld=lld"

In my youth, I actually wrote my own linking rules to invoke the
linker directly, but, I don't have time for that anymore. ;-)

-Mike Gran



reply via email to

[Prev in Thread] Current Thread [Next in Thread]