While developing the new MachO port of lld, we wish to select it via clang -Wl,-flavor,darwinnew .... The compiler driver does not place -Wl,... args at the front of the lld command line, so lld must accept it at locations beyond argv
I think the problem here is that we should give thew new Darwin port a symlink like ld.lld, wasm-ld and lld-link.
Then we can teach clang to support -fuse-ld=foobar by locating the executable foobar (not ld.foobar as hard-coded by -fuse-ld=bfd -fuse-ld=gold -fuse-ld=lld) for non-ELF platforms. This requires a clang driver change.
I actually have a GCC patch sitting there for a while. https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543324.html
I need to finish it.