wok-next annotate glibc/stuff/patches/glibc-2.26-math-1.patch @ rev 20505
Patch glibc for C++ math - if all will be OK, no more 'std.patch'es will be required.
And, I hope, it will fix qt5 where std.patch not helps.
And, I hope, it will fix qt5 where std.patch not helps.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Mar 16 12:33:33 2018 +0200 (2018-03-16) |
parents | |
children |
rev | line source |
---|---|
al@20505 | 1 From: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com> |
al@20505 | 2 To: libc-alpha at sourceware dot org |
al@20505 | 3 Date: Tue, 15 Aug 2017 14:44:59 -0300 |
al@20505 | 4 Subject: [PATCH 1/3] Do not use __builtin_types_compatible_p in C++ mode (bug 21930) |
al@20505 | 5 Authentication-results: sourceware.org; auth=none |
al@20505 | 6 References: <20170815174501.4143-1-gftg@linux.vnet.ibm.com> |
al@20505 | 7 |
al@20505 | 8 The logic to define isinf for float128 depends on the availability of |
al@20505 | 9 __builtin_types_compatible_p, which is only available in C mode, |
al@20505 | 10 however, the conditionals do not check for C or C++ mode. This lead to |
al@20505 | 11 an error in libstdc++ configure, as reported by bug 21930. |
al@20505 | 12 |
al@20505 | 13 This patch adds a conditional for C mode in the definition of isinf for |
al@20505 | 14 float128. No definition is provided in C++ mode, since libstdc++ |
al@20505 | 15 headers undefine isinf. |
al@20505 | 16 |
al@20505 | 17 Tested for powerpc64le (glibc test suite and libstdc++-v3 configure). |
al@20505 | 18 |
al@20505 | 19 [BZ #21930] |
al@20505 | 20 * math/math.h (isinf): Check if in C or C++ mode before using |
al@20505 | 21 __builtin_types_compatible_p, since this is a C mode feature. |
al@20505 | 22 --- |
al@20505 | 23 math/math.h | 8 ++++++-- |
al@20505 | 24 1 file changed, 6 insertions(+), 2 deletions(-) |
al@20505 | 25 |
al@20505 | 26 diff --git a/math/math.h b/math/math.h |
al@20505 | 27 index e21708045a..dea8dbe1ae 100644 |
al@20505 | 28 --- a/math/math.h |
al@20505 | 29 +++ b/math/math.h |
al@20505 | 30 @@ -442,8 +442,12 @@ enum |
al@20505 | 31 |
al@20505 | 32 /* Return nonzero value if X is positive or negative infinity. */ |
al@20505 | 33 # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \ |
al@20505 | 34 - && !defined __SUPPORT_SNAN__ |
al@20505 | 35 - /* __builtin_isinf_sign is broken for float128 only before GCC 7.0. */ |
al@20505 | 36 + && !defined __SUPPORT_SNAN__ && !defined __cplusplus |
al@20505 | 37 + /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0, |
al@20505 | 38 + use the helper function, __isinff128, with older compilers. This is |
al@20505 | 39 + only provided for C mode, because in C++ mode, GCC has no support |
al@20505 | 40 + for __builtin_types_compatible_p (and when in C++ mode, this macro is |
al@20505 | 41 + not used anyway, because libstdc++ headers undefine it). */ |
al@20505 | 42 # define isinf(x) \ |
al@20505 | 43 (__builtin_types_compatible_p (__typeof (x), _Float128) \ |
al@20505 | 44 ? __isinff128 (x) : __builtin_isinf_sign (x)) |
al@20505 | 45 -- |
al@20505 | 46 2.13.5 |