When -mabi=ieeelongdouble is enabled by default, libc++ does not support
-mabi=ibmlongdouble.
Details
- Reviewers
qiucf - Group Reviewers
Restricted Project - Commits
- rG5f68c4111ab9: Warn about unsupported ibmlongdouble
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you please upload the patch with full context (-U99999)?
The assumption here is that libc++ is being compiled with a compiler that has the same ieeelongdouble default as the clang that is being built, right? I guess that's the most reasonable assumption one can make.
clang/lib/Driver/ToolChains/PPCLinux.h | ||
---|---|---|
30 | New functions should use camelCase |
I'm attaching a new version of the patch.
Can you please upload the patch with full context (-U99999)?
@nikic Done!
The assumption here is that libc++ is being compiled with a compiler that has the same ieeelongdouble default as the clang that is being built, right?
@nikic Right.
New functions should use camelCase
@MaskRay Fixed.
clang/lib/Driver/ToolChains/PPCLinux.cpp | ||
---|---|---|
75 | I don't think this formatting is right. You may find clang/tools/clang-format/clang-format-diff.py helpful. I use this script locally: #!/bin/sh git diff -U ${1:-HEAD} | clang/tools/clang-format/clang-format-diff.py -p1 And then do something like ./clang_format_diff.sh | patch -p0 after checking that it did not reformat too much. | |
clang/test/Driver/lit.local.cfg | ||
25 | I believe this isn't robust, because ON is not the only possible value. Instead, you'll want to canonicalize the variable: https://github.com/llvm/llvm-project/blob/03e6d9d9d1d48e43f3efc35eb75369b90d4510d5/clang/test/CMakeLists.txt#L4 |
Thanks for the patch! But does libc++ support to be built with -mabi=ieeelongdouble now? (like libstdc++, if it works correctly, it should co-exist and be linked with different long double ABIs)
clang/lib/Driver/ToolChains/PPCLinux.cpp | ||
---|---|---|
96 | SupportIEEEFloat128 checks the library version:
If the assumptions are still right, this changes its meaning (and supportIBMLongDouble has different meaning from it). | |
clang/test/Driver/lit.local.cfg | ||
26 | Can we assume if we are compiling with -mabi=ieeelongdouble, then libc++ 'must' be built with the same long double ABI? If I understand correctly, they're unrelated. |
@qiucf libc++ can be built with -mabi=ieeelongdouble, but it supports only a single long double format, i.e. if it's built with -mabi=ieeelongdouble, it won't support IBM double-double and vice versa.
This is already being used in Fedora Rawhide at the moment.
clang/lib/Driver/ToolChains/PPCLinux.cpp | ||
---|---|---|
75 | Thanks, this pointed out 2 errors. | |
96 | @qiucf In operating systems that switched to IEEE long double by default, all libraries (and programs) are built with IEEE long double, including libc++. | |
clang/test/Driver/lit.local.cfg | ||
25 | Changed. This caused a few other modifications in the latest revision. | |
26 | @qiucf I didn't understand this part. Are you suggesting to remove the long double warnings because the way the compiler was built is unrelated to the way libc++ was built? |
clang/test/Driver/lit.local.cfg | ||
---|---|---|
26 | Ah, I misunderstood meaning of 'defaults to IEEE long double' in last review. We can assume 'how the compiler was built' is the same as 'how the libc++ was built'. But when 'how the libc++ was built' conflicts with 'how the compiler compiles current program', we expect a warning, right? If so, this looks reasonable. |
clang/test/Driver/lit.local.cfg | ||
---|---|---|
26 | Yes, exactly. |
Thanks @qiucf ! I don't have commit access yet. Could you land this patch for me, please?
Please use “Tulio Magno Quites Machado Filho tuliom@redhat.com” to commit the change.
Committed as https://github.com/llvm/llvm-project/commit/5f68c4111ab9c79b902723df3986dd1033813c01
ppc-float-abi-warning.cpp would fail when testing on machine with glibc older than 2.32 but PPC_LINUX_DEFAULT_IEEELONGDOUBLE enabled, which is known failure even before this patch.
New functions should use camelCase