This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by leonardchan on Sep 13 2021, 11:17 AM.

Details

Summary

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.

Diff Detail

Event Timeline

leonardchan created this revision.Sep 13 2021, 11:17 AM
leonardchan requested review of this revision.Sep 13 2021, 11:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2021, 11:17 AM
phosek accepted this revision.Sep 13 2021, 12:58 PM

LGTM

This revision is now accepted and ready to land.Sep 13 2021, 12:58 PM
leonardchan edited the summary of this revision. (Show Details)

Updated with a different REQUIRES since it turns out the issue was behind CRT_LDBL_128BIT not being defined instead (because __LDBL_MANT_DIG__ is 64 on x86_64-linux). Will let it sit longer if anyone wants to take a second look and submit at EOD if no other comments.