[compiler-rt] 47373f9 - [compiler-rt][test] Add int128 requirement to TestCases/Misc/Linux/static-link.cpp

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 16 17:05:09 PDT 2021


Author: Leonard Chan
Date: 2021-09-16T17:04:55-07:00
New Revision: 47373f94a431d7fcc78c760ca6ca321f3742b746

URL: https://github.com/llvm/llvm-project/commit/47373f94a431d7fcc78c760ca6ca321f3742b746
DIFF: https://github.com/llvm/llvm-project/commit/47373f94a431d7fcc78c760ca6ca321f3742b746.diff

LOG: [compiler-rt][test] Add int128 requirement to TestCases/Misc/Linux/static-link.cpp

We hit some undefined symbol errors to 128-bit floating point functions when linking this test.

ld.lld: error: undefined symbol: __multf3
>>> referenced by strtof128_l.o:(round_and_return) in archive /usr/lib/x86_64-linux-gnu/libc.a
>>> referenced by strtof128_l.o:(round_and_return) in archive /usr/lib/x86_64-linux-gnu/libc.a
>>> referenced by strtof128_l.o:(round_and_return) in archive /usr/lib/x86_64-linux-gnu/libc.a
>>> referenced 4 more times
>>> did you mean: __muldf3
>>> defined in: /usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-master-fuchsia-toolchain/lib/clang/14.0.0/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a

Host libc expects these to be defined, and compiler-rt will only define these
for certain platforms (see definition for CRT_LDBL_128BIT). Since we likely
can't do anything about the host libc, we can at least restrict the test to
check that these functions are supported.

Differential Revision: https://reviews.llvm.org/D109709

Added: 
    

Modified: 
    compiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp
index 6c6b421e40c6a..09751013dcfd0 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp
@@ -1,5 +1,6 @@
 // REQUIRES: ubsan-standalone
 // REQUIRES: arch=x86_64
+// REQUIRES: librt_has_multf3
 // RUN: %clangxx -fsanitize=bool -static  %s -o %t && UBSAN_OPTIONS=handle_segv=0:handle_sigbus=0:handle_sigfpe=0 %run %t 2>&1 | FileCheck %s
 #include <signal.h>
 #include <stdio.h>


        


More information about the llvm-commits mailing list