[compiler-rt] [rtsan] Explicitly link pthread in the tests and dynamic libraries (PR #98256)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 19:12:44 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-ppc64le-linux-test-suite` running on `ppc64le-clang-test-suite` while building `compiler-rt` at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/1051

Here is the relevant piece of the build log for the reference:
```
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
...
14.598 [7/11/74] Generating ASAN_INST_TEST_OBJECTS.asan_str_test.cpp.powerpc64le-calls.o
14.603 [7/10/75] Generating ASAN_INST_TEST_OBJECTS.asan_mem_test.cpp.powerpc64le-calls.o
15.238 [7/9/76] Generating ASAN_INST_TEST_OBJECTS.asan_mem_test.cpp.powerpc64le-inline.o
16.163 [7/8/77] Generating ASAN_INST_TEST_OBJECTS.asan_str_test.cpp.powerpc64le-inline.o
17.621 [7/7/78] Generating ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.powerpc64le-calls.o
17.818 [6/7/79] Generating POWERPC64LELinuxConfig/Asan-powerpc64le-calls-Noinst-Test
22.095 [6/6/80] Generating ASAN_INST_TEST_OBJECTS.asan_test.cpp.powerpc64le-calls.o
23.791 [6/5/81] Generating ASAN_INST_TEST_OBJECTS.asan_test.cpp.powerpc64le-inline.o
24.286 [6/4/82] Generating RtsanNoInstTestObjects.gtest-all.cc.powerpc64le.o
24.432 [5/4/83] Generating Rtsan-powerpc64le-NoInstTest
FAILED: compiler-rt/lib/rtsan/tests/Rtsan-powerpc64le-NoInstTest /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/Rtsan-powerpc64le-NoInstTest 
cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests && /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang++ RtsanNoInstTestObjects.rtsan_preinit.cpp.powerpc64le.o RtsanNoInstTestObjects.rtsan_test_context.cpp.powerpc64le.o RtsanNoInstTestObjects.rtsan_test_main.cpp.powerpc64le.o RtsanNoInstTestObjects.gtest-all.cc.powerpc64le.o RtsanNoInstTestObjects.gmock-all.cc.powerpc64le.o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/./Rtsan-powerpc64le-NoInstTest -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -resource-dir=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./lib/../lib/clang/19 -Wl,-rpath,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./lib/../lib/clang/19/lib/powerpc64le-unknown-linux-gnu -lstdc++ -no-pie -pthread -latomic -m64 -fno-function-sections
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(interception_linux.cpp.o): In function `__interception::InterceptFunction(char const*, unsigned long*, unsigned long, unsigned long)':
interception_linux.cpp:(.text+0x3c): undefined reference to `dlsym'
interception_linux.cpp:(.text+0x54): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(interception_linux.cpp.o): In function `__interception::InterceptFunction(char const*, char const*, unsigned long*, unsigned long, unsigned long)':
interception_linux.cpp:(.text+0xe8): undefined reference to `dlvsym'
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 0x1e.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::SetEnv(char const*, char const*)':
sanitizer_linux_libcdep.cpp:(.text+0x314): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::InitTlsSize()':
sanitizer_linux_libcdep.cpp:(.text+0x478): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::ThreadDescriptorSize()':
sanitizer_linux_libcdep.cpp:(.text+0x4f8): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::GetTlsSize()':
sanitizer_linux_libcdep.cpp:(.text+0x578): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::GetThreadStackAndTls(bool, unsigned long*, unsigned long*, unsigned long*, unsigned long*)':
sanitizer_linux_libcdep.cpp:(.text+0x650): undefined reference to `dlsym'
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 0x1e.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_symbolizer_posix_libcdep.cpp.o):sanitizer_symbolizer_posix_libcdep.cpp:(.text+0xf0c): more undefined references to `dlsym' follow
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
29.359 [5/3/84] Generating ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.powerpc64le-inline.o
31.285 [5/2/85] Generating ASAN_INST_TEST_OBJECTS.gtest-all.cc.powerpc64le-calls.o
32.222 [5/1/86] Generating ASAN_INST_TEST_OBJECTS.gtest-all.cc.powerpc64le-inline.o
ninja: build stopped: subcommand failed.
34.024 [3/5/1155] Linking CXX executable tools/clang/unittests/Interpreter/ClangReplInterpreterTests
FAILED: runtimes/CMakeFiles/runtimes-test-depends /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/CMakeFiles/runtimes-test-depends 
cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins && /home/buildbots/llvm-external-buildbots/cmake-3.28.2/bin/cmake --build /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/ --target runtimes-test-depends --config Release
38.614 [3/3/1157] Linking CXX executable tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
39.803 [3/2/1158] Linking CXX executable tools/clang/unittests/Tooling/ToolingTests
46.846 [3/1/1159] Linking CXX executable tools/clang/tools/extra/clangd/unittests/ClangdTests
ninja: build stopped: subcommand failed.
Step 7 (test-build-unified-tree-check-runtimes) failure: test (failure)
...
-- sanitizer_common tests on "Linux" will run against "asan;lsan;msan;tsan;ubsan"
-- check-shadowcallstack does nothing.
-- Configuring done (0.9s)
-- Generating done (0.1s)
-- Build files have been written to: /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins
1.438 [0/1/4] cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins && /home/buildbots/llvm-external-buildbots/cmake-3.28.2/bin/cmake --build /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/ --target check-runtimes --config Release
0.020 [8/3/1] Building CXX object compiler-rt/lib/ubsan/CMakeFiles/RTUbsan_dynamic_version_script_dummy.powerpc64le.dir/dummy.cpp.o
0.021 [7/3/2] Building CXX object compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic_version_script_dummy.powerpc64le.dir/dummy.cpp.o
0.112 [6/3/3] Linking CXX shared library /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/lib/clang/19/lib/powerpc64le-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
0.147 [6/2/4] Generating Rtsan-powerpc64le-NoInstTest
FAILED: compiler-rt/lib/rtsan/tests/Rtsan-powerpc64le-NoInstTest /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/Rtsan-powerpc64le-NoInstTest 
cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests && /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang++ RtsanNoInstTestObjects.rtsan_preinit.cpp.powerpc64le.o RtsanNoInstTestObjects.rtsan_test_context.cpp.powerpc64le.o RtsanNoInstTestObjects.rtsan_test_main.cpp.powerpc64le.o RtsanNoInstTestObjects.gtest-all.cc.powerpc64le.o RtsanNoInstTestObjects.gmock-all.cc.powerpc64le.o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/./Rtsan-powerpc64le-NoInstTest -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -resource-dir=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./lib/../lib/clang/19 -Wl,-rpath,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./lib/../lib/clang/19/lib/powerpc64le-unknown-linux-gnu -lstdc++ -no-pie -pthread -latomic -m64 -fno-function-sections
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(interception_linux.cpp.o): In function `__interception::InterceptFunction(char const*, unsigned long*, unsigned long, unsigned long)':
interception_linux.cpp:(.text+0x3c): undefined reference to `dlsym'
interception_linux.cpp:(.text+0x54): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(interception_linux.cpp.o): In function `__interception::InterceptFunction(char const*, char const*, unsigned long*, unsigned long, unsigned long)':
interception_linux.cpp:(.text+0xe8): undefined reference to `dlvsym'
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 0x1e.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::SetEnv(char const*, char const*)':
sanitizer_linux_libcdep.cpp:(.text+0x314): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::InitTlsSize()':
sanitizer_linux_libcdep.cpp:(.text+0x478): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::ThreadDescriptorSize()':
sanitizer_linux_libcdep.cpp:(.text+0x4f8): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::GetTlsSize()':
sanitizer_linux_libcdep.cpp:(.text+0x578): undefined reference to `dlsym'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_linux_libcdep.cpp.o): In function `__sanitizer::GetThreadStackAndTls(bool, unsigned long*, unsigned long*, unsigned long*, unsigned long*)':
sanitizer_linux_libcdep.cpp:(.text+0x650): undefined reference to `dlsym'
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 0x1e.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/lib/rtsan/tests/libRTRtsanTest.powerpc64le.a(sanitizer_symbolizer_posix_libcdep.cpp.o):sanitizer_symbolizer_posix_libcdep.cpp:(.text+0xf0c): more undefined references to `dlsym' follow
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
0.185 [6/1/5] Linking CXX shared library /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/lib/clang/19/lib/powerpc64le-unknown-linux-gnu/libclang_rt.asan.so
ninja: build stopped: subcommand failed.
FAILED: runtimes/CMakeFiles/check-runtimes /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/CMakeFiles/check-runtimes 
cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins && /home/buildbots/llvm-external-buildbots/cmake-3.28.2/bin/cmake --build /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/ --target check-runtimes --config Release
ninja: build stopped: subcommand failed.

```

https://github.com/llvm/llvm-project/pull/98256


More information about the llvm-commits mailing list