[llvm] [CMake] Fix DynamicLibraryTests exports symbol when plugins are enabled (PR #102941)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 13:30:07 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot11` while building `llvm` at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference:
```
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
[952/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/UTCTimeTest.cpp.o
[953/1132] Building CXX object unittests/IR/CMakeFiles/IRTests.dir/MetadataTest.cpp.o
[954/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/FormatVariadicTest.cpp.o
[955/1132] Building CXX object unittests/Support/CommandLineInit/CMakeFiles/CommandLineInitTests.dir/CommandLineInitTest.cpp.o
[956/1132] Linking CXX executable unittests/Support/CommandLineInit/CommandLineInitTests
[957/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_sha1_ostream_test.cpp.o
[958/1132] Building CXX object unittests/Support/DynamicLibrary/CMakeFiles/DynamicLibraryTests.dir/DynamicLibraryTest.cpp.o
[959/1132] Building CXX object unittests/Target/CMakeFiles/TargetMachineCTests.dir/TargetMachineOptionsTest.cpp.o
[960/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/TrailingObjectsTest.cpp.o
[961/1132] Linking CXX executable unittests/Support/DynamicLibrary/DynamicLibraryTests
FAILED: unittests/Support/DynamicLibrary/DynamicLibraryTests 
: && /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/bin/clang++ -nostdinc++ -isystem /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/include -isystem /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/include/c++/v1 -fsanitize=hwaddress -mllvm -hwasan-use-after-scope=1 -Wl,--rpath=/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -L/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -w -stdlib=libc++ -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 -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -gline-tables-only -fsanitize=hwaddress -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,--rpath=/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -L/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -stdlib=libc++ -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--export-dynamic  -Wl,--gc-sections  -Wl,--version-script,"/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/unittests/Support/DynamicLibrary/DynamicLibraryTests.exports" unittests/Support/DynamicLibrary/CMakeFiles/DynamicLibraryTests.dir/DynamicLibraryTest.cpp.o -o unittests/Support/DynamicLibrary/DynamicLibraryTests  lib/libLLVMSupport.a  lib/libLLVMSupport.a  lib/libllvm_gtest_main.a  lib/libllvm_gtest.a  lib/libDynamicLibraryLib.a  lib/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib/aarch64-linux-gnu/libz.so  /usr/lib/aarch64-linux-gnu/libzstd.so  lib/libLLVMDemangle.a  -lpthread && :
ld.lld: error: non-exported symbol '__hwasan_init' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_tls' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_linux.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: undefined reference: __hwasan_personality_wrapper
>>> referenced by /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so (disallowed by --no-allow-shlib-undefined)

ld.lld: error: non-exported symbol '__hwasan_tag_mismatch_v2' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_tag_mismatch_aarch64.S.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_loadN' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_storeN' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_memset' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_memintrinsics.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_memmove' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_memintrinsics.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_memcpy' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_memintrinsics.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[962/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/YAMLParserTest.cpp.o
[963/1132] Building CXX object unittests/SandboxIR/CMakeFiles/SandboxIRTests.dir/SandboxIRTest.cpp.o
[964/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/xxhashTest.cpp.o
[965/1132] Building CXX object unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/AArch64InstPrinterTest.cpp.o
[966/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_pwrite_stream_test.cpp.o
[967/1132] Linking CXX executable unittests/Target/TargetMachineCTests
[968/1132] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/MemProfTest.cpp.o
[969/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/ScaledNumberTest.cpp.o
[970/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_socket_stream_test.cpp.o
[971/1132] Building CXX object unittests/TableGen/CMakeFiles/TableGenTests.dir/CodeExpanderTest.cpp.o
[972/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/ErrorTest.cpp.o
[973/1132] Building CXX object unittests/Target/PowerPC/CMakeFiles/PowerPCTests.dir/AIXRelocModelTest.cpp.o
[974/1132] Building CXX object unittests/TableGen/CMakeFiles/TableGenTests.dir/AutomataTest.cpp.o
[975/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/HashBuilderTest.cpp.o
[976/1132] Building CXX object unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/DecomposeStackOffsetTest.cpp.o
[977/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/JSONTest.cpp.o
[978/1132] Building CXX object unittests/TableGen/CMakeFiles/TableGenTests.dir/ParserEntryPointTest.cpp.o
[979/1132] Building CXX object unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/SMEAttributesTest.cpp.o
[980/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/UnicodeTest.cpp.o
[981/1132] Building CXX object unittests/Target/RISCV/CMakeFiles/RISCVTests.dir/MCInstrAnalysisTest.cpp.o
[982/1132] Building CXX object unittests/Target/LoongArch/CMakeFiles/LoongArchTests.dir/MCInstrAnalysisTest.cpp.o
[983/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_ostream_test.cpp.o
[984/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/MathExtrasTest.cpp.o
[985/1132] Building CXX object unittests/Target/AMDGPU/CMakeFiles/AMDGPUTests.dir/DwarfRegMappings.cpp.o
[986/1132] Building CXX object unittests/Target/AMDGPU/CMakeFiles/AMDGPUTests.dir/ExecMayBeModifiedBeforeAnyUse.cpp.o
Step 10 (stage2/hwasan check) failure: stage2/hwasan check (failure)
...
[952/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/UTCTimeTest.cpp.o
[953/1132] Building CXX object unittests/IR/CMakeFiles/IRTests.dir/MetadataTest.cpp.o
[954/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/FormatVariadicTest.cpp.o
[955/1132] Building CXX object unittests/Support/CommandLineInit/CMakeFiles/CommandLineInitTests.dir/CommandLineInitTest.cpp.o
[956/1132] Linking CXX executable unittests/Support/CommandLineInit/CommandLineInitTests
[957/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_sha1_ostream_test.cpp.o
[958/1132] Building CXX object unittests/Support/DynamicLibrary/CMakeFiles/DynamicLibraryTests.dir/DynamicLibraryTest.cpp.o
[959/1132] Building CXX object unittests/Target/CMakeFiles/TargetMachineCTests.dir/TargetMachineOptionsTest.cpp.o
[960/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/TrailingObjectsTest.cpp.o
[961/1132] Linking CXX executable unittests/Support/DynamicLibrary/DynamicLibraryTests
FAILED: unittests/Support/DynamicLibrary/DynamicLibraryTests 
: && /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/bin/clang++ -nostdinc++ -isystem /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/include -isystem /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/include/c++/v1 -fsanitize=hwaddress -mllvm -hwasan-use-after-scope=1 -Wl,--rpath=/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -L/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -w -stdlib=libc++ -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 -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -gline-tables-only -fsanitize=hwaddress -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,--rpath=/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -L/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib -stdlib=libc++ -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--export-dynamic  -Wl,--gc-sections  -Wl,--version-script,"/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/unittests/Support/DynamicLibrary/DynamicLibraryTests.exports" unittests/Support/DynamicLibrary/CMakeFiles/DynamicLibraryTests.dir/DynamicLibraryTest.cpp.o -o unittests/Support/DynamicLibrary/DynamicLibraryTests  lib/libLLVMSupport.a  lib/libLLVMSupport.a  lib/libllvm_gtest_main.a  lib/libllvm_gtest.a  lib/libDynamicLibraryLib.a  lib/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib/aarch64-linux-gnu/libz.so  /usr/lib/aarch64-linux-gnu/libzstd.so  lib/libLLVMDemangle.a  -lpthread && :
ld.lld: error: non-exported symbol '__hwasan_init' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_tls' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_linux.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: undefined reference: __hwasan_personality_wrapper
>>> referenced by /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so (disallowed by --no-allow-shlib-undefined)

ld.lld: error: non-exported symbol '__hwasan_tag_mismatch_v2' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_tag_mismatch_aarch64.S.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_loadN' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_storeN' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_memset' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_memintrinsics.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_memmove' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_memintrinsics.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
ld.lld: error: non-exported symbol '__hwasan_memcpy' in '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.a(hwasan_memintrinsics.cpp.o)' is referenced by DSO '/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/libcxx_build_hwasan/lib/libc++abi.so'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[962/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/YAMLParserTest.cpp.o
[963/1132] Building CXX object unittests/SandboxIR/CMakeFiles/SandboxIRTests.dir/SandboxIRTest.cpp.o
[964/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/xxhashTest.cpp.o
[965/1132] Building CXX object unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/AArch64InstPrinterTest.cpp.o
[966/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_pwrite_stream_test.cpp.o
[967/1132] Linking CXX executable unittests/Target/TargetMachineCTests
[968/1132] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/MemProfTest.cpp.o
[969/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/ScaledNumberTest.cpp.o
[970/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_socket_stream_test.cpp.o
[971/1132] Building CXX object unittests/TableGen/CMakeFiles/TableGenTests.dir/CodeExpanderTest.cpp.o
[972/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/ErrorTest.cpp.o
[973/1132] Building CXX object unittests/Target/PowerPC/CMakeFiles/PowerPCTests.dir/AIXRelocModelTest.cpp.o
[974/1132] Building CXX object unittests/TableGen/CMakeFiles/TableGenTests.dir/AutomataTest.cpp.o
[975/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/HashBuilderTest.cpp.o
[976/1132] Building CXX object unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/DecomposeStackOffsetTest.cpp.o
[977/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/JSONTest.cpp.o
[978/1132] Building CXX object unittests/TableGen/CMakeFiles/TableGenTests.dir/ParserEntryPointTest.cpp.o
[979/1132] Building CXX object unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/SMEAttributesTest.cpp.o
[980/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/UnicodeTest.cpp.o
[981/1132] Building CXX object unittests/Target/RISCV/CMakeFiles/RISCVTests.dir/MCInstrAnalysisTest.cpp.o
[982/1132] Building CXX object unittests/Target/LoongArch/CMakeFiles/LoongArchTests.dir/MCInstrAnalysisTest.cpp.o
[983/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/raw_ostream_test.cpp.o
[984/1132] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/MathExtrasTest.cpp.o
[985/1132] Building CXX object unittests/Target/AMDGPU/CMakeFiles/AMDGPUTests.dir/DwarfRegMappings.cpp.o
[986/1132] Building CXX object unittests/Target/AMDGPU/CMakeFiles/AMDGPUTests.dir/ExecMayBeModifiedBeforeAnyUse.cpp.o

```

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


More information about the llvm-commits mailing list