aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-04 14:41:43 +0200
committerGitHub <noreply@github.com>2024-06-04 14:41:43 +0200
commitf9db0d2c43d2956813fab8309def6b23adc73f35 (patch)
tree33c21131f68c1fc9c8e2a6c9cc69936af9a2c5c7 /llvm
parent794457f6f99aac77f123fa2245e91a3b442c7926 (diff)
downloadllvm-f9db0d2c43d2956813fab8309def6b23adc73f35.zip
llvm-f9db0d2c43d2956813fab8309def6b23adc73f35.tar.gz
llvm-f9db0d2c43d2956813fab8309def6b23adc73f35.tar.bz2
[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.)
Diffstat (limited to 'llvm')
-rw-r--r--llvm/cmake/modules/LLVMExternalProjectUtils.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
index 740645a..eef0c16f 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)