[PATCH] D80873: [clang][cmake] Force CMAKE_LINKER for multistage build in case of BOOTSTRAP_LLVM_ENABLE_LLD and MSVC
Kristina Bessonova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 14 06:48:49 PDT 2020
krisb marked an inline comment as done.
krisb added inline comments.
================
Comment at: clang/CMakeLists.txt:751
+ if(BOOTSTRAP_LLVM_ENABLE_LLD)
+ if(MSVC AND NOT BOOTSTRAP_CMAKE_SYSTEM_NAME)
+ set(${CLANG_STAGE}_LINKER -DCMAKE_LINKER=${LLVM_RUNTIME_OUTPUT_INTDIR}/lld-link.exe)
----------------
phosek wrote:
> I don't understand the second part of this condition, can you elaborate? Why not set `CMAKE_LINKER` to `lld-link.exe` even if `BOOTSTRAP_CMAKE_SYSTEM_NAME STREQUAL "Windows"`?
The only reason that stopped me from adding `BOOTSTRAP_CMAKE_SYSTEM_NAME STREQUAL "Windows"` case here is that there is no way to keep it working in the future (or, at least, I don't know one). Moreover, the build which sets BOOTSTRAP_CMAKE_SYSTEM_NAME equal to "Windows" is currently broken.
Since the same issue is exposed if to build LLVM with `clang/cmake/caches/DistributionExample.cmake` on Windows, I included only the changes that contribute to making this configuration buildable. I wanted to avoid making the impression that some other configurations are supported (because they are not) and also avoid adding any dead code that nobody would use and that would easily be broken.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80873/new/
https://reviews.llvm.org/D80873
More information about the cfe-commits
mailing list