[compiler-rt] [compiler-rt] Use installed libc++(abi) for tests instead of build tree (PR #115077)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 8 04:28:31 PST 2024
bjope wrote:
> @mikaelholmen @thevinster Do you have a build log/cmake command that shows this issue? I am unable to reproduce this and CMake appears to have all the required dependencies.
Here is the scenario (from @mikaelholmen):
```
cmake command: CC='/mygcc/1.9.3.0-1/crosscompiler/bin/gcc' CXX='/mygcc/1.9.3.0-1/crosscompiler/bin/g++' /bin/cmake /repo/llvm --debug-trycompile -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=/compiler-clang -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld' -DLLVM_USE_LINKER=gold -DLLVM_BUILTIN_TARGETS='x86_64-unknown-linux-gnu' -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind;compiler-rt' -DRUNTIMES_x86_64-unknown-linux-gnu_SANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DRUNTIMES_x86_64-unknown-linux-gnu_SANITIZER_USE_STATIC_CXX_ABI=ON -DRUNTIMES_x86_64-unknown-linux-gnu_COMPILER_RT_USE_BUILTINS_LIBRARY=ON -DRUNTIMES_x86_64-unknown-linux-gnu_CMAKE_CXX_FLAGS='--gcc-toolchain=/mygcc/1.9.3.0-1/crosscompiler' -DRUNTIMES_x86_64-unknown-linux-gnu_SANITIZER_TEST_CXX=libstdc++ -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXX_USE_COMPILER_RT=ON -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXXABI_USE_LLVM_UNWINDER=ON -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXXABI_ENABLE_STATIC_UNWINDER=ON -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXXABI_USE_COMPILER_RT=ON -DRUNTIMES_x86_64-unknown-linux-gnu_LIBUNWIND_USE_COMPILER_RT=ON -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXX_TEST_PARAMS='enable_experimental=False' -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXXABI_TEST_PARAMS='enable_experimental=False' -DRUNTIMES_x86_64-unknown-linux-gnu_COMPILER_RT_CAN_EXECUTE_TESTS=OFF -DLLVM_RUNTIME_TARGETS='x86_64-unknown-linux-gnu' -DLLVM_STATIC_LINK_CXX_STDLIB=ON
...
-- Build files have been written to: /repo/llvm/build-all
cd /repo
DESTDIR=/tmp/tmp.3hBN2EZpSo /ninja/1.10.2/bin/ninja -j56 -C llvm/build-all -v install-runtimes
ninja: Entering directory `llvm/build-all'
...
[35/60] Performing install step for 'libcxx_fuzzer_x86_64'
[0/1] Install the project...
-- Install configuration: "Release"
...
-- Installing: /tmp/tmp.3hBN2EZpSo/repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/include/c++/v1/cstdint
...
[37/60] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.x86_64.dir/FuzzerExtraCountersWindows.cpp.o
FAILED: compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.x86_64.dir/FuzzerExtraCountersWindows.cpp.o
/repo/llvm/build-all/./bin/clang++ --target=x86_64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/repo/compiler-rt/lib/fuzzer/../../include --gcc-toolchain=/mygcc/1.9.3.0-1/crosscompiler -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -O3 -DNDEBUG -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -D_LIBCPP_ABI_VERSION=Fuzzer -nostdinc++ -fno-omit-frame-pointer -isystem /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/include/c++/v1 -std=c++17 -MD -MT compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.x86_64.dir/FuzzerExtraCountersWindows.cpp.o -MF compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.x86_64.dir/FuzzerExtraCountersWindows.cpp.o.d -o compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.x86_64.dir/FuzzerExtraCountersWindows.cpp.o -c /repo/compiler-rt/lib/fuzzer/FuzzerExtraCountersWindows.cpp
/repo/compiler-rt/lib/fuzzer/FuzzerExtraCountersWindows.cpp:12:10: fatal error: 'cstdint' file not found
12 | #include <cstdint>
| ^~~~~~~~~
1 error generated.
```
So the install step is installing cstdint in
`/tmp/tmp.3hBN2EZpSo/repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/include/c++/v1/cstdint`
given the DESTDIR setting.
But then when building FuzzerExtraCountersWindows.cpp we find
` -isystem /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/include/c++/v1`
but that path does not exist.
When searching the build dir I find:
```
> find build-all/ -name cstdint
build-all/include/c++/v1/cstdint
build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/build/include/c++/v1/cstdint
```
But I guess the goal was to use a path to the just installed version here (from the DESTDIR)?
https://github.com/llvm/llvm-project/pull/115077
More information about the llvm-commits
mailing list