[PATCH] Generalize -fuse-ld= to support absolute path or arbitrary ld.linker

Martin Liška mliska@suse.cz
Mon Jun 28 13:26:21 GMT 2021

On 6/28/21 2:24 PM, Artur Sinila wrote:
> On Mon, 2021-06-28 at 14:08 +0200, Martin Liška wrote:
>> On 6/26/21 4:44 PM, Artur Sinila wrote:
>>> Not so gentle ping :)
>>> What should happen in order for this patch to be accepted?
>> Hello.
>> We came up to conclusion that one can use the currently supported
>> option
>> -fuse-ld={bfd,gold,lld} with -B that can point to an arbitrary path
>> the such linker is expected.
>> Cheers,
>> Martin
> Hello.
> Thank you for the reply. I'd like to use mold linker with gcc:
> https://github.com/rui314/mold. So your solution doesn't help.

Well, kind of works. You only need to create a symlink called
ld which will point to your linker (plus using -B argument as mentioned).

> There are 2 options:
> 1. Add mold to -fuse-ld option
> 2. Implement --ld-path
> The 2nd option is much more future-proof: you won't need to add new
> -fuse-ld variant each time new linker comes up. To provide some
> context: clang had been supporting passing path to -fuse-ld, but since
> clang 12 this is deprecated in favor of new --ld-path option. I think
> we should take an example from clang and implement this useful feature
> in gcc as well.

Can you please provide a pointer for the deprecation.
I'm adding Jakub who recommended using the -B argument.


> Cheers,
> Artur Sinila

More information about the Gcc-patches mailing list