Skip to content

XRay unit tests don't link in Linux/i686 build #41810

Open
@rorth

Description

@rorth
Bugzilla Link 42465
Version unspecified
OS Linux

Extended Description

make check-all fails in a LLVM build for target i686-pc-linux-gnu on a Linux/x86_64
system:

[2/8] cd /var/gcc/llvm/dist-i686-release/projects/compiler-rt/lib/xray/tests/unit && /var/gcc/llvm/dist-i686-release/./bin/clang TEST_OBJECTS.allocator_test.cc.x86_64.o TEST_OBJECTS.buffer_queue_test.cc.x86_64.o TEST_OBJECTS.function_call_trie_test.cc.x86_64.o TEST_OBJECTS.profile_collector_test.cc.x86_64.o TEST_OBJECTS.segmented_array_test.cc.x86_64.o TEST_OBJECTS.test_helpers.cc.x86_64.o TEST_OBJECTS.xray_unit_test_main.cc.x86_64.o TEST_OBJECTS.fdr_controller_test.cc.x86_64.o TEST_OBJECTS.fdr_log_writer_test.cc.x86_64.o TEST_OBJECTS.gtest-all.cc.x86_64.o TEST_OBJECTS.gmock-all.cc.x86_64.o /var/gcc/llvm/dist-i686-release/projects/compiler-rt/lib/xray/tests/libRTXRay.test.x86_64.a -o /var/gcc/llvm/dist-i686-release/projects/compiler-rt/lib/xray/tests/unit/./XRayTest-x86_64-Test -Wl,-allow-shlib-undefined -lpthread -ltinfo -L/var/gcc/llvm/dist-i686-release/./lib -lLLVMXRay -lLLVMSupport -lLLVMDemangle -lLLVMTestingSupport -lm -lrt -ldl -pthread -lstdc++ -m64
FAILED: projects/compiler-rt/lib/xray/tests/unit/XRayTest-x86_64-Test
cd /var/gcc/llvm/dist-i686-release/projects/compiler-rt/lib/xray/tests/unit && /var/gcc/llvm/dist-i686-release/./bin/clang TEST_OBJECTS.allocator_test.cc.x86_64.o TEST_OBJECTS.buffer_queue_test.cc.x86_64.o TEST_OBJECTS.function_call_trie_test.cc.x86_64.o TEST_OBJECTS.profile_collector_test.cc.x86_64.o TEST_OBJECTS.segmented_array_test.cc.x86_64.o TEST_OBJECTS.test_helpers.cc.x86_64.o TEST_OBJECTS.xray_unit_test_main.cc.x86_64.o TEST_OBJECTS.fdr_controller_test.cc.x86_64.o TEST_OBJECTS.fdr_log_writer_test.cc.x86_64.o TEST_OBJECTS.gtest-all.cc.x86_64.o TEST_OBJECTS.gmock-all.cc.x86_64.o /var/gcc/llvm/dist-i686-release/projects/compiler-rt/lib/xray/tests/libRTXRay.test.x86_64.a -o /var/gcc/llvm/dist-i686-release/projects/compiler-rt/lib/xray/tests/unit/./XRayTest-x86_64-Test -Wl,-allow-shlib-undefined -lpthread -ltinfo -L/var/gcc/llvm/dist-i686-release/./lib -lLLVMXRay -lLLVMSupport -lLLVMDemangle -lLLVMTestingSupport -lm -lrt -ldl -pthread -lstdc++ -m64
/usr/bin/ld: skipping incompatible /var/gcc/llvm/dist-i686-release/./lib/libLLVMXRay.a when searching for -lLLVMXRay
/usr/bin/ld: skipping incompatible /var/scratch/gcc/llvm/dist-i686-release/bin/../lib/libLLVMXRay.a when searching for -lLLVMXRay
/usr/bin/ld: cannot find -lLLVMXRay
/usr/bin/ld: skipping incompatible /var/gcc/llvm/dist-i686-release/./lib/libLLVMSupport.a when searching for -lLLVMSupport
/usr/bin/ld: skipping incompatible /var/scratch/gcc/llvm/dist-i686-release/bin/../lib/libLLVMSupport.a when searching for -lLLVMSupport
/usr/bin/ld: cannot find -lLLVMSupport
/usr/bin/ld: skipping incompatible /var/gcc/llvm/dist-i686-release/./lib/libLLVMDemangle.a when searching for -lLLVMDemangle
/usr/bin/ld: skipping incompatible /var/scratch/gcc/llvm/dist-i686-release/bin/../lib/libLLVMDemangle.a when searching for -lLLVMDemangle
/usr/bin/ld: cannot find -lLLVMDemangle
/usr/bin/ld: skipping incompatible /var/gcc/llvm/dist-i686-release/./lib/libLLVMTestingSupport.a when searching for -lLLVMTestingSupport
/usr/bin/ld: skipping incompatible /var/scratch/gcc/llvm/dist-i686-release/bin/../lib/libLLVMTestingSupport.a when searching for -lLLVMTestingSupport
/usr/bin/ld: cannot find -lLLVMTestingSupport
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

While the LLVM support libs above are all 32-bit only, xray only supports
x86_64, but doesn't detect the mismatch, thus the failing links.

I've hacked around this in lib/xray/tests/CMakeLists.txt (add_xray_unittest)
but am unclear about the proper condition to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaxray

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions