]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Disable "ALT128" long double support for Clang
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Mar 2021 13:08:32 +0000 (13:08 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 23 Mar 2021 15:00:43 +0000 (15:00 +0000)
Clang does not currently support the __ibm128 type [1] and only supports
the __ieee128 type in the unreleased 12.0.0 version [2]. That means it
is not possible to provide support for -mabi=ieeelongdouble with Clang
in an ABI compatible way (as we do for GCC by defining new facets and
other types in the __gnu_cxx_ldbl128 namespace).

By preventing the definition of _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT when
compiling with Clang, all uses of __ibm128 and __ieee128 types will be
disabled. This can be revisited in future when Clang supports the types
(and provides a way to detect that support using the preprocessor).

[1] https://reviews.llvm.org/D93377
[2] https://reviews.llvm.org/D97846

libstdc++-v3/ChangeLog:

* include/bits/c++config (_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT):
Do not define when compiling with Clang.

libstdc++-v3/include/bits/c++config

index b57ff339990d75c5af3dec9831eb8d37c48c6483..72ec91949de5510faeb7f205f00100ba8308f071 100644 (file)
@@ -425,9 +425,12 @@ _GLIBCXX_END_NAMESPACE_VERSION
 // GLIBCXX_ABI Deprecated
 // Define if compatibility should be provided for -mlong-double-64.
 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
+
 // Define if compatibility should be provided for alternative 128-bit long
-// double formats.
+// double formats. Not possible for Clang until __ibm128 is supported.
+#ifndef __clang__
 #undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
+#endif
 
 // Inline namespaces for long double 128 modes.
 #if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT \