This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix check for ieeelongdouble support
ClosedPublic

Authored by nikic on Oct 19 2022, 7:32 AM.

Details

Reviewers
qiucf
tbaeder
Group Reviewers
Restricted Project
Commits
rG0cbf003c78cd: [PowerPC] Fix check for ieeelongdouble support
Summary

Clang detects the GCC version from the libdir. However, modern GCC versions only include the major version in the libdir (something like lib/gcc/powerpc64le-linux-gnu/12/), not all version components. For this reason, even though the system has a supported libstdcxx, it will still fail the check against the 12.1.0 version requirement.

Fix this by doing the same thing we do for patch versions: Assume that a missing minor version is larger than any specific version.

To allow this to be tested, we need to fix two additional issues: First, the GCC toolchain directories used for testing need to contain a crtbegin.o file to be properly detected. The existing tests actually ended up using a 0.0.0 version, rather the intended one. Second, we also need to satisfy the glibc version check based on the dynamic linker. To do so, respect the --dyld-prefix argument and add the necessary file to the test toolchain directory.

Diff Detail

Event Timeline

nikic created this revision.Oct 19 2022, 7:32 AM
nikic requested review of this revision.Oct 19 2022, 7:32 AM
jsji edited reviewers, added: Restricted Project; removed: jsji.Oct 19 2022, 9:44 AM
nikic added a comment.Oct 20 2022, 2:52 AM

I also have related question here: The compatibility check currently unconditionally rejects libcxx. Do you have any additional information in what way libcxx is incompatible with the ieeelongdouble ABI?

The changes make sense to me but I'd like someone else to approve as well.

I also have related question here: The compatibility check currently unconditionally rejects libcxx. Do you have any additional information in what way libcxx is incompatible with the ieeelongdouble ABI?

PowerPC has two incompatible ABI's for long double. The underlying type is either "PPC double-double" (i.e. two double values in two separate registers) or IEEE 128-bit quad precision. The latter resides in a 128-bt vector register on PPC.

The changes here seem fine to me. Perhaps @ecnelises/@qiucf (not sure which ID is the right one) has further feedback here.

qiucf accepted this revision as: qiucf.Oct 26 2022, 11:58 PM

Thanks for the fix! LGTM, sorry for the absense.

(but I remember GCC minor version always begins with 1?)

I also have related question here: The compatibility check currently unconditionally rejects libcxx. Do you have any additional information in what way libcxx is incompatible with the ieeelongdouble ABI?

Because currently libcxx doesn't support float128 (what ieeelongdouble abi emits) on PowerPC (and other targets, as I know). Once libcxx has the support, we can modify the check.

This revision is now accepted and ready to land.Oct 26 2022, 11:58 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 1:36 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript