wok-next diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/glibc/stuff/patches/glibc-2.26-math-1.patch	Fri Mar 16 12:33:33 2018 +0200
     1.3 @@ -0,0 +1,46 @@
     1.4 +    From: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
     1.5 +    To: libc-alpha at sourceware dot org
     1.6 +    Date: Tue, 15 Aug 2017 14:44:59 -0300
     1.7 +    Subject: [PATCH 1/3] Do not use __builtin_types_compatible_p in C++ mode (bug 21930)
     1.8 +    Authentication-results: sourceware.org; auth=none
     1.9 +    References: <20170815174501.4143-1-gftg@linux.vnet.ibm.com>
    1.10 +
    1.11 +The logic to define isinf for float128 depends on the availability of
    1.12 +__builtin_types_compatible_p, which is only available in C mode,
    1.13 +however, the conditionals do not check for C or C++ mode.  This lead to
    1.14 +an error in libstdc++ configure, as reported by bug 21930.
    1.15 +
    1.16 +This patch adds a conditional for C mode in the definition of isinf for
    1.17 +float128.  No definition is provided in C++ mode, since libstdc++
    1.18 +headers undefine isinf.
    1.19 +
    1.20 +Tested for powerpc64le (glibc test suite and libstdc++-v3 configure).
    1.21 +
    1.22 +	[BZ #21930]
    1.23 +	* math/math.h (isinf): Check if in C or C++ mode before using
    1.24 +	__builtin_types_compatible_p, since this is a C mode feature.
    1.25 +---
    1.26 + math/math.h | 8 ++++++--
    1.27 + 1 file changed, 6 insertions(+), 2 deletions(-)
    1.28 +
    1.29 +diff --git a/math/math.h b/math/math.h
    1.30 +index e21708045a..dea8dbe1ae 100644
    1.31 +--- a/math/math.h
    1.32 ++++ b/math/math.h
    1.33 +@@ -442,8 +442,12 @@ enum
    1.34 + 
    1.35 + /* Return nonzero value if X is positive or negative infinity.  */
    1.36 + # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
    1.37 +-     && !defined __SUPPORT_SNAN__
    1.38 +-   /* __builtin_isinf_sign is broken for float128 only before GCC 7.0.  */
    1.39 ++     && !defined __SUPPORT_SNAN__ && !defined __cplusplus
    1.40 ++   /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
    1.41 ++      use the helper function, __isinff128, with older compilers.  This is
    1.42 ++      only provided for C mode, because in C++ mode, GCC has no support
    1.43 ++      for __builtin_types_compatible_p (and when in C++ mode, this macro is
    1.44 ++      not used anyway, because libstdc++ headers undefine it).  */
    1.45 + #  define isinf(x) \
    1.46 +     (__builtin_types_compatible_p (__typeof (x), _Float128) \
    1.47 +      ? __isinff128 (x) : __builtin_isinf_sign (x))
    1.48 +-- 
    1.49 +2.13.5