From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHcat-0005s4-Gw for guix-patches@gnu.org; Wed, 22 Nov 2017 16:30:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHcap-0005aN-8B for guix-patches@gnu.org; Wed, 22 Nov 2017 16:30:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHcao-0005ZV-Ue for guix-patches@gnu.org; Wed, 22 Nov 2017 16:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHcao-0001N8-IW for guix-patches@gnu.org; Wed, 22 Nov 2017 16:30:02 -0500 Subject: [bug#29406] [PATCH core-updates]: Add selected upstream fixes for glibc 2.26. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHcZm-0005Lp-I0 for guix-patches@gnu.org; Wed, 22 Nov 2017 16:29:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHcZi-0004sT-5a for guix-patches@gnu.org; Wed, 22 Nov 2017 16:28:58 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:55099) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHcZh-0004r5-OW for guix-patches@gnu.org; Wed, 22 Nov 2017 16:28:54 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 853A020A7B for ; Wed, 22 Nov 2017 16:28:51 -0500 (EST) Received: from localhost (cm-84.214.173.174.getinternet.no [84.214.173.174]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D8EB24B9C for ; Wed, 22 Nov 2017 16:28:50 -0500 (EST) From: Marius Bakke Date: Wed, 22 Nov 2017 22:28:49 +0100 Message-ID: <87mv3eove6.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29406@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hello! I discovered that 'icu4c' failed to build for x86_64 on 'core-updates'. After some investigation, it turns out to be a problem with in C++ mode, due to its usage of C-only builtins (in the 2.26 release). Here are the relevant bug reports I've found so far by digging through the "release/2.26/master" branch, aka "2.26 stable"[0]: The attached patch includes the fixes from those bugs, as well as a couple of others that looked important. However it's still a very small subset of the 2.26 post-release fixes. I've read through _most_ of the commits and around half of them look important enough to pick "unconditionally". The other half I mainly lack the context or skills to assess. So I wonder if we should simply pick everything from this branch, instead of only the few that fixes immediately visible problems. Thoughts? [0] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.26/master --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-glibc-Add-selected-fixes-from-upstream-stable-br.patch Content-Transfer-Encoding: quoted-printable From=207121dc7ed24e97080154794fb14ae4078a3451f7 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 22 Nov 2017 22:26:31 +0100 Subject: [PATCH] gnu: glibc: Add selected fixes from upstream stable branch. This backports a small subset of . * gnu/packages/patches/glibc-2.26-cpp-fixes.patch, gnu/packages/patches/glibc-2.26-ifunc-resolver-longjmp.patch, gnu/packages/patches/glibc-2.26-resolver-fixes.patch: New files. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/base.scm (glibc/linux)[source](patches): Use them. =2D-- gnu/local.mk | 3 + gnu/packages/base.scm | 3 + gnu/packages/patches/glibc-2.26-cpp-fixes.patch | 716 +++++++++++++++++= ++++ .../glibc-2.26-ifunc-resolver-longjmp.patch | 109 ++++ .../patches/glibc-2.26-resolver-fixes.patch | 52 ++ 5 files changed, 883 insertions(+) create mode 100644 gnu/packages/patches/glibc-2.26-cpp-fixes.patch create mode 100644 gnu/packages/patches/glibc-2.26-ifunc-resolver-longjmp.= patch create mode 100644 gnu/packages/patches/glibc-2.26-resolver-fixes.patch diff --git a/gnu/local.mk b/gnu/local.mk index be093eccd..c6cb1aff7 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -665,6 +665,9 @@ dist_patch_DATA =3D \ %D%/packages/patches/glib-networking-ssl-cert-file.patch \ %D%/packages/patches/glib-respect-datadir.patch \ %D%/packages/patches/glib-tests-timer.patch \ + %D%/packages/patches/glibc-2.26-cpp-fixes.patch \ + %D%/packages/patches/glibc-2.26-resolver-fixes.patch \ + %D%/packages/patches/glibc-2.26-ifunc-resolver-longjmp.patch \ %D%/packages/patches/glibc-CVE-2015-5180.patch \ %D%/packages/patches/glibc-CVE-2015-7547.patch \ %D%/packages/patches/glibc-CVE-2016-3075.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index a6663c5cf..49dc60642 100644 =2D-- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -533,6 +533,9 @@ store.") (modules '((guix build utils))) (patches (search-patches "glibc-ldd-x86_64.patch" "glibc-versioned-locpath.patch" + "glibc-2.26-cpp-fixes.patch" + "glibc-2.26-resolver-fixes.patch" + "glibc-2.26-ifunc-resolver-longjmp.pa= tch" "glibc-CVE-2017-15670-15671.patch" "glibc-o-largefile.patch")))) (build-system gnu-build-system) diff --git a/gnu/packages/patches/glibc-2.26-cpp-fixes.patch b/gnu/packages= /patches/glibc-2.26-cpp-fixes.patch new file mode 100644 index 000000000..7564d3aac =2D-- /dev/null +++ b/gnu/packages/patches/glibc-2.26-cpp-fixes.patch @@ -0,0 +1,716 @@ +Glibc 2.26 pulls in C-only builtins in on some platforms. This i= n turn +causes GCC to fail to override these in when testing their existen= ce. + +This is an amalgamation of patches from a variety of upstream bug reports: + +From : +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Dc2921b17a37e887b8= a5ca9d84b875b9ba702b79c +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D5e989c36934d0f0cf= 13b7a53ef2fa440bce39210 +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Def8566d72af5e03c1= b82cf02efb794268a347f8c +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D35dded99a89db873b= 06270ca7f21245a0faf712a +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D58270c0049404ef2f= 878fdd45df55f17f0b8c1f7 + +From : +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D3b10c5d2abb0392d5= ecfd865e2eb911ac109e36f +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Ddd3a7239fddff81ac= 31373d69978d7aa1902c65f + +From : +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Dd37c951fde57e8acb= 320a9a7d437ba50a1fc3c8a + +From : +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Df8279a4b3cc66d3ec= 8bfb8519e9987b8f7727f53=20 + +...with ChangeLog and NEWS entries removed. + +From c2921b17a37e887b8a5ca9d84b875b9ba702b79c Mon Sep 17 00:00:00 2001 +From: "Gabriel F. T. Gomes" +Date: Mon, 21 Aug 2017 14:23:27 +0200 +Subject: [PATCH] Do not use __builtin_types_compatible_p in C++ mode (bug + 21930) +diff --git a/math/math.h b/math/math.h +index e217080..dea8dbe 100644 +--- a/math/math.h ++++ b/math/math.h +@@ -442,8 +442,12 @@ enum +=20 + /* Return nonzero value if X is positive or negative infinity. */ + # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \ +- && !defined __SUPPORT_SNAN__ +- /* __builtin_isinf_sign is broken for float128 only before GCC 7.0. */ ++ && !defined __SUPPORT_SNAN__ && !defined __cplusplus ++ /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0, ++ use the helper function, __isinff128, with older compilers. This is ++ only provided for C mode, because in C++ mode, GCC has no support ++ for __builtin_types_compatible_p (and when in C++ mode, this macro = is ++ not used anyway, because libstdc++ headers undefine it). */ + # define isinf(x) \ + (__builtin_types_compatible_p (__typeof (x), _Float128) \ + ? __isinff128 (x) : __builtin_isinf_sign (x)) + +From 5e989c36934d0f0cf13b7a53ef2fa440bce39210 Mon Sep 17 00:00:00 2001 +From: "Gabriel F. T. Gomes" +Date: Mon, 14 Aug 2017 17:51:51 -0300 +Subject: [PATCH] Do not use generic selection in C++ mode +diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h +index 06523bf..0c80821 100644 +--- a/misc/sys/cdefs.h ++++ b/misc/sys/cdefs.h +@@ -464,17 +464,18 @@ + # define __glibc_macro_warning(msg) + #endif +=20 +-/* Support for generic selection (ISO C11) is available in GCC since +- version 4.9. Previous versions do not provide generic selection, +- even though they might set __STDC_VERSION__ to 201112L, when in +- -std=3Dc11 mode. Thus, we must check for !defined __GNUC__ when +- testing __STDC_VERSION__ for generic selection support. ++/* Generic selection (ISO C11) is a C-only feature, available in GCC ++ since version 4.9. Previous versions do not provide generic ++ selection, even though they might set __STDC_VERSION__ to 201112L, ++ when in -std=3Dc11 mode. Thus, we must check for !defined __GNUC__ ++ when testing __STDC_VERSION__ for generic selection support. + On the other hand, Clang also defines __GNUC__, so a clang-specific + check is required to enable the use of generic selection. */ +-#if __GNUC_PREREQ (4, 9) \ +- || __glibc_clang_has_extension (c_generic_selections) \ +- || (!defined __GNUC__ && defined __STDC_VERSION__ \ +- && __STDC_VERSION__ >=3D 201112L) ++#if !defined __cplusplus \ ++ && (__GNUC_PREREQ (4, 9) \ ++ || __glibc_clang_has_extension (c_generic_selections) \ ++ || (!defined __GNUC__ && defined __STDC_VERSION__ \ ++ && __STDC_VERSION__ >=3D 201112L)) + # define __HAVE_GENERIC_SELECTION 1 + #else + # define __HAVE_GENERIC_SELECTION 0 + + +From ef8566d72af5e03c1b82cf02efb794268a347f8c Mon Sep 17 00:00:00 2001 +From: "Gabriel F. T. Gomes" +Date: Mon, 14 Aug 2017 13:46:15 -0300 +Subject: [PATCH] Provide a C++ version of issignaling that does not use + __MATH_TG + +diff --git a/math/Makefile b/math/Makefile +index e09b0c0..0130fcf 100644 +--- a/math/Makefile ++++ b/math/Makefile +@@ -203,7 +203,7 @@ tests-static =3D test-fpucw-static test-fpucw-ieee-sta= tic \ + test-signgam-ullong-static test-signgam-ullong-init-static +=20 + ifneq (,$(CXX)) +-tests +=3D test-math-isinff test-math-iszero ++tests +=3D test-math-isinff test-math-iszero test-math-issignaling + endif +=20 + ifneq (no,$(PERL)) +@@ -350,6 +350,7 @@ CFLAGS-test-signgam-ullong-init-static.c =3D -std=3Dc99 +=20 + CFLAGS-test-math-isinff.cc =3D -std=3Dgnu++11 + CFLAGS-test-math-iszero.cc =3D -std=3Dgnu++11 ++CFLAGS-test-math-issignaling.cc =3D -std=3Dgnu++11 +=20 + CFLAGS-test-iszero-excess-precision.c =3D -fexcess-precision=3Dstandard + CFLAGS-test-iseqsig-excess-precision.c =3D -fexcess-precision=3Dstandard +diff --git a/math/math.h b/math/math.h +index dea8dbe..add86af 100644 +--- a/math/math.h ++++ b/math/math.h +@@ -474,7 +474,24 @@ enum + # include +=20 + /* Return nonzero value if X is a signaling NaN. */ +-# define issignaling(x) __MATH_TG ((x), __issignaling, (x)) ++# ifndef __cplusplus ++# define issignaling(x) __MATH_TG ((x), __issignaling, (x)) ++# else ++ /* In C++ mode, __MATH_TG cannot be used, because it relies on ++ __builtin_types_compatible_p, which is a C-only builtin. On the ++ other hand, overloading provides the means to distinguish between ++ the floating-point types. The overloading resolution will match ++ the correct parameter (regardless of type qualifiers (i.e.: const ++ and volatile). */ ++extern "C++" { ++inline int issignaling (float __val) { return __issignalingf (__val); } ++inline int issignaling (double __val) { return __issignaling (__val); } ++inline int issignaling (long double __val) { return __issignalingl (__val= ); } ++# if __HAVE_DISTINCT_FLOAT128 ++inline int issignaling (_Float128 __val) { return __issignalingf128 (__va= l); } ++# endif ++} /* extern C++ */ ++# endif +=20 + /* Return nonzero value if X is subnormal. */ + # define issubnormal(x) (fpclassify (x) =3D=3D FP_SUBNORMAL) +diff --git a/math/test-math-issignaling.cc b/math/test-math-issignaling.cc +new file mode 100644 +index 0000000..22ae9e1 +--- /dev/null ++++ b/math/test-math-issignaling.cc +@@ -0,0 +1,113 @@ ++/* Test for the C++ implementation of issignaling. ++ Copyright (C) 2017 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#define _GNU_SOURCE 1 ++#include ++#include ++ ++#include ++ ++/* There is no signaling_NaN for _Float128 in std::numeric_limits. ++ Include ieee754_float128.h and use the bitfields in the union ++ ieee854_float128.ieee_nan to build a signaling NaN. */ ++#if __HAVE_DISTINCT_FLOAT128 ++# include ++#endif ++ ++static bool errors; ++ ++static void ++check (int actual, int expected, const char *actual_expr, int line) ++{ ++ if (actual !=3D expected) ++ { ++ errors =3D true; ++ printf ("%s:%d: error: %s\n", __FILE__, line, actual_expr); ++ printf ("%s:%d: expected: %d\n", __FILE__, line, expected); ++ printf ("%s:%d: actual: %d\n", __FILE__, line, actual); ++ } ++} ++ ++#define CHECK(actual, expected) \ ++ check ((actual), (expected), #actual, __LINE__) ++ ++template ++static void ++check_type () ++{ ++ typedef std::numeric_limits limits; ++ CHECK (issignaling (T{0}), 0); ++ if (limits::has_infinity) ++ { ++ CHECK (issignaling (limits::infinity ()), 0); ++ CHECK (issignaling (-limits::infinity ()), 0); ++ } ++ if (limits::has_quiet_NaN) ++ CHECK (issignaling (limits::quiet_NaN ()), 0); ++ if (limits::has_signaling_NaN) ++ CHECK (issignaling (limits::signaling_NaN ()), 1); ++} ++ ++#if __HAVE_DISTINCT_FLOAT128 ++static void ++check_float128 () ++{ ++ ieee854_float128 q; ++ ++ q.d =3D 0; ++ CHECK (issignaling (q.d), 0); ++ ++ /* Infinity. */ ++ q.ieee.negative =3D 0; ++ q.ieee.exponent =3D 0x7FFF; ++ q.ieee.mantissa0 =3D 0x0000; ++ q.ieee.mantissa1 =3D 0x00000000; ++ q.ieee.mantissa2 =3D 0x00000000; ++ q.ieee.mantissa3 =3D 0x00000000; ++ CHECK (issignaling (q.d), 0); ++ ++ /* Quiet NaN. */ ++ q.ieee_nan.quiet_nan =3D 1; ++ q.ieee_nan.mantissa0 =3D 0x0000; ++ CHECK (issignaling (q.d), 0); ++ ++ /* Still a quiet NaN. */ ++ q.ieee_nan.quiet_nan =3D 1; ++ q.ieee_nan.mantissa0 =3D 0x4000; ++ CHECK (issignaling (q.d), 0); ++ ++ /* Signaling NaN. */ ++ q.ieee_nan.quiet_nan =3D 0; ++ q.ieee_nan.mantissa0 =3D 0x4000; ++ CHECK (issignaling (q.d), 1); ++} ++#endif ++ ++static int ++do_test (void) ++{ ++ check_type (); ++ check_type (); ++ check_type (); ++#if __HAVE_DISTINCT_FLOAT128 ++ check_float128 (); ++#endif ++ return errors; ++} ++ ++#include +diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerp= c64le/Makefile +index 77617b6..19adbfa 100644 +--- a/sysdeps/powerpc/powerpc64le/Makefile ++++ b/sysdeps/powerpc/powerpc64le/Makefile +@@ -16,6 +16,7 @@ $(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFL= AGS +=3D -mfloat128 + $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLA= GS +=3D -mfloat128 + $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFL= AGS +=3D -mfloat128 + CFLAGS-libm-test-support-float128.c +=3D -mfloat128 ++CFLAGS-test-math-issignaling.cc +=3D -mfloat128 + $(objpfx)test-float128% $(objpfx)test-ifloat128%: \ + gnulib-tests +=3D $(f128-loader-link) + endif + +From 35dded99a89db873b06270ca7f21245a0faf712a Mon Sep 17 00:00:00 2001 +From: "Gabriel F. T. Gomes" +Date: Wed, 23 Aug 2017 10:16:54 -0300 +Subject: [PATCH] Fix the C++ version of issignaling when __NO_LONG_DOUBLE_= MATH + is defined + +diff --git a/math/math.h b/math/math.h +index add86af..60dfa31 100644 +--- a/math/math.h ++++ b/math/math.h +@@ -486,7 +486,15 @@ enum + extern "C++" { + inline int issignaling (float __val) { return __issignalingf (__val); } + inline int issignaling (double __val) { return __issignaling (__val); } +-inline int issignaling (long double __val) { return __issignalingl (__val= ); } ++inline int ++issignaling (long double __val) ++{ ++# ifdef __NO_LONG_DOUBLE_MATH ++ return __issignaling (__val); ++# else ++ return __issignalingl (__val); ++# endif ++} + # if __HAVE_DISTINCT_FLOAT128 + inline int issignaling (_Float128 __val) { return __issignalingf128 (__va= l); } + # endif + +From 58270c0049404ef2f878fdd45df55f17f0b8c1f7 Mon Sep 17 00:00:00 2001 +From: "Gabriel F. T. Gomes" +Date: Tue, 22 Aug 2017 16:34:42 -0300 +Subject: [PATCH] Provide a C++ version of iszero that does not use __MATH_= TG + (bug 21930) +diff --git a/math/math.h b/math/math.h +index 60dfa31..7c0fc6d 100644 +--- a/math/math.h ++++ b/math/math.h +@@ -513,15 +513,40 @@ inline int issignaling (_Float128 __val) { return __= issignalingf128 (__val); } + # endif + # else /* __cplusplus */ + extern "C++" { ++# ifdef __SUPPORT_SNAN__ ++inline int ++iszero (float __val) ++{ ++ return __fpclassifyf (__val) =3D=3D FP_ZERO; ++} ++inline int ++iszero (double __val) ++{ ++ return __fpclassify (__val) =3D=3D FP_ZERO; ++} ++inline int ++iszero (long double __val) ++{ ++# ifdef __NO_LONG_DOUBLE_MATH ++ return __fpclassify (__val) =3D=3D FP_ZERO; ++# else ++ return __fpclassifyl (__val) =3D=3D FP_ZERO; ++# endif ++} ++# if __HAVE_DISTINCT_FLOAT128 ++inline int ++iszero (_Float128 __val) ++{ ++ return __fpclassifyf128 (__val) =3D=3D FP_ZERO; ++} ++# endif ++# else + template inline bool + iszero (__T __val) + { +-# ifdef __SUPPORT_SNAN__ +- return fpclassify (__val) =3D=3D FP_ZERO; +-# else + return __val =3D=3D 0; +-# endif + } ++# endif + } /* extern C++ */ + # endif /* __cplusplus */ + #endif /* Use IEC_60559_BFP_EXT. */ +diff --git a/math/test-math-iszero.cc b/math/test-math-iszero.cc +index 027e972..5c07261 100644 +--- a/math/test-math-iszero.cc ++++ b/math/test-math-iszero.cc +@@ -22,6 +22,13 @@ +=20 + #include +=20 ++/* Support for _Float128 in std::numeric_limits is limited. ++ Include ieee754_float128.h and use the bitfields in the union ++ ieee854_float128.ieee_nan to build corner-case inputs. */ ++#if __HAVE_DISTINCT_FLOAT128 ++# include ++#endif ++ + static bool errors; +=20 + static void +@@ -72,12 +79,84 @@ check_type () + std::numeric_limits::has_denorm =3D=3D std::denorm_absent); + } +=20 ++#if __HAVE_DISTINCT_FLOAT128 ++static void ++check_float128 () ++{ ++ ieee854_float128 q; ++ ++ q.d =3D 0.0Q; ++ CHECK (iszero (q.d), 1); ++ q.d =3D -0.0Q; ++ CHECK (iszero (q.d), 1); ++ q.d =3D 1.0Q; ++ CHECK (iszero (q.d), 0); ++ q.d =3D -1.0Q; ++ CHECK (iszero (q.d), 0); ++ ++ /* Normal min. */ ++ q.ieee.negative =3D 0; ++ q.ieee.exponent =3D 0x0001; ++ q.ieee.mantissa0 =3D 0x0000; ++ q.ieee.mantissa1 =3D 0x00000000; ++ q.ieee.mantissa2 =3D 0x00000000; ++ q.ieee.mantissa3 =3D 0x00000000; ++ CHECK (iszero (q.d), 0); ++ q.ieee.negative =3D 1; ++ CHECK (iszero (q.d), 0); ++ ++ /* Normal max. */ ++ q.ieee.negative =3D 0; ++ q.ieee.exponent =3D 0x7FFE; ++ q.ieee.mantissa0 =3D 0xFFFF; ++ q.ieee.mantissa1 =3D 0xFFFFFFFF; ++ q.ieee.mantissa2 =3D 0xFFFFFFFF; ++ q.ieee.mantissa3 =3D 0xFFFFFFFF; ++ CHECK (iszero (q.d), 0); ++ q.ieee.negative =3D 1; ++ CHECK (iszero (q.d), 0); ++ ++ /* Infinity. */ ++ q.ieee.negative =3D 0; ++ q.ieee.exponent =3D 0x7FFF; ++ q.ieee.mantissa0 =3D 0x0000; ++ q.ieee.mantissa1 =3D 0x00000000; ++ q.ieee.mantissa2 =3D 0x00000000; ++ q.ieee.mantissa3 =3D 0x00000000; ++ CHECK (iszero (q.d), 0); ++ ++ /* Quiet NaN. */ ++ q.ieee_nan.quiet_nan =3D 1; ++ q.ieee_nan.mantissa0 =3D 0x0000; ++ CHECK (iszero (q.d), 0); ++ ++ /* Signaling NaN. */ ++ q.ieee_nan.quiet_nan =3D 0; ++ q.ieee_nan.mantissa0 =3D 0x4000; ++ CHECK (iszero (q.d), 0); ++ ++ /* Denormal min. */ ++ q.ieee.negative =3D 0; ++ q.ieee.exponent =3D 0x0000; ++ q.ieee.mantissa0 =3D 0x0000; ++ q.ieee.mantissa1 =3D 0x00000000; ++ q.ieee.mantissa2 =3D 0x00000000; ++ q.ieee.mantissa3 =3D 0x00000001; ++ CHECK (iszero (q.d), 0); ++ q.ieee.negative =3D 1; ++ CHECK (iszero (q.d), 0); ++} ++#endif ++ + static int + do_test (void) + { + check_type (); + check_type (); + check_type (); ++#if __HAVE_DISTINCT_FLOAT128 ++ check_float128 (); ++#endif + return errors; + } +=20 +diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerp= c64le/Makefile +index 19adbfa..dea2290 100644 +--- a/sysdeps/powerpc/powerpc64le/Makefile ++++ b/sysdeps/powerpc/powerpc64le/Makefile +@@ -17,7 +17,8 @@ $(foreach suf,$(all-object-suffixes),$(objpfx)test-float= 128%$(suf)): CFLAGS +=3D - + $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFL= AGS +=3D -mfloat128 + CFLAGS-libm-test-support-float128.c +=3D -mfloat128 + CFLAGS-test-math-issignaling.cc +=3D -mfloat128 +-$(objpfx)test-float128% $(objpfx)test-ifloat128%: \ ++CFLAGS-test-math-iszero.cc +=3D -mfloat128 ++$(objpfx)test-float128% $(objpfx)test-ifloat128% $(objpfx)test-math-iszer= o: \ + gnulib-tests +=3D $(f128-loader-link) + endif + +From d37c951fde57e8acb320a9a7d437ba50a1fc3c8a Mon Sep 17 00:00:00 2001 +From: "Gabriel F. T. Gomes" +Date: Wed, 20 Sep 2017 15:10:26 -0300 +Subject: [PATCH] Let fpclassify use the builtin when optimizing for size in + C++ mode (bug 22146) +diff --git a/math/math.h b/math/math.h +index 7c0fc6d..f9348ec 100644 +--- a/math/math.h ++++ b/math/math.h +@@ -402,7 +402,13 @@ enum +=20 + /* Return number of classification appropriate for X. */ + # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ \ +- && !defined __OPTIMIZE_SIZE__ ++ && (!defined __OPTIMIZE_SIZE__ || defined __cplusplus) ++ /* The check for __cplusplus allows the use of the builtin, even ++ when optimization for size is on. This is provided for ++ libstdc++, only to let its configure test work when it is built ++ with -Os. No further use of this definition of fpclassify is ++ expected in C++ mode, since libstdc++ provides its own version ++ of fpclassify in cmath (which undefines fpclassify). */ + # define fpclassify(x) __builtin_fpclassify (FP_NAN, FP_INFINITE, \ + FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) + # else + +From 3b10c5d2abb0392d5ecfd865e2eb911ac109e36f Mon Sep 17 00:00:00 2001 +From: "Gabriel F. T. Gomes" +Date: Mon, 2 Oct 2017 14:46:35 -0300 +Subject: [PATCH] Add C++ versions of iscanonical for ldbl-96 and ldbl-128i= bm + (bug 22235) +diff --git a/math/Makefile b/math/Makefile +index 0130fcf..2c17c68 100644 +--- a/math/Makefile ++++ b/math/Makefile +@@ -203,7 +203,8 @@ tests-static =3D test-fpucw-static test-fpucw-ieee-sta= tic \ + test-signgam-ullong-static test-signgam-ullong-init-static +=20 + ifneq (,$(CXX)) +-tests +=3D test-math-isinff test-math-iszero test-math-issignaling ++tests +=3D test-math-isinff test-math-iszero test-math-issignaling \ ++ test-math-iscanonical + endif +=20 + ifneq (no,$(PERL)) +@@ -351,6 +352,7 @@ CFLAGS-test-signgam-ullong-init-static.c =3D -std=3Dc99 + CFLAGS-test-math-isinff.cc =3D -std=3Dgnu++11 + CFLAGS-test-math-iszero.cc =3D -std=3Dgnu++11 + CFLAGS-test-math-issignaling.cc =3D -std=3Dgnu++11 ++CFLAGS-test-math-iscanonical.cc =3D -std=3Dgnu++11 +=20 + CFLAGS-test-iszero-excess-precision.c =3D -fexcess-precision=3Dstandard + CFLAGS-test-iseqsig-excess-precision.c =3D -fexcess-precision=3Dstandard +diff --git a/math/math.h b/math/math.h +index f9348ec..2b216c6 100644 +--- a/math/math.h ++++ b/math/math.h +@@ -488,7 +488,7 @@ enum + other hand, overloading provides the means to distinguish between + the floating-point types. The overloading resolution will match + the correct parameter (regardless of type qualifiers (i.e.: const +- and volatile). */ ++ and volatile)). */ + extern "C++" { + inline int issignaling (float __val) { return __issignalingf (__val); } + inline int issignaling (double __val) { return __issignaling (__val); } +diff --git a/math/test-math-iscanonical.cc b/math/test-math-iscanonical.cc +new file mode 100644 +index 0000000..aba68ac +--- /dev/null ++++ b/math/test-math-iscanonical.cc +@@ -0,0 +1,48 @@ ++/* Test for the C++ implementation of iscanonical. ++ Copyright (C) 2017 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#define _GNU_SOURCE 1 ++#include ++#include ++ ++static bool errors; ++ ++template ++static void ++check_type () ++{ ++ T val =3D 0; ++ ++ /* Check if iscanonical is available in C++ mode (bug 22235). */ ++ if (iscanonical (val) =3D=3D 0) ++ errors++; ++} ++ ++static int ++do_test (void) ++{ ++ check_type (); ++ check_type (); ++ check_type (); ++#if __HAVE_DISTINCT_FLOAT128 ++ check_type<_Float128> (); ++#endif ++ return errors; ++} ++ ++#include +diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee= 754/ldbl-128ibm/bits/iscanonical.h +index 7ddb368..f756857 100644 +--- a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h ++++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h +@@ -37,5 +37,22 @@ extern int __iscanonicall (long double __x) + conversion, before being discarded; in IBM long double, there are + encodings that are not consistently handled as corresponding to any + particular value of the type, and we return 0 for those. */ +-# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) +-#endif ++# ifndef __cplusplus ++# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) ++# else ++/* In C++ mode, __MATH_TG cannot be used, because it relies on ++ __builtin_types_compatible_p, which is a C-only builtin. On the ++ other hand, overloading provides the means to distinguish between ++ the floating-point types. The overloading resolution will match ++ the correct parameter (regardless of type qualifiers (i.e.: const ++ and volatile)). */ ++extern "C++" { ++inline int iscanonical (float __val) { return __iscanonicalf (__val); } ++inline int iscanonical (double __val) { return __iscanonical (__val); } ++inline int iscanonical (long double __val) { return __iscanonicall (__val= ); } ++# if __HAVE_DISTINCT_FLOAT128 ++inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__va= l); } ++# endif ++} ++# endif /* __cplusplus */ ++#endif /* __NO_LONG_DOUBLE_MATH */ +diff --git a/sysdeps/ieee754/ldbl-96/bits/iscanonical.h b/sysdeps/ieee754/= ldbl-96/bits/iscanonical.h +index 4a4f4ad..cfa36a0 100644 +--- a/sysdeps/ieee754/ldbl-96/bits/iscanonical.h ++++ b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h +@@ -34,4 +34,21 @@ extern int __iscanonicall (long double __x) + conversion, before being discarded; in extended precision, there + are encodings that are not consistently handled as corresponding to + any particular value of the type, and we return 0 for those. */ +-#define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) ++#ifndef __cplusplus ++# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) ++#else ++/* In C++ mode, __MATH_TG cannot be used, because it relies on ++ __builtin_types_compatible_p, which is a C-only builtin. On the ++ other hand, overloading provides the means to distinguish between ++ the floating-point types. The overloading resolution will match ++ the correct parameter (regardless of type qualifiers (i.e.: const ++ and volatile)). */ ++extern "C++" { ++inline int iscanonical (float __val) { return __iscanonicalf (__val); } ++inline int iscanonical (double __val) { return __iscanonical (__val); } ++inline int iscanonical (long double __val) { return __iscanonicall (__val= ); } ++# if __HAVE_DISTINCT_FLOAT128 ++inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__va= l); } ++# endif ++} ++#endif /* __cplusplus */ +diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerp= c64le/Makefile +index dea2290..cf2dbfb 100644 +--- a/sysdeps/powerpc/powerpc64le/Makefile ++++ b/sysdeps/powerpc/powerpc64le/Makefile +@@ -16,6 +16,7 @@ $(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFL= AGS +=3D -mfloat128 + $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLA= GS +=3D -mfloat128 + $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFL= AGS +=3D -mfloat128 + CFLAGS-libm-test-support-float128.c +=3D -mfloat128 ++CFLAGS-test-math-iscanonical.cc +=3D -mfloat128 + CFLAGS-test-math-issignaling.cc +=3D -mfloat128 + CFLAGS-test-math-iszero.cc +=3D -mfloat128 + $(objpfx)test-float128% $(objpfx)test-ifloat128% $(objpfx)test-math-iszer= o: \ + +From dd3a7239fddff81ac31373d69978d7aa1902c65f Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Tue, 3 Oct 2017 17:41:32 -0700 +Subject: [PATCH] test-math-iscanonical.cc: Replace bool with int +diff --git a/math/test-math-iscanonical.cc b/math/test-math-iscanonical.cc +index aba68ac..4cfb1c5 100644 +--- a/math/test-math-iscanonical.cc ++++ b/math/test-math-iscanonical.cc +@@ -20,7 +20,7 @@ + #include + #include +=20 +-static bool errors; ++static int errors; +=20 + template + static void +@@ -42,7 +42,7 @@ do_test (void) + #if __HAVE_DISTINCT_FLOAT128 + check_type<_Float128> (); + #endif +- return errors; ++ return errors !=3D 0; + } +=20 + #include +=20 +From f8279a4b3cc66d3ec8bfb8519e9987b8f7727f53 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Mon, 16 Oct 2017 23:21:56 +0200 +Subject: [PATCH] Let signbit use the builtin in C++ mode with gcc < 6.x (b= ug + 22296) +diff --git a/math/math.h b/math/math.h +index 2b216c6..ba26624 100644 +--- a/math/math.h ++++ b/math/math.h +@@ -418,6 +418,15 @@ enum + /* Return nonzero value if sign of X is negative. */ + # if __GNUC_PREREQ (6,0) + # define signbit(x) __builtin_signbit (x) ++# elif defined __cplusplus ++ /* In C++ mode, __MATH_TG cannot be used, because it relies on ++ __builtin_types_compatible_p, which is a C-only builtin. ++ The check for __cplusplus allows the use of the builtin instead of ++ __MATH_TG. This is provided for libstdc++, only to let its configure ++ test work. No further use of this definition of signbit is expected ++ in C++ mode, since libstdc++ provides its own version of signbit ++ in cmath (which undefines signbit). */ ++# define signbit(x) __builtin_signbitl (x) + # elif __GNUC_PREREQ (4,0) + # define signbit(x) __MATH_TG ((x), __builtin_signbit, (x)) + # else + diff --git a/gnu/packages/patches/glibc-2.26-ifunc-resolver-longjmp.patch b= /gnu/packages/patches/glibc-2.26-ifunc-resolver-longjmp.patch new file mode 100644 index 000000000..8f8bad5b1 =2D-- /dev/null +++ b/gnu/packages/patches/glibc-2.26-ifunc-resolver-longjmp.patch @@ -0,0 +1,109 @@ +Fix a linker warning when a shared library that calls longjmp without using +libthread is linked into a program that links -lphtread. + +This should address . + +Upstream bug report: +https://sourceware.org/bugzilla/show_bug.cgi?id=3D21041 + +Copied from upstream git: +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D88758c4ad3f046d05= 0bc2c3ae0f172b6524ca6c2 + +From 88758c4ad3f046d050bc2c3ae0f172b6524ca6c2 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Tue, 8 Aug 2017 16:21:58 +0200 +Subject: [PATCH] Don't use IFUNC resolver for longjmp or system in libpthr= ead + (bug 21041) +diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c +index 2ef757e..8f3c6b3 100644 +--- a/nptl/pt-longjmp.c ++++ b/nptl/pt-longjmp.c +@@ -25,21 +25,14 @@ + symbol in libpthread, but the historical ABI requires it. For static + linking, there is no need to provide anything here--the libc version + will be linked in. For shared library ABI compatibility, there must be +- longjmp and siglongjmp symbols in libpthread.so; so we define them usi= ng +- IFUNC to redirect to the libc function. */ ++ longjmp and siglongjmp symbols in libpthread.so. +=20 +-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) +- +-# if HAVE_IFUNC +- +-# undef INIT_ARCH +-# define INIT_ARCH() +-# define DEFINE_LONGJMP(name) libc_ifunc (name, &__libc_longjmp) +- +-extern __typeof(longjmp) longjmp_ifunc; +-extern __typeof(siglongjmp) siglongjmp_ifunc; ++ With an IFUNC resolver, it would be possible to avoid the indirection, ++ but the IFUNC resolver might run before the __libc_longjmp symbol has ++ been relocated, in which case the IFUNC resolver would not be able to ++ provide the correct address. */ +=20 +-# else /* !HAVE_IFUNC */ ++#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) +=20 + static void __attribute__ ((noreturn, used)) + longjmp_compat (jmp_buf env, int val) +@@ -47,14 +40,10 @@ longjmp_compat (jmp_buf env, int val) + __libc_longjmp (env, val); + } +=20 +-# define DEFINE_LONGJMP(name) strong_alias (longjmp_compat, name) +- +-# endif /* HAVE_IFUNC */ +- +-DEFINE_LONGJMP (longjmp_ifunc) +-compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0); ++strong_alias (longjmp_compat, longjmp_alias) ++compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0); +=20 +-strong_alias (longjmp_ifunc, siglongjmp_ifunc) +-compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0); ++strong_alias (longjmp_alias, siglongjmp_alias) ++compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0); +=20 + #endif +diff --git a/nptl/pt-system.c b/nptl/pt-system.c +index f8ca6ba..b30ddf2 100644 +--- a/nptl/pt-system.c ++++ b/nptl/pt-system.c +@@ -25,29 +25,21 @@ + libpthread, but the historical ABI requires it. For static linking, + there is no need to provide anything here--the libc version will be + linked in. For shared library ABI compatibility, there must be a +- 'system' symbol in libpthread.so; so we define it using IFUNC to +- redirect to the libc function. */ ++ 'system' symbol in libpthread.so. +=20 +-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) +- +-# if HAVE_IFUNC +- +-extern __typeof(system) system_ifunc; +-# undef INIT_ARCH +-# define INIT_ARCH() +-libc_ifunc (system_ifunc, &__libc_system) ++ With an IFUNC resolver, it would be possible to avoid the indirection, ++ but the IFUNC resolver might run before the __libc_system symbol has ++ been relocated, in which case the IFUNC resolver would not be able to ++ provide the correct address. */ +=20 +-# else /* !HAVE_IFUNC */ ++#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) +=20 + static int __attribute__ ((used)) + system_compat (const char *line) + { + return __libc_system (line); + } +-strong_alias (system_compat, system_ifunc) +- +-# endif /* HAVE_IFUNC */ +- +-compat_symbol (libpthread, system_ifunc, system, GLIBC_2_0); ++strong_alias (system_compat, system_alias) ++compat_symbol (libpthread, system_alias, system, GLIBC_2_0); +=20 + #endif diff --git a/gnu/packages/patches/glibc-2.26-resolver-fixes.patch b/gnu/pac= kages/patches/glibc-2.26-resolver-fixes.patch new file mode 100644 index 000000000..5ddf76753 =2D-- /dev/null +++ b/gnu/packages/patches/glibc-2.26-resolver-fixes.patch @@ -0,0 +1,52 @@ +This patch fixes some problems in the glibc 2.26 resolver. + +https://sourceware.org/bugzilla/show_bug.cgi?id=3D22095 +https://sourceware.org/bugzilla/show_bug.cgi?id=3D22096 + +Picked from these commits: +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D905a6129147e7ee80= e8918e23efe212433b8cce7 +https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3D27233446a62ca35ce= 0b54566279a99a6774d4210 + +From 905a6129147e7ee80e8918e23efe212433b8cce7 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Wed, 6 Sep 2017 15:46:54 +0200 +Subject: [PATCH] resolv: Fix memory leak with OOM during resolv.conf parsi= ng + [BZ #22095] +diff --git a/resolv/res_init.c b/resolv/res_init.c +index fa46ce7..4e1f9fe 100644 +--- a/resolv/res_init.c ++++ b/resolv/res_init.c +@@ -446,6 +446,11 @@ res_vinit_1 (FILE *fp, struct resolv_conf_parser *par= ser) + (&parser->nameserver_list); + if (p !=3D NULL) + *p =3D sa; ++ else ++ { ++ free (sa); ++ return false; ++ } + } + continue; + } + +From 27233446a62ca35ce0b54566279a99a6774d4210 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Wed, 6 Sep 2017 15:47:27 +0200 +Subject: [PATCH] resolv: __resolv_conf_attach must not free passed conf ob= ject + [BZ #22096] +diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c +index f391d30c2..e0f296d 100644 +--- a/resolv/resolv_conf.c ++++ b/resolv/resolv_conf.c +@@ -600,10 +600,7 @@ __resolv_conf_attach (struct __res_state *resp, struc= t resolv_conf *conf) +=20 + struct resolv_conf_global *global_copy =3D get_locked_global (); + if (global_copy =3D=3D NULL) +- { +- free (conf); +- return false; +- } ++ return false; +=20 + /* Try to find an unused index in the array. */ + size_t index; =2D-=20 2.15.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAloV7BEACgkQoqBt8qM6 VPrDfAf/W+UsnOT/bIAPfrBNG8FWftictIKGK4tgOEMgCJhPt+dutjNSr0QUqdaR Pk+ZuoFYuBvZjFrhcD2jD3TjDLaySQ9X380OsJDjSY0bX+xbqrRopY1BHtxQQJvD x5GORw8IRNmNBUuMcGQFjLV7Wl94juqQt0AhvCKRbZ/X5sEBcwue9c5kYIzruhfa 8GlZ69/EUa5zN2pFdR8nt7tSbuViU2Kou1oG//1rzVPaJgRKeGWlhye1y4p/ICO3 mU+vtcHGt5i9sif3BRxq0B/ycxzaHajHwoqW+aFIsAFM/NS19YkBEL7aSfUMNJu0 GSDsKOOnyN4Osydmg2gZGzVtIH9Ttw== =s1A4 -----END PGP SIGNATURE----- --==-=-=--