[clang] [flang] [llvm] [CMake][Release] Statically link clang with stage1 runtimes (PR #127268)
Tobias Hieta via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 19 07:14:58 PST 2025
================
@@ -90,9 +88,17 @@ else()
set(CLANG_BOOTSTRAP_TARGETS ${LLVM_RELEASE_FINAL_STAGE_TARGETS} CACHE STRING "")
endif()
+if (LLVM_RELEASE_ENABLE_LTO)
+ # Enable LTO for the runtimes. We need to configure stage1 clang to default
+ # to using lld as the linker because the stage1 toolchain will be used to
+ # build and link the runtimes.
+ set(RUNTIMES_CMAKE_ARGS "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DLLVM_ENABLE_LLD=ON" CACHE STRING "")
----------------
tru wrote:
Is there a reason we can't use `LLVM_ENABLE_LTO=Thin` here? It would be more explicit that we enable ThinLTO over whatever CMake deems good in that case.
https://github.com/llvm/llvm-project/pull/127268
More information about the llvm-commits
mailing list