-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[runtimes] Allow building against an installed LLVM tree
I am currently trying to test the LLVM runtimes (including compiler-rt) against an installed LLVM tree rather than a build tree (since that is no longer available). Currently, the runtimes build of compiler-rt assumes that LLVM_BINARY_DIR is writable since it uses configure_file() to write there during the CMake configure stage. Instead, generate this file inside CMAKE_CURRENT_BINARY_DIR, which will match LLVM_BINARY_DIR when invoked from llvm/runtimes/CMakeLists.txt. I also needed to make a minor change to the hwasan tests: hwasan_symbolize was previously found in the LLVM_BINARY_DIR, but since it is generated as part of the compiler-rt build it is now inside the CMake build directory instead. I fixed this by passing the output directory to lit as config.compiler_rt_bindir and using llvm_config.add_tool_substitutions(). For testing that we no longer write to the LLVM install directory as part of testing or configuration, I created a read-only bind mount and configured the runtimes builds as follows: ``` $ sudo mount --bind --read-only ~/llvm-install /tmp/upstream-llvm-readonly $ cmake -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_COMPILER=/tmp/upstream-llvm-readonly/bin/clang \ -DCMAKE_CXX_COMPILER=/tmp/upstream-llvm-readonly/bin/clang++ \ -DLLVM_INCLUDE_TESTS=TRUE -DLLVM_ENABLE_ASSERTIONS=TRUE \ -DCOMPILER_RT_INCLUDE_TESTS=TRUE -DCOMPILER_RT_DEBUG=OFF \ -DLLVM_ENABLE_RUNTIMES=compiler-rt \ -DLLVM_BINARY_DIR=/tmp/upstream-llvm-readonly \ -G Ninja -S ~/upstream-llvm-project/runtimes \ -B ~/upstream-llvm-project/runtimes/cmake-build-debug-llvm-git ``` Reviewed By: ldionne Pull Request: #86209
- Loading branch information
1 parent
25909b8
commit b1be213
Showing
4 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters