[llvm] f9db0d2 - [cmake][runtimes] Add missing dependency on LLVMgold.so (#94199)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 05:41:48 PDT 2024
Author: Nikita Popov
Date: 2024-06-04T14:41:43+02:00
New Revision: f9db0d2c43d2956813fab8309def6b23adc73f35
URL: https://github.com/llvm/llvm-project/commit/f9db0d2c43d2956813fab8309def6b23adc73f35
DIFF: https://github.com/llvm/llvm-project/commit/f9db0d2c43d2956813fab8309def6b23adc73f35.diff
LOG: [cmake][runtimes] Add missing dependency on LLVMgold.so (#94199)
When doing a runtimes build with LTO using ld.bfd (or ld.gold), the
build starts failing with ninja 1.12, which added a new critical path
scheduler. The reason is that LLVMgold.so is not available yet at the
point where runtimes start being build, leading to configuration
failures in the nested cmake invocation.
Fix this by adding an explicit dependency on LLVMgold.so if it is
available. (It may not always be necessary, e.g. if the used linker is
lld, but it would be hard to detect when exactly it may or may not be
needed, so always adding the dependency is safer.)
Added:
Modified:
llvm/cmake/modules/LLVMExternalProjectUtils.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
index 740645a061f38..eef0c16f6847e 100644
--- a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
+++ b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -240,6 +240,11 @@ function(llvm_ExternalProject_Add name source_dir)
list(APPEND compiler_args -DCMAKE_RC_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-rc${CMAKE_EXECUTABLE_SUFFIX})
endif()
list(APPEND ARG_DEPENDS ${TOOLCHAIN_TOOLS})
+ # Add LLVMgold.so dependency if it is available, as clang may need it for
+ # LTO.
+ if(CLANG_IN_TOOLCHAIN AND TARGET LLVMgold)
+ list(APPEND ARG_DEPENDS LLVMgold)
+ endif()
endif()
if(ARG_STRIP_TOOL)
More information about the llvm-commits
mailing list