Hide Forgot
GCC on Fedora enables -mabi=ieeelongdouble for ppc64le by default, and clang should do so as well. This is possible using the PPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON cmake option. We've tried this a couple of times in the past and ran into various failures. After https://reviews.llvm.org/D134362 (which is backported to rawhide), it's possible to at least bootstrap clang, but there are still issues with many spurious warnings and some test failures.
https://reviews.llvm.org/D136258 should fix the spurious warnings.
After producing a clang build with the aforementioned patch I was able to rebuild llvm, clang and libcxx afterwards (https://copr.fedorainfracloud.org/coprs/nikic/ppc64-ieeelongdouble-test/builds/), so I think we should be able to safely enable the option, without getting into rebuild issues down the line. Something that worries me is the fact that clang reports that -mabi=ieeelongdouble is incompatible with libcxx, so I expect that every -stdlib=libc++ build on ppc64le is going to complain about that. I'd like to know what that incompatibility is.
Tulio, does the IBM toolchain team know such incompatibility (comment #2)?
(In reply to Nikita Popov from comment #2) > Something that worries me is the fact that clang reports that > -mabi=ieeelongdouble is incompatible with libcxx, so I expect that every > -stdlib=libc++ build on ppc64le is going to complain about that. I'd like to > know what that incompatibility is. @npopov I tried to create a reproducer for this message, but I was not able to. Would you have a reproducer or know of a package that reproduces this message? Anyway, I had a chat with Nemanja Ivanovic. We agreed that libcxx supports only a single long double format, i.e. in this case IEEE 128-bit floating point. It doesn't support -mabi=ibmlongdouble if the default is -mabi=ieeelongdouble and vice versa. If that's necessary, the recommendation is to use libstdc++ instead. We agreed this is not mentioned in the documentation yet. The problem is: the message from comment #2 seems to be happening when -mabi=ieeelongdouble is the default long double and that is passed in the command line. Is this correct?
I did most of my initial testing by explicitly calling "clang -mabi=ieeelongdouble" rather than setting the cmake option, and apparently that makes a difference: The warning only gets emitted if the option is explicitly specified. So after switching the default "clang -stdlib=libc++" works without warning, but "clang -stdlib=libc++ -mabi=ieeelongdouble" (which just repeats the default explicitly) does print a warning. Based on your explanation, it sounds like the mabi check for libcxx shouldn't warn if "-mabi=ieeelongdouble" is specified, but rather when -mabi is specified with a non-default value (i.e. -mabi=ibmlongdouble if -mabi=ieeelongdouble is the default and vice versa). But given that the warning is not emitted without a redundant -mabi=ieeelongdouble, this seems like a pretty minor issue, and we can just go ahead with making the default switch.
PR: https://src.fedoraproject.org/rpms/clang/pull-request/184
FEDORA-2022-833007db21 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-833007db21
FEDORA-2022-833007db21 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.
For the record, I've hit another glibc issue, see https://bugzilla.redhat.com/show_bug.cgi?id=2140618. This turned up during the compiler-rt rebuild, which I've switched to use gcc for ppc64le as a temporary workaround.