Linking with lld-link produced a lot of messages:
lld-link: warning: ignoring unknown argument '-fuse-ld=lld'
For example on the bot: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc
This avoids adding that argument when using lld-link.
Differential D69030
[cmake] Suppress unknown argument warning when linking with lld-link russell.gallop on Oct 16 2019, 5:06 AM. Authored by
Details Linking with lld-link produced a lot of messages: For example on the bot: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc This avoids adding that argument when using lld-link.
Diff Detail Event TimelineComment Actions Hm, we don't see these warnings. We use CMAKE_LINKER=C:/b/s/w/ir/cache/builder/src/third_party/llvm-bootstrap-install/bin/lld-link.exe to make cmake use lld-link. It looks like the bot you link to explicitly sets -DLLVM_USE_LINKER=lld which I always figured translates to "pass this -fuse-ld" flag. So I'd say the bot configuration is maybe not quite right? I'd fix that instead. Maybe we should have a "LLVM_USE_LINKER" and CMAKE_LINKER can't be set at the same time" warning instead? But if this change helps you somehow, I don't see a problem with landing it either. (But again, for the bot you link to, I'd argue a better fix is to make it set fewer cmake settings.) Comment Actions Ah, I got the settings from the bot, but that makes sense.
Hmm, I think that makes sense. CMake defaults to using the compiler for linking. Is there a case where you'd want to specify a different compiler with CMAKE_LINKER then add LLVM_USE_LINKER?
I think that landing this might confuse the usage (even more). I think that warning against this would help clarify the situation. Scanned through the bot configuration and it is just: that use that combination. I'll put up review to change that*, then look at adding a warning. Comment Actions Agreed that this usage shouldn't be encouraged so abandoning review.
Also couldn't obviously see how to add an appropriate warning. |