https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101215
Bug ID: 101215
Summary: Using non-standard custom linker with -fuse-ld
Product: gcc
Version: 10.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: freesoftware at logarithmus dot dev
Target Milestone: ---
Hello. I'd like to have an ability to use custom linkers with gcc.
Unfortunately gcc's `-fuse-ld` option only supports fixed set of linkers: ld,
gold & lld. On the other hand, clang supports passing path to linker's binary
with `-fuse-ld`.
My specific use case is novell `mold` linker: https://github.com/rui314/mold
I know that I can use mold like this: `mold -run gcc `. But it
works by intercepting system calls and changing all calls to `ld` with `mold`.
It looks kinda hacky to be honest. So I think the best solution would be to
implement custom linkers support into gcc.
I've never worked with gcc codebase before, so I'll appreciate any guidance
about implementing this feature.