-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[compiler-rt][www] replace deprecated LLVM_CONFIG_PATH with LLVM_CMAKE_DIR #71500
Conversation
…E_DIR This updates the standalone build docs for compiler-rt to replace deprecated LLVM_CONFIG_PATH with LLVM_CMAKE_DIR. A warning (added in D137024) is emitted for the current instructions.
Co-authored-by: Chris B <[email protected]>
@@ -123,7 +123,7 @@ <h2>Get it and get involved!</h2> | |||
<li>cd llvm-project</li> | |||
<li>mkdir build-compiler-rt</li> | |||
<li>cd build-compiler-rt</li> | |||
<li>cmake ../compiler-rt -DLLVM_CONFIG_PATH=/path/to/llvm-config</li> | |||
<li>cmake ../compiler-rt -DLLVM_CMAKE_DIR=/path/to/llvm-project/cmake/modules</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still mentions llvm-config on the line 120
and this instruction does not work for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not work -DCOMPILER_RT_INCLUDE_TESTS=ON
(which I guess default):
-- Builtin supported architectures:
CMake Error at test/CMakeLists.txt:47 (umbrella_lit_testsuite_begin):
Unknown CMake command "umbrella_lit_testsuite_begin".
but work with -DCOMPILER_RT_INCLUDE_TESTS=OFF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it still does not work - ninja
just copy a few headers and that's it
-DLLVM_CMAKE_DIR=/full_path_to_llvm_build_dir/
works as expected, but I am not sure if that was expected.
cd llvm-project/
cmake -GNinja -B ../out/compiler-rt -S ./compiler-rt -DLLVM_CMAKE_DIR=$(readlink -f ../out/llvm_build) -DCMAKE_C_COMPILER=$(readlink -f ../out/llvm_build/bin/clang) -DCMAKE_CXX_COMPILER=$(readlink -f ../out/llvm_build/bin/clang++)
ninja -C ../out/compiler-rt
ninja -C ../out/compiler-rt check-all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not work -DCOMPILER_RT_INCLUDE_TESTS=ON (which I guess default):
-- Builtin supported architectures:
CMake Error at test/CMakeLists.txt:47 (umbrella_lit_testsuite_begin):
Unknown CMake command "umbrella_lit_testsuite_begin".but work with -DCOMPILER_RT_INCLUDE_TESTS=OFF
I don't think COMPILER_RT_INCLUDE_TESTS=ON
is always the default, only if LLVM_TREE_AVAILABLE
:
llvm-project/compiler-rt/cmake/base-config-ix.cmake
Lines 35 to 41 in 8fcb822
# Setting these variables from an LLVM build is sufficient that compiler-rt can | |
# construct the output paths, so it can behave as if it were in-tree here. | |
if (LLVM_LIBRARY_OUTPUT_INTDIR AND LLVM_RUNTIME_OUTPUT_INTDIR AND PACKAGE_VERSION) | |
set(LLVM_TREE_AVAILABLE On) | |
endif() | |
if (LLVM_TREE_AVAILABLE) |
I can reproduce the error you're seeing when COMPILER_RT_INCLUDE_TESTS=ON
:
cmake -G Ninja -S compiler-rt -B build-compiler-rt -DCMAKE_C_COMPILER=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu/bin/clang-17 -DCMAKE_CXX_COMPILER=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu/bin/clang++ -DLLVM_CMAKE_DIR=cmake -DCOMPILER_RT_INCLUDE_TESTS=ON
-- Builtin supported architectures:
Traceback (most recent call last):
File "", line 22, in
IndexError: list index out of range
CMake Error at test/CMakeLists.txt:47 (umbrella_lit_testsuite_begin):
Unknown CMake command "umbrella_lit_testsuite_begin".
but the fix proposed in #98707 doesn't fix it for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-DLLVM_CMAKE_DIR=cmake
must be absolute path to the llvm/clang build dir
so probably -DLLVM_CMAKE_DIR=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu
for you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-DLLVM_CMAKE_DIR=cmake
must be absolute path to the llvm/clang build dir so probably-DLLVM_CMAKE_DIR=$HOME/clang+llvm-17.0.4-aarch64-linux-gnu
for you
that indeed did the trick, cheers
Summary: Follow up to #71500 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250884
This updates the standalone build docs for compiler-rt to replace deprecated LLVM_CONFIG_PATH with LLVM_CMAKE_DIR. A warning (added in D137024) is emitted for the current instructions.