- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55470 added support for -fuse-ld=bfd to mean ld.bfd and -fuse-ld=gold to mean ld.gold
- rL194328 ported the feature and made -fuse-ld= available for other values (with the ld. prefix)
- D78290 changed the prefix to ld64. on Darwin.
However, the prefix (ld. or ld64.) is actually cumbersome:
- For a relative path, -fuse-ld=dir/foo currently tries to access x86_64-unknown-linux-gnu-ld.dir/foo (if LLVM_DEFAULT_TARGET_TRIPLE is x86_64-unknown-linux-gnu).
- wasm and Windows do not seem to need the ld. convention.
We could teach -fuse-ld= to check whether there is a path separator, and
omit the ld. or ld64. prefix, but then a relative path will be
unnecessarily inconsistent with a single path component.
Let's hard code the currently used values which intend to get a prefix:
bfd, gold, lld. For all other values, don't add a prefix.
GCC currently hard codes -fuse-ld={bfd,gold,lld} but does not support
other values. I am going to make it support arbitrary values.
https://sourceware.org/pipermail/gcc-patches/2020-May/546277.html