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