This gives us the option of using CMake modules from LLVM, and other
things. We will use that to deduplicate code later.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This (according to some bisecting) seems to be breaking the unified tree bots' compiler-rt builds on multiple platforms:
https://lab.llvm.org/buildbot/#/builders/57/builds/14145
https://lab.llvm.org/staging/#/builders/202/builds/483
A copy of the compiler-rt libs is no longer placed in the main build dir, though it seems to still be build in the runtimes subdir:
ld: 0706-005 Cannot find or open file: /scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/lib/clang/14.0.0/lib/aix/libclang_rt.profile-powerpc.a ld:open(): No such file or directory
From the CMake trace, seems this is causing a difference in the setting of COMPILER_RT_OUTPUT_DIR
-/home/daltenty/llvm/dev/llvm-project/compiler-rt/cmake/base-config-ix.cmake(45): set(COMPILER_RT_OUTPUT_DIR /home/daltenty/llvm/dev/build/runtimes/runtimes-bins/compiler-rt/lib/clang/14.0.0 ) +/home/daltenty/llvm/dev/llvm-project/compiler-rt/cmake/base-config-ix.cmake(45): set(COMPILER_RT_OUTPUT_DIR /home/daltenty/llvm/dev/build/./lib/clang/14.0.0 )
Seems this is because the new include of HandleOutOfTreeLLVM clobbers LLVM_LIBRARY_OUTPUT_INTDIR which is set explicit by the runtimes CMakeLists.txt:
./runtimes/CMakeLists.txt:80:set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})
The fix direction isn't immediate obvious, if we fix this in HandleOutOfTreeLLVM out of tree it'll potentially affect the rest of the runtimes that were already using HandleOutOfTreeLLVM successfully and hacking compiler-rt only doesn't seem quite right either, so I think a revert is in order until HandleOutOfTreeLLVM can be reworked to avoid this issue.
Thanks @dalteny for investigating. @phosek if you remember https://reviews.llvm.org/rG6e3946c9f558adfddfd98a51721baccd8b17bb85 the TODO you put in there about the compiler-rt build having to be standalone seems related.