Pass LLVM_USE_LINKER flag to CrossCompile toolchain if set.
This change only affects linking the NATIVE toolchain.
Noticed this when passing:
-DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_USE_LINKER=gold
Differential D39734
[cmake] Pass LLVM_USE_LINKER flag to CrossCompile toolchain if set hintonda on Nov 7 2017, 7:49 AM. Authored by
Details Pass LLVM_USE_LINKER flag to CrossCompile toolchain if set. This change only affects linking the NATIVE toolchain. Noticed this when passing: -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_USE_LINKER=gold
Diff Detail
Event TimelineComment Actions I don't think we can do this unconditionally like this. It seems to me like you could have a situation where you want to use different linkers for the host tools and target binaries. Comment Actions I can make it conditional, e.g., iff LLVM_OPTIMIZED_TABLEGEN=ON, but honestly can't think of a case where you would want to use different linkers. Comment Actions The code path you're modifying isn't just for building optimized tools, it also gets triggered when building the host tools in cross compilations. It is totally reasonable that I might want to use a different linker for host binaries from the linker used for target binaries. One example would be if I'm cross compiling to say PPC and wanting to use gold, but want to use lld as the linker for the host tools. |