[PATCH] D80225: [Driver] Recognize -fuse-ld={bfd, gold, lld} but don't prepend "ld." or "ld64." for other values
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 28 18:11:22 PDT 2020
MaskRay added a comment.
@theraven Are you ok with this change? You seem to have a use case not using ld.bfd, ld.gold or ld.lld . This change will require you to adapt.
In D80225#2049466 <https://reviews.llvm.org/D80225#2049466>, @jyknight wrote:
> It's worrying to me that there number of places in LLVM that at the exact argument value of "-fuse-ld=". E.g. in the windows and PS4 toolchains. We already claim to support arbitrary values and full paths, but if you specify "-fuse-ld=/path/to/lld-link" on Windows today, you end up with different behavior than "-fuse-ld=lld" (which gets translated to searching for an "lld-link" binary, but also triggers other conditions).
>
> That's not a reason to not make this particular change, but if conditionals on the flavor of linker are going to be used, that seems like perhaps a reason why we should not accept arbitrary values at all?
This is indeed unfortunate, but I can see the reasons people customize linker options for different linkers. An arbitrary value is a bit convenient when people want to compare behavior differences between different versions of a linker. As a linker developer I do this a lot. Some ClangBuiltLinux folks do this. (In addition, an absolute path can sometimes give extra confidence that a particular executable is picked -> `-fuse-ld=lld` may pick one from PATH if `ld.lld` does not sit beside `clang`.) Now @keith also expresses interest in such a feature. I think it is really difficult for us to drop it now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80225/new/
https://reviews.llvm.org/D80225
More information about the cfe-commits
mailing list