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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Peng Yu
Hi,

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.

--
Regards,
Peng

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

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

Paul Smith-20
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.


_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

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

Mike Gran
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

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make