aports/community/llvm-libunwind/libcxx-ppc.patch
Jakub Jirutka 7eee0c5c16 community/llvm-libunwind: revert unneeded/unwanted changes from prev commit
88f95eae5bb78a22aeb1811e269d511928986434

See comments in !25551
2021-10-19 15:13:35 +02:00

25 lines
1.1 KiB
Diff

Patch-Source: https://github.com/void-linux/void-packages/blob/74f16232621ca8dfb6d244beff1df35a6df1647f/srcpkgs/llvm12/patches/libcxx-ppc.patch
This ensures `is_iec559` is defined correctly under all long double ABIs,
including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
is not defined on gcc.
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -426,8 +426,14 @@ protected:
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
-#if (defined(__ppc__) || defined(__ppc64__))
+#if defined(__powerpc__) || defined(__powerpc64__)
+#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
+ /* IEEE 754 quadruple or double precision */
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+#else
+ /* 128-bit IBM double-double */
static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
+#endif
#else
static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
#endif