diff --git a/glibc-rh2222188-1.patch b/glibc-rh2222188-1.patch new file mode 100644 index 0000000..cd082ed --- /dev/null +++ b/glibc-rh2222188-1.patch @@ -0,0 +1,147 @@ +commit d653fd2d9ebe23c2b16b76edf717c5dbd5ce9b77 +Author: Florian Weimer +Date: Thu Mar 10 08:50:51 2022 +0100 + + malloc: Exit early on test failure in tst-realloc + + This addresses more (correct) use-after-free warnings reported by + GCC 12 on some targets. + + Fixes commit c094c232eb3246154265bb035182f92fe1b17ab8 ("Avoid + -Wuse-after-free in tests [BZ #26779]."). + + Reviewed-by: Siddhesh Poyarekar + +diff --git a/malloc/tst-realloc.c b/malloc/tst-realloc.c +index 80711beab1257ed5..e985b9d565086257 100644 +--- a/malloc/tst-realloc.c ++++ b/malloc/tst-realloc.c +@@ -20,15 +20,7 @@ + #include + #include + #include +- +-static int errors = 0; +- +-static void +-merror (const char *msg) +-{ +- ++errors; +- printf ("Error: %s\n", msg); +-} ++#include + + static int + do_test (void) +@@ -51,11 +43,11 @@ do_test (void) + save = errno; + + if (p != NULL) +- merror ("realloc (NULL, -1) succeeded."); ++ FAIL_EXIT1 ("realloc (NULL, -1) succeeded."); + + /* errno should be set to ENOMEM on failure (POSIX). */ + if (p == NULL && save != ENOMEM) +- merror ("errno is not set correctly"); ++ FAIL_EXIT1 ("errno is not set correctly"); + + errno = 0; + +@@ -64,18 +56,18 @@ do_test (void) + save = errno; + + if (p == NULL) +- merror ("realloc (NULL, 10) failed."); ++ FAIL_EXIT1 ("realloc (NULL, 10) failed."); + + free (p); + + p = calloc (20, 1); + if (p == NULL) +- merror ("calloc (20, 1) failed."); ++ FAIL_EXIT1 ("calloc (20, 1) failed."); + + /* Check increasing size preserves contents (C89). */ + p = realloc (p, 200); + if (p == NULL) +- merror ("realloc (p, 200) failed."); ++ FAIL_EXIT1 ("realloc (p, 200) failed."); + + c = p; + ok = 1; +@@ -87,20 +79,20 @@ do_test (void) + } + + if (ok == 0) +- merror ("first 20 bytes were not cleared"); ++ FAIL_EXIT1 ("first 20 bytes were not cleared"); + + free (p); + + p = realloc (NULL, 100); + if (p == NULL) +- merror ("realloc (NULL, 100) failed."); ++ FAIL_EXIT1 ("realloc (NULL, 100) failed."); + + memset (p, 0xff, 100); + + /* Check decreasing size preserves contents (C89). */ + p = realloc (p, 16); + if (p == NULL) +- merror ("realloc (p, 16) failed."); ++ FAIL_EXIT1 ("realloc (p, 16) failed."); + + c = p; + ok = 1; +@@ -112,7 +104,7 @@ do_test (void) + } + + if (ok == 0) +- merror ("first 16 bytes were not correct"); ++ FAIL_EXIT1 ("first 16 bytes were not correct"); + + /* Check failed realloc leaves original untouched (C89). */ + DIAG_PUSH_NEEDS_COMMENT; +@@ -124,7 +116,7 @@ do_test (void) + c = realloc (p, -1); + DIAG_POP_NEEDS_COMMENT; + if (c != NULL) +- merror ("realloc (p, -1) succeeded."); ++ FAIL_EXIT1 ("realloc (p, -1) succeeded."); + + c = p; + ok = 1; +@@ -136,29 +128,21 @@ do_test (void) + } + + if (ok == 0) +- merror ("first 16 bytes were not correct after failed realloc"); ++ FAIL_EXIT1 ("first 16 bytes were not correct after failed realloc"); + +-#if __GNUC_PREREQ (12, 0) +- /* Ignore a valid warning about using a pointer made indeterminate +- by a prior call to realloc(). */ +- DIAG_IGNORE_NEEDS_COMMENT (12, "-Wuse-after-free"); +-#endif + /* realloc (p, 0) frees p (C89) and returns NULL (glibc). */ + p = realloc (p, 0); +-#if __GNUC_PREREQ (12, 0) +- DIAG_POP_NEEDS_COMMENT; +-#endif + if (p != NULL) +- merror ("realloc (p, 0) returned non-NULL."); ++ FAIL_EXIT1 ("realloc (p, 0) returned non-NULL."); + + /* realloc (NULL, 0) acts like malloc (0) (glibc). */ + p = realloc (NULL, 0); + if (p == NULL) +- merror ("realloc (NULL, 0) returned NULL."); ++ FAIL_EXIT1 ("realloc (NULL, 0) returned NULL."); + + free (p); + +- return errors != 0; ++ return 0; + } + + #define TEST_FUNCTION do_test () diff --git a/glibc-rh2222188-2.patch b/glibc-rh2222188-2.patch new file mode 100644 index 0000000..2bdb341 --- /dev/null +++ b/glibc-rh2222188-2.patch @@ -0,0 +1,382 @@ +commit 3e5760fcb48528d48deeb60cb885a97bb731160c +Author: Joseph Myers +Date: Wed Sep 28 20:09:34 2022 +0000 + + Update _FloatN header support for C++ in GCC 13 + + GCC 13 adds support for _FloatN and _FloatNx types in C++, so breaking + the installed glibc headers that assume such support is not present. + GCC mostly works around this with fixincludes, but that doesn't help + for building glibc and its tests (glibc doesn't itself contain C++ + code, but there's C++ code built for tests). Update glibc's + bits/floatn-common.h and bits/floatn.h headers to handle the GCC 13 + support directly. + + In general the changes match those made by fixincludes, though I think + the ones in sysdeps/powerpc/bits/floatn.h, where the header tests + __LDBL_MANT_DIG__ == 113 or uses #elif, wouldn't match the existing + fixincludes patterns. + + Some places involving special C++ handling in relation to _FloatN + support are not changed. There's no need to change the + __HAVE_FLOATN_NOT_TYPEDEF definition (also in a form that wouldn't be + matched by the fixincludes fixes) because it's only used in relation + to macro definitions using features not supported for C++ + (__builtin_types_compatible_p and _Generic). And there's no need to + change the inline function overloads for issignaling, iszero and + iscanonical in C++ because cases where types have the same format but + are no longer compatible types are handled automatically by the C++ + overload resolution rules. + + This patch also does not change the overload handling for iseqsig, and + there I think changes *are* needed, beyond those in this patch or made + by fixincludes. The way that overload is defined, via a template + parameter to a structure type, requires overloads whenever the types + are incompatible, even if they have the same format. So I think we + need to add overloads with GCC 13 for every supported _FloatN and + _FloatNx type, rather than just having one for _Float128 when it has a + different ABI to long double as at present (but for older GCC, such + overloads must not be defined for types that end up defined as + typedefs for another type). + + Tested with build-many-glibcs.py: compilers build for + aarch64-linux-gnu ia64-linux-gnu mips64-linux-gnu powerpc-linux-gnu + powerpc64le-linux-gnu x86_64-linux-gnu; glibcs build for + aarch64-linux-gnu ia64-linux-gnu i686-linux-gnu mips-linux-gnu + mips64-linux-gnu-n32 powerpc-linux-gnu powerpc64le-linux-gnu + x86_64-linux-gnu. + +diff --git a/bits/floatn-common.h b/bits/floatn-common.h +index b43c9532d8b01cca..45d4555f48483fff 100644 +--- a/bits/floatn-common.h ++++ b/bits/floatn-common.h +@@ -78,7 +78,7 @@ + or _FloatNx types, if __HAVE_ is 1. The corresponding + literal suffixes exist since GCC 7, for C only. */ + # if __HAVE_FLOAT16 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* No corresponding suffix available for this type. */ + # define __f16(x) ((_Float16) x##f) + # else +@@ -87,7 +87,7 @@ + # endif + + # if __HAVE_FLOAT32 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # define __f32(x) x##f + # else + # define __f32(x) x##f32 +@@ -95,7 +95,7 @@ + # endif + + # if __HAVE_FLOAT64 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # ifdef __NO_LONG_DOUBLE_MATH + # define __f64(x) x##l + # else +@@ -107,7 +107,7 @@ + # endif + + # if __HAVE_FLOAT32X +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # define __f32x(x) x + # else + # define __f32x(x) x##f32x +@@ -115,7 +115,7 @@ + # endif + + # if __HAVE_FLOAT64X +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # if __HAVE_FLOAT64X_LONG_DOUBLE + # define __f64x(x) x##l + # else +@@ -127,7 +127,7 @@ + # endif + + # if __HAVE_FLOAT128X +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # error "_Float128X supported but no constant suffix" + # else + # define __f128x(x) x##f128x +@@ -136,7 +136,7 @@ + + /* Defined to a complex type if __HAVE_ is 1. */ + # if __HAVE_FLOAT16 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); + # define __CFLOAT16 __cfloat16 + # else +@@ -145,7 +145,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); + # endif + + # if __HAVE_FLOAT32 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # define __CFLOAT32 _Complex float + # else + # define __CFLOAT32 _Complex _Float32 +@@ -153,7 +153,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); + # endif + + # if __HAVE_FLOAT64 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # ifdef __NO_LONG_DOUBLE_MATH + # define __CFLOAT64 _Complex long double + # else +@@ -165,7 +165,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); + # endif + + # if __HAVE_FLOAT32X +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # define __CFLOAT32X _Complex double + # else + # define __CFLOAT32X _Complex _Float32x +@@ -173,7 +173,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); + # endif + + # if __HAVE_FLOAT64X +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # if __HAVE_FLOAT64X_LONG_DOUBLE + # define __CFLOAT64X _Complex long double + # else +@@ -185,7 +185,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); + # endif + + # if __HAVE_FLOAT128X +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # error "_Float128X supported but no complex type" + # else + # define __CFLOAT128X _Complex _Float128x +@@ -195,7 +195,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); + /* The remaining of this file provides support for older compilers. */ + # if __HAVE_FLOAT16 + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef float _Float16 __attribute__ ((__mode__ (__HF__))); + # endif + +@@ -210,7 +210,7 @@ typedef float _Float16 __attribute__ ((__mode__ (__HF__))); + + # if __HAVE_FLOAT32 + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef float _Float32; + # endif + +@@ -234,7 +234,7 @@ typedef float _Float32; + + # ifdef __NO_LONG_DOUBLE_MATH + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef long double _Float64; + # endif + +@@ -247,7 +247,7 @@ typedef long double _Float64; + + # else + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef double _Float64; + # endif + +@@ -264,7 +264,7 @@ typedef double _Float64; + + # if __HAVE_FLOAT32X + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef double _Float32x; + # endif + +@@ -281,7 +281,7 @@ typedef double _Float32x; + + # if __HAVE_FLOAT64X_LONG_DOUBLE + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef long double _Float64x; + # endif + +@@ -294,7 +294,7 @@ typedef long double _Float64x; + + # else + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef _Float128 _Float64x; + # endif + +@@ -311,7 +311,7 @@ typedef _Float128 _Float64x; + + # if __HAVE_FLOAT128X + +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # error "_Float128x supported but no type" + # endif + +diff --git a/sysdeps/ia64/bits/floatn.h b/sysdeps/ia64/bits/floatn.h +index 60c5a130e12d88a1..3d493909aeebf81e 100644 +--- a/sysdeps/ia64/bits/floatn.h ++++ b/sysdeps/ia64/bits/floatn.h +@@ -56,7 +56,7 @@ + /* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* The literal suffix f128 exists only since GCC 7.0. */ + # define __f128(x) x##q + # else +@@ -66,7 +66,7 @@ + + /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* Add a typedef for older GCC compilers which don't natively support + _Complex _Float128. */ + typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); +@@ -80,7 +80,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); + # if __HAVE_FLOAT128 + + /* The type _Float128 exists only since GCC 7.0. */ +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef __float128 _Float128; + # endif + +diff --git a/sysdeps/ieee754/ldbl-128/bits/floatn.h b/sysdeps/ieee754/ldbl-128/bits/floatn.h +index da50ae796f681c60..d75a3d12e890c0be 100644 +--- a/sysdeps/ieee754/ldbl-128/bits/floatn.h ++++ b/sysdeps/ieee754/ldbl-128/bits/floatn.h +@@ -55,7 +55,7 @@ + /* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* The literal suffix f128 exists only since GCC 7.0. */ + # define __f128(x) x##l + # else +@@ -65,7 +65,7 @@ + + /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # define __CFLOAT128 _Complex long double + # else + # define __CFLOAT128 _Complex _Float128 +@@ -76,7 +76,7 @@ + # if __HAVE_FLOAT128 + + /* The type _Float128 exists only since GCC 7.0. */ +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef long double _Float128; + # endif + +diff --git a/sysdeps/mips/ieee754/bits/floatn.h b/sysdeps/mips/ieee754/bits/floatn.h +index b7720a2889e59e8f..fe7be983592e1e0e 100644 +--- a/sysdeps/mips/ieee754/bits/floatn.h ++++ b/sysdeps/mips/ieee754/bits/floatn.h +@@ -55,7 +55,7 @@ + /* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* The literal suffix f128 exists only since GCC 7.0. */ + # define __f128(x) x##l + # else +@@ -65,7 +65,7 @@ + + /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + # define __CFLOAT128 _Complex long double + # else + # define __CFLOAT128 _Complex _Float128 +@@ -76,7 +76,7 @@ + # if __HAVE_FLOAT128 + + /* The type _Float128 exists only since GCC 7.0. */ +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef long double _Float128; + # endif + +diff --git a/sysdeps/powerpc/bits/floatn.h b/sysdeps/powerpc/bits/floatn.h +index fab164e0a2907668..a5a572f646dac2bf 100644 +--- a/sysdeps/powerpc/bits/floatn.h ++++ b/sysdeps/powerpc/bits/floatn.h +@@ -57,7 +57,7 @@ + /* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* The literal suffix (f128) exist for powerpc only since GCC 7.0. */ + # if __LDBL_MANT_DIG__ == 113 + # define __f128(x) x##l +@@ -71,10 +71,10 @@ + + /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if __LDBL_MANT_DIG__ == 113 && defined __cplusplus ++# if __LDBL_MANT_DIG__ == 113 && defined __cplusplus && !__GNUC_PREREQ (13, 0) + typedef long double _Float128; + # define __CFLOAT128 _Complex long double +-# elif !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# elif !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* The type _Float128 exist for powerpc only since GCC 7.0. */ + typedef __float128 _Float128; + /* Add a typedef for older GCC and C++ compilers which don't natively support +diff --git a/sysdeps/x86/bits/floatn.h b/sysdeps/x86/bits/floatn.h +index f0c51716a99c1886..8674273f46b87069 100644 +--- a/sysdeps/x86/bits/floatn.h ++++ b/sysdeps/x86/bits/floatn.h +@@ -58,7 +58,7 @@ + /* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* The literal suffix f128 exists only since GCC 7.0. */ + # define __f128(x) x##q + # else +@@ -68,7 +68,7 @@ + + /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ + # if __HAVE_FLOAT128 +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + /* Add a typedef for older GCC compilers which don't natively support + _Complex _Float128. */ + typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); +@@ -82,7 +82,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); + # if __HAVE_FLOAT128 + + /* The type _Float128 exists only since GCC 7.0. */ +-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus ++# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) + typedef __float128 _Float128; + # endif + diff --git a/glibc-rh2222188-3.patch b/glibc-rh2222188-3.patch new file mode 100644 index 0000000..c875e8d --- /dev/null +++ b/glibc-rh2222188-3.patch @@ -0,0 +1,897 @@ +commit f66780ba46805760a328f01967836416b06c93ca +Author: Joseph Myers +Date: Mon Oct 31 23:20:08 2022 +0000 + + Fix build with GCC 13 _FloatN, _FloatNx built-in functions + + GCC 13 has added more _FloatN and _FloatNx versions of existing + and built-in functions, for use in libstdc++-v3. + + This breaks the glibc build because of how those functions are defined + as aliases to functions with the same ABI but different types. Add + appropriate -fno-builtin-* options for compiling relevant files, as + already done for the case of long double functions aliasing double + ones and based on the list of files used there. + + I fixed some mistakes in that list of double files that I noticed + while implementing this fix, but there may well be more such + (harmless) cases, in this list or the new one (files that don't + actually exist or don't define the named functions as aliases so don't + need the options). I did try to exclude cases where glibc doesn't + define certain functions for _FloatN or _FloatNx types at all from the + new uses of -fno-builtin-* options. As with the options for double + files (see the commit message for commit + 49348beafe9ba150c9bd48595b3f372299bddbb0, "Fix build with GCC 10 when + long double = double."), it's deliberate that the options are used + even if GCC currently doesn't have a built-in version of a given + functions, so providing some level of future-proofing against more + such built-in functions being added in future. + + Tested with build-many-glibcs.py for aarch64-linux-gnu + powerpc-linux-gnu powerpc64le-linux-gnu x86_64-linux-gnu (compilers + and glibcs builds) with GCC mainline. + +Conflicts: + math/Makefile + (missing narrowing fma, sqrt downstream) + +diff --git a/math/Makefile b/math/Makefile +index ceb1eb2085c8bfd4..2edb044d9d590de1 100644 +--- a/math/Makefile ++++ b/math/Makefile +@@ -661,16 +661,18 @@ CFLAGS-s_csinh.c += -fno-builtin-csinhl + CFLAGS-s_csqrt.c += -fno-builtin-csqrtl + CFLAGS-s_ctan.c += -fno-builtin-ctanl + CFLAGS-s_ctanh.c += -fno-builtin-ctanhl +-CFLAGS-s_dadd.c += -fno-builtin-daddl +-CFLAGS-s_ddiv.c += -fno-builtin-ddivl +-CFLAGS-s_dmul.c += -fno-builtin-dmull +-CFLAGS-s_dsub.c += -fno-builtin-dsubl + CFLAGS-s_erf.c += -fno-builtin-erfl + CFLAGS-s_erfc.c += -fno-builtin-erfcl + CFLAGS-e_exp.c += -fno-builtin-expl + CFLAGS-w_exp10.c += -fno-builtin-exp10l + CFLAGS-e_exp2.c += -fno-builtin-exp2l + CFLAGS-s_expm1.c += -fno-builtin-expm1l ++CFLAGS-s_f32xaddf64.c += -fno-builtin-daddl ++CFLAGS-s_f32xdivf64.c += -fno-builtin-ddivl ++CFLAGS-s_f32xfmaf64.c += -fno-builtin-dfmal ++CFLAGS-s_f32xmulf64.c += -fno-builtin-dmull ++CFLAGS-s_f32xsqrtf64.c += -fno-builtin-dsqrtl ++CFLAGS-s_f32xsubf64.c += -fno-builtin-dsubl + CFLAGS-s_fabs.c += -fno-builtin-fabsl + CFLAGS-s_fadd.c += -fno-builtin-faddl + CFLAGS-s_fdim.c += -fno-builtin-fdiml +@@ -688,7 +690,6 @@ CFLAGS-s_frexp.c += -fno-builtin-frexpl + CFLAGS-s_fromfp.c += -fno-builtin-fromfpl + CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxl + CFLAGS-s_fsub.c += -fno-builtin-fsubl +-CFLAGS-s_gamma.c += -fno-builtin-gammal + CFLAGS-s_getpayload.c += -fno-builtin-getpayloadl + CFLAGS-w_hypot.c += -fno-builtin-hypotl + CFLAGS-w_ilogb.c += -fno-builtin-ilogbl +@@ -747,6 +748,240 @@ CFLAGS-s_y1.c += -fno-builtin-y1l + CFLAGS-s_yn.c += -fno-builtin-ynl + endif + ++# Likewise, for _Float32x and _Float64 aliases. ++CFLAGS-w_acos.c += -fno-builtin-acosf32x -fno-builtin-acosf64 ++CFLAGS-w_acosh.c += -fno-builtin-acoshf32x -fno-builtin-acoshf64 ++CFLAGS-w_asin.c += -fno-builtin-asinf32x -fno-builtin-asinf64 ++CFLAGS-s_asinh.c += -fno-builtin-asinhf32x -fno-builtin-asinhf64 ++CFLAGS-s_atan.c += -fno-builtin-atanf32x -fno-builtin-atanf64 ++CFLAGS-w_atan2.c += -fno-builtin-atan2f32x -fno-builtin-atan2f64 ++CFLAGS-w_atanh.c += -fno-builtin-atanhf32x -fno-builtin-atanhf64 ++CFLAGS-s_cabs.c += -fno-builtin-cabsf32x -fno-builtin-cabsf64 ++CFLAGS-s_cacos.c += -fno-builtin-cacosf32x -fno-builtin-cacosf64 ++CFLAGS-s_cacosh.c += -fno-builtin-cacoshf32x -fno-builtin-cacoshf64 ++CFLAGS-s_canonicalize.c += -fno-builtin-canonicalizef32x -fno-builtin-canonicalizef64 ++CFLAGS-s_carg.c += -fno-builtin-cargf32x -fno-builtin-cargf64 ++CFLAGS-s_casin.c += -fno-builtin-casinf32x -fno-builtin-casinf64 ++CFLAGS-s_casinh.c += -fno-builtin-casinhf32x -fno-builtin-casinhf64 ++CFLAGS-s_catan.c += -fno-builtin-catanf32x -fno-builtin-catanf64 ++CFLAGS-s_catanh.c += -fno-builtin-catanhf32x -fno-builtin-catanhf64 ++CFLAGS-s_cbrt.c += -fno-builtin-cbrtf32x -fno-builtin-cbrtf64 ++CFLAGS-s_ccos.c += -fno-builtin-ccosf32x -fno-builtin-ccosf64 ++CFLAGS-s_ccosh.c += -fno-builtin-ccoshf32x -fno-builtin-ccoshf64 ++CFLAGS-s_ceil.c += -fno-builtin-ceilf32x -fno-builtin-ceilf64 ++CFLAGS-s_cexp.c += -fno-builtin-cexpf32x -fno-builtin-cexpf64 ++CFLAGS-s_cimag.c += -fno-builtin-cimagf32x -fno-builtin-cimagf64 ++CFLAGS-s_clog.c += -fno-builtin-clogf32x -fno-builtin-clogf64 ++CFLAGS-s_clog10.c += -fno-builtin-clog10f32x -fno-builtin-clog10f64 ++CFLAGS-s_conj.c += -fno-builtin-conjf32x -fno-builtin-conjf64 ++CFLAGS-s_copysign.c += -fno-builtin-copysignf32x -fno-builtin-copysignf64 ++CFLAGS-s_cos.c += -fno-builtin-cosf32x -fno-builtin-cosf64 ++CFLAGS-w_cosh.c += -fno-builtin-coshf32x -fno-builtin-coshf64 ++CFLAGS-s_cpow.c += -fno-builtin-cpowf32x -fno-builtin-cpowf64 ++CFLAGS-s_cproj.c += -fno-builtin-cprojf32x -fno-builtin-cprojf64 ++CFLAGS-s_creal.c += -fno-builtin-crealf32x -fno-builtin-crealf64 ++CFLAGS-s_csin.c += -fno-builtin-csinf32x -fno-builtin-csinf64 ++CFLAGS-s_csinh.c += -fno-builtin-csinhf32x -fno-builtin-csinhf64 ++CFLAGS-s_csqrt.c += -fno-builtin-csqrtf32x -fno-builtin-csqrtf64 ++CFLAGS-s_ctan.c += -fno-builtin-ctanf32x -fno-builtin-ctanf64 ++CFLAGS-s_ctanh.c += -fno-builtin-ctanhf32x -fno-builtin-ctanhf64 ++CFLAGS-s_erf.c += -fno-builtin-erff32x -fno-builtin-erff64 ++CFLAGS-s_erfc.c += -fno-builtin-erfcf32x -fno-builtin-erfcf64 ++CFLAGS-e_exp.c += -fno-builtin-expf32x -fno-builtin-expf64 ++CFLAGS-w_exp10.c += -fno-builtin-exp10f32x -fno-builtin-exp10f64 ++CFLAGS-e_exp2.c += -fno-builtin-exp2f32x -fno-builtin-exp2f64 ++CFLAGS-s_expm1.c += -fno-builtin-expm1f32x -fno-builtin-expm1f64 ++CFLAGS-s_fabs.c += -fno-builtin-fabsf32x -fno-builtin-fabsf64 ++CFLAGS-s_fadd.c += -fno-builtin-f32addf32x -fno-builtin-f32addf64 ++CFLAGS-s_fdim.c += -fno-builtin-fdimf32x -fno-builtin-fdimf64 ++CFLAGS-s_fdiv.c += -fno-builtin-f32divf32x -fno-builtin-f32divf64 ++CFLAGS-s_ffma.c += -fno-builtin-f32fmaf32x -fno-builtin-f32fmaf64 ++CFLAGS-s_floor.c += -fno-builtin-floorf32x -fno-builtin-floorf64 ++CFLAGS-s_fma.c += -fno-builtin-fmaf32x -fno-builtin-fmaf64 ++CFLAGS-s_fmax.c += -fno-builtin-fmaxf32x -fno-builtin-fmaxf64 ++CFLAGS-s_fmaximum.c += -fno-builtin-fmaximumf32x -fno-builtin-fmaximumf64 ++CFLAGS-s_fmaximum_mag.c += -fno-builtin-fmaximum_magf32x -fno-builtin-fmaximum_magf64 ++CFLAGS-s_fmaximum_mag_num.c += -fno-builtin-fmaximum_mag_numf32x -fno-builtin-fmaximum_mag_numf64 ++CFLAGS-s_fmaximum_num.c += -fno-builtin-fmaximum_numf32x -fno-builtin-fmaximum_numf64 ++CFLAGS-s_fmaxmag.c += -fno-builtin-fmaxmagf32x -fno-builtin-fmaxmagf64 ++CFLAGS-s_fmin.c += -fno-builtin-fminf32x -fno-builtin-fminf64 ++CFLAGS-s_fminimum.c += -fno-builtin-fminimumf32x -fno-builtin-fminimumf64 ++CFLAGS-s_fminimum_mag.c += -fno-builtin-fminimum_magf32x -fno-builtin-fminimum_magf64 ++CFLAGS-s_fminimum_mag_num.c += -fno-builtin-fminimum_mag_numf32x -fno-builtin-fminimum_mag_numf64 ++CFLAGS-s_fminimum_num.c += -fno-builtin-fminimum_numf32x -fno-builtin-fminimum_numf64 ++CFLAGS-s_fminmag.c += -fno-builtin-fminmagf32x -fno-builtin-fminmagf64 ++CFLAGS-w_fmod.c += -fno-builtin-fmodf32x -fno-builtin-fmodf64 ++CFLAGS-s_fmul.c += -fno-builtin-f32mulf32x -fno-builtin-f32mulf64 ++CFLAGS-s_frexp.c += -fno-builtin-frexpf32x -fno-builtin-frexpf64 ++CFLAGS-s_fromfp.c += -fno-builtin-fromfpf32x -fno-builtin-fromfpf64 ++CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxf32x -fno-builtin-fromfpxf64 ++CFLAGS-s_fsqrt.c += -fno-builtin-f32sqrtf32x -fno-builtin-f32sqrtf64 ++CFLAGS-s_fsub.c += -fno-builtin-f32subf32x -fno-builtin-f32subf64 ++CFLAGS-s_getpayload.c += -fno-builtin-getpayloadf32x -fno-builtin-getpayloadf64 ++CFLAGS-w_hypot.c += -fno-builtin-hypotf32x -fno-builtin-hypotf64 ++CFLAGS-w_ilogb.c += -fno-builtin-ilogbf32x -fno-builtin-ilogbf64 ++CFLAGS-w_j0.c += -fno-builtin-j0f32x -fno-builtin-j0f64 ++CFLAGS-w_j1.c += -fno-builtin-j1f32x -fno-builtin-j1f64 ++CFLAGS-w_jn.c += -fno-builtin-jnf32x -fno-builtin-jnf64 ++CFLAGS-s_ldexp.c += -fno-builtin-ldexpf32x -fno-builtin-ldexpf64 ++CFLAGS-w_lgamma.c += -fno-builtin-lgammaf32x -fno-builtin-lgammaf64 ++CFLAGS-w_lgamma_r.c += -fno-builtin-lgammaf32x_r -fno-builtin-lgammaf64_r ++CFLAGS-w_llogb.c += -fno-builtin-llogbf32x -fno-builtin-llogbf64 ++CFLAGS-s_llrint.c += -fno-builtin-llrintf32x -fno-builtin-llrintf64 ++CFLAGS-s_llround.c += -fno-builtin-llroundf32x -fno-builtin-llroundf64 ++CFLAGS-e_log.c += -fno-builtin-logf32x -fno-builtin-logf64 ++CFLAGS-w_log10.c += -fno-builtin-log10f32x -fno-builtin-log10f64 ++CFLAGS-w_log1p.c += -fno-builtin-log1pf32x -fno-builtin-log1pf64 ++CFLAGS-e_log2.c += -fno-builtin-log2f32x -fno-builtin-log2f64 ++CFLAGS-s_logb.c += -fno-builtin-logbf32x -fno-builtin-logbf64 ++CFLAGS-s_lrint.c += -fno-builtin-lrintf32x -fno-builtin-lrintf64 ++CFLAGS-s_lround.c += -fno-builtin-lroundf32x -fno-builtin-lroundf64 ++CFLAGS-s_modf.c += -fno-builtin-modff32x -fno-builtin-modff64 ++CFLAGS-s_nan.c += -fno-builtin-nanf32x -fno-builtin-nanf64 ++CFLAGS-s_nearbyint.c += -fno-builtin-nearbyintf32x -fno-builtin-nearbyintf64 ++CFLAGS-s_nextafter.c += -fno-builtin-nextafterf32x -fno-builtin-nextafterf64 ++CFLAGS-s_nextdown.c += -fno-builtin-nextdownf32x -fno-builtin-nextdownf64 ++CFLAGS-s_nextup.c += -fno-builtin-nextupf32x -fno-builtin-nextupf64 ++CFLAGS-e_pow.c += -fno-builtin-powf32x -fno-builtin-powf64 ++CFLAGS-w_remainder.c += -fno-builtin-remainderf32x -fno-builtin-remainderf64 ++CFLAGS-s_remquo.c += -fno-builtin-remquof32x -fno-builtin-remquof64 ++CFLAGS-s_rint.c += -fno-builtin-rintf32x -fno-builtin-rintf64 ++CFLAGS-s_round.c += -fno-builtin-roundf32x -fno-builtin-roundf64 ++CFLAGS-s_roundeven.c += -fno-builtin-roundevenf32x -fno-builtin-roundevenf64 ++CFLAGS-w_scalbln.c += -fno-builtin-scalblnf32x -fno-builtin-scalblnf64 ++CFLAGS-s_scalbn.c += -fno-builtin-scalbnf32x -fno-builtin-scalbnf64 ++CFLAGS-s_setpayload.c += -fno-builtin-setpayloadf32x -fno-builtin-setpayloadf64 ++CFLAGS-s_setpayloadsig.c += -fno-builtin-setpayloadsigf32x -fno-builtin-setpayloadsigf64 ++CFLAGS-s_sin.c += -fno-builtin-sinf32x -fno-builtin-sinf64 ++CFLAGS-s_sincos.c += -fno-builtin-sincosf32x -fno-builtin-sincosf64 ++CFLAGS-w_sinh.c += -fno-builtin-sinhf32x -fno-builtin-sinhf64 ++CFLAGS-w_sqrt.c += -fno-builtin-sqrtf32x -fno-builtin-sqrtf64 ++CFLAGS-s_tan.c += -fno-builtin-tanf32x -fno-builtin-tanf64 ++CFLAGS-s_tanh.c += -fno-builtin-tanhf32x -fno-builtin-tanhf64 ++CFLAGS-w_tgamma.c += -fno-builtin-tgammaf32x -fno-builtin-tgammaf64 ++CFLAGS-s_totalorder.c += -fno-builtin-totalorderf32x -fno-builtin-totalorderf64 ++CFLAGS-s_totalordermag.c += -fno-builtin-totalordermagf32x -fno-builtin-totalordermagf64 ++CFLAGS-s_trunc.c += -fno-builtin-truncf32x -fno-builtin-truncf64 ++CFLAGS-s_ufromfp.c += -fno-builtin-ufromfpf32x -fno-builtin-ufromfpf64 ++CFLAGS-s_ufromfpx.c += -fno-builtin-ufromfpxf32x -fno-builtin-ufromfpxf64 ++CFLAGS-s_y0.c += -fno-builtin-y0f32x -fno-builtin-y0f64 ++CFLAGS-s_y1.c += -fno-builtin-y1f32x -fno-builtin-y1f64 ++CFLAGS-s_yn.c += -fno-builtin-ynf32x -fno-builtin-ynf64 ++ ++# Likewise, for _Float32 aliases. ++CFLAGS-w_acosf.c += -fno-builtin-acosf32 ++CFLAGS-w_acoshf.c += -fno-builtin-acoshf32 ++CFLAGS-w_asinf.c += -fno-builtin-asinf32 ++CFLAGS-s_asinhf.c += -fno-builtin-asinhf32 ++CFLAGS-s_atanf.c += -fno-builtin-atanf32 ++CFLAGS-w_atan2f.c += -fno-builtin-atan2f32 ++CFLAGS-w_atanhf.c += -fno-builtin-atanhf32 ++CFLAGS-s_cabsf.c += -fno-builtin-cabsf32 ++CFLAGS-s_cacosf.c += -fno-builtin-cacosf32 ++CFLAGS-s_cacoshf.c += -fno-builtin-cacoshf32 ++CFLAGS-s_canonicalizef.c += -fno-builtin-canonicalizef32 ++CFLAGS-s_cargf.c += -fno-builtin-cargf32 ++CFLAGS-s_casinf.c += -fno-builtin-casinf32 ++CFLAGS-s_casinhf.c += -fno-builtin-casinhf32 ++CFLAGS-s_catanf.c += -fno-builtin-catanf32 ++CFLAGS-s_catanhf.c += -fno-builtin-catanhf32 ++CFLAGS-s_cbrtf.c += -fno-builtin-cbrtf32 ++CFLAGS-s_ccosf.c += -fno-builtin-ccosf32 ++CFLAGS-s_ccoshf.c += -fno-builtin-ccoshf32 ++CFLAGS-s_ceilf.c += -fno-builtin-ceilf32 ++CFLAGS-s_cexpf.c += -fno-builtin-cexpf32 ++CFLAGS-s_cimagf.c += -fno-builtin-cimagf32 ++CFLAGS-s_clogf.c += -fno-builtin-clogf32 ++CFLAGS-s_clog10f.c += -fno-builtin-clog10f32 ++CFLAGS-s_conjf.c += -fno-builtin-conjf32 ++CFLAGS-s_copysignf.c += -fno-builtin-copysignf32 ++CFLAGS-s_cosf.c += -fno-builtin-cosf32 ++CFLAGS-w_coshf.c += -fno-builtin-coshf32 ++CFLAGS-s_cpowf.c += -fno-builtin-cpowf32 ++CFLAGS-s_cprojf.c += -fno-builtin-cprojf32 ++CFLAGS-s_crealf.c += -fno-builtin-crealf32 ++CFLAGS-s_csinf.c += -fno-builtin-csinf32 ++CFLAGS-s_csinhf.c += -fno-builtin-csinhf32 ++CFLAGS-s_csqrtf.c += -fno-builtin-csqrtf32 ++CFLAGS-s_ctanf.c += -fno-builtin-ctanf32 ++CFLAGS-s_ctanhf.c += -fno-builtin-ctanhf32 ++CFLAGS-s_erff.c += -fno-builtin-erff32 ++CFLAGS-s_erfcf.c += -fno-builtin-erfcf32 ++CFLAGS-e_expf.c += -fno-builtin-expf32 ++CFLAGS-w_exp10f.c += -fno-builtin-exp10f32 ++CFLAGS-e_exp2f.c += -fno-builtin-exp2f32 ++CFLAGS-s_expm1f.c += -fno-builtin-expm1f32 ++CFLAGS-s_fabsf.c += -fno-builtin-fabsf32 ++CFLAGS-s_fdimf.c += -fno-builtin-fdimf32 ++CFLAGS-s_floorf.c += -fno-builtin-floorf32 ++CFLAGS-s_fmaf.c += -fno-builtin-fmaf32 ++CFLAGS-s_fmaxf.c += -fno-builtin-fmaxf32 ++CFLAGS-s_fmaximumf.c += -fno-builtin-fmaximumf32 ++CFLAGS-s_fmaximum_magf.c += -fno-builtin-fmaximum_magf32 ++CFLAGS-s_fmaximum_mag_numf.c += -fno-builtin-fmaximum_mag_numf32 ++CFLAGS-s_fmaximum_numf.c += -fno-builtin-fmaximum_numf32 ++CFLAGS-s_fmaxmagf.c += -fno-builtin-fmaxmagf32 ++CFLAGS-s_fminf.c += -fno-builtin-fminf32 ++CFLAGS-s_fminimumf.c += -fno-builtin-fminimumf32 ++CFLAGS-s_fminimum_magf.c += -fno-builtin-fminimum_magf32 ++CFLAGS-s_fminimum_mag_numf.c += -fno-builtin-fminimum_mag_numf32 ++CFLAGS-s_fminimum_numf.c += -fno-builtin-fminimum_numf32 ++CFLAGS-s_fminmagf.c += -fno-builtin-fminmagf32 ++CFLAGS-w_fmodf.c += -fno-builtin-fmodf32 ++CFLAGS-s_frexpf.c += -fno-builtin-frexpf32 ++CFLAGS-s_fromfpf.c += -fno-builtin-fromfpf32 ++CFLAGS-s_fromfpxf.c += -fno-builtin-fromfpxf32 ++CFLAGS-s_getpayloadf.c += -fno-builtin-getpayloadf32 ++CFLAGS-w_hypotf.c += -fno-builtin-hypotf32 ++CFLAGS-w_ilogbf.c += -fno-builtin-ilogbf32 ++CFLAGS-w_j0f.c += -fno-builtin-j0f32 ++CFLAGS-w_j1f.c += -fno-builtin-j1f32 ++CFLAGS-w_jnf.c += -fno-builtin-jnf32 ++CFLAGS-s_ldexpf.c += -fno-builtin-ldexpf32 ++CFLAGS-w_lgammaf.c += -fno-builtin-lgammaf32 ++CFLAGS-w_lgammaf_r.c += -fno-builtin-lgammaf32_r ++CFLAGS-w_llogbf.c += -fno-builtin-llogbf32 ++CFLAGS-s_llrintf.c += -fno-builtin-llrintf32 ++CFLAGS-s_llroundf.c += -fno-builtin-llroundf32 ++CFLAGS-e_logf.c += -fno-builtin-logf32 ++CFLAGS-w_log10f.c += -fno-builtin-log10f32 ++CFLAGS-w_log1pf.c += -fno-builtin-log1pf32 ++CFLAGS-e_log2f.c += -fno-builtin-log2f32 ++CFLAGS-s_logbf.c += -fno-builtin-logbf32 ++CFLAGS-s_lrintf.c += -fno-builtin-lrintf32 ++CFLAGS-s_lroundf.c += -fno-builtin-lroundf32 ++CFLAGS-s_modff.c += -fno-builtin-modff32 ++CFLAGS-s_nanf.c += -fno-builtin-nanf32 ++CFLAGS-s_nearbyintf.c += -fno-builtin-nearbyintf32 ++CFLAGS-s_nextafterf.c += -fno-builtin-nextafterf32 ++CFLAGS-s_nextdownf.c += -fno-builtin-nextdownf32 ++CFLAGS-s_nextupf.c += -fno-builtin-nextupf32 ++CFLAGS-e_powf.c += -fno-builtin-powf32 ++CFLAGS-w_remainderf.c += -fno-builtin-remainderf32 ++CFLAGS-s_remquof.c += -fno-builtin-remquof32 ++CFLAGS-s_rintf.c += -fno-builtin-rintf32 ++CFLAGS-s_roundf.c += -fno-builtin-roundf32 ++CFLAGS-s_roundevenf.c += -fno-builtin-roundevenf32 ++CFLAGS-w_scalblnf.c += -fno-builtin-scalblnf32 ++CFLAGS-s_scalbnf.c += -fno-builtin-scalbnf32 ++CFLAGS-s_setpayloadf.c += -fno-builtin-setpayloadf32 ++CFLAGS-s_setpayloadsigf.c += -fno-builtin-setpayloadsigf32 ++CFLAGS-s_sinf.c += -fno-builtin-sinf32 ++CFLAGS-s_sincosf.c += -fno-builtin-sincosf32 ++CFLAGS-w_sinhf.c += -fno-builtin-sinhf32 ++CFLAGS-w_sqrtf.c += -fno-builtin-sqrtf32 ++CFLAGS-s_tanf.c += -fno-builtin-tanf32 ++CFLAGS-s_tanhf.c += -fno-builtin-tanhf32 ++CFLAGS-w_tgammaf.c += -fno-builtin-tgammaf32 ++CFLAGS-s_totalorderf.c += -fno-builtin-totalorderf32 ++CFLAGS-s_totalordermagf.c += -fno-builtin-totalordermagf32 ++CFLAGS-s_truncf.c += -fno-builtin-truncf32 ++CFLAGS-s_ufromfpf.c += -fno-builtin-ufromfpf32 ++CFLAGS-s_ufromfpxf.c += -fno-builtin-ufromfpxf32 ++CFLAGS-s_y0f.c += -fno-builtin-y0f32 ++CFLAGS-s_y1f.c += -fno-builtin-y1f32 ++CFLAGS-s_ynf.c += -fno-builtin-ynf32 ++ + # These files quiet sNaNs in a way that is optimized away without + # -fsignaling-nans. + CFLAGS-s_modf.c += -fsignaling-nans +diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile +index 571a841809234edd..f869e80f268ba446 100644 +--- a/sysdeps/ieee754/float128/Makefile ++++ b/sysdeps/ieee754/float128/Makefile +@@ -10,3 +10,130 @@ endif + ifeq ($(subdir),wcsmbs) + routines += wcstof128_l wcstof128 wcstof128_nan + endif ++ ++ifeq ($(subdir),math) ++CFLAGS-w_acosf128.c += -fno-builtin-acosf64x ++CFLAGS-w_acoshf128.c += -fno-builtin-acoshf64x ++CFLAGS-w_asinf128.c += -fno-builtin-asinf64x ++CFLAGS-s_asinhf128.c += -fno-builtin-asinhf64x ++CFLAGS-s_atanf128.c += -fno-builtin-atanf64x ++CFLAGS-w_atan2f128.c += -fno-builtin-atan2f64x ++CFLAGS-w_atanhf128.c += -fno-builtin-atanhf64x ++CFLAGS-s_cabsf128.c += -fno-builtin-cabsf64x ++CFLAGS-s_cacosf128.c += -fno-builtin-cacosf64x ++CFLAGS-s_cacoshf128.c += -fno-builtin-cacoshf64x ++CFLAGS-s_canonicalizef128.c += -fno-builtin-canonicalizef64x ++CFLAGS-s_cargf128.c += -fno-builtin-cargf64x ++CFLAGS-s_casinf128.c += -fno-builtin-casinf64x ++CFLAGS-s_casinhf128.c += -fno-builtin-casinhf64x ++CFLAGS-s_catanf128.c += -fno-builtin-catanf64x ++CFLAGS-s_catanhf128.c += -fno-builtin-catanhf64x ++CFLAGS-s_cbrtf128.c += -fno-builtin-cbrtf64x ++CFLAGS-s_ccosf128.c += -fno-builtin-ccosf64x ++CFLAGS-s_ccoshf128.c += -fno-builtin-ccoshf64x ++CFLAGS-s_ceilf128.c += -fno-builtin-ceilf64x ++CFLAGS-s_cexpf128.c += -fno-builtin-cexpf64x ++CFLAGS-s_cimagf128.c += -fno-builtin-cimagf64x ++CFLAGS-s_clogf128.c += -fno-builtin-clogf64x ++CFLAGS-s_clog10f128.c += -fno-builtin-clog10f64x ++CFLAGS-s_conjf128.c += -fno-builtin-conjf64x ++CFLAGS-s_copysignf128.c += -fno-builtin-copysignf64x ++CFLAGS-s_cosf128.c += -fno-builtin-cosf64x ++CFLAGS-w_coshf128.c += -fno-builtin-coshf64x ++CFLAGS-s_cpowf128.c += -fno-builtin-cpowf64x ++CFLAGS-s_cprojf128.c += -fno-builtin-cprojf64x ++CFLAGS-s_crealf128.c += -fno-builtin-crealf64x ++CFLAGS-s_csinf128.c += -fno-builtin-csinf64x ++CFLAGS-s_csinhf128.c += -fno-builtin-csinhf64x ++CFLAGS-s_csqrtf128.c += -fno-builtin-csqrtf64x ++CFLAGS-s_ctanf128.c += -fno-builtin-ctanf64x ++CFLAGS-s_ctanhf128.c += -fno-builtin-ctanhf64x ++CFLAGS-s_daddf128.c += -fno-builtin-f64addf64x ++CFLAGS-s_ddivf128.c += -fno-builtin-f64divf64x ++CFLAGS-s_dfmaf128.c += -fno-builtin-f64fmaf64x ++CFLAGS-s_dmulf128.c += -fno-builtin-f64mulf64x ++CFLAGS-s_dsqrtf128.c += -fno-builtin-f64sqrtf64x ++CFLAGS-s_dsubf128.c += -fno-builtin-f64subf64x ++CFLAGS-s_erff128.c += -fno-builtin-erff64x ++CFLAGS-s_erfcf128.c += -fno-builtin-erfcf64x ++CFLAGS-e_expf128.c += -fno-builtin-expf64x ++CFLAGS-w_exp10f128.c += -fno-builtin-exp10f64x ++CFLAGS-e_exp2f128.c += -fno-builtin-exp2f64x ++CFLAGS-s_expm1f128.c += -fno-builtin-expm1f64x ++CFLAGS-s_fabsf128.c += -fno-builtin-fabsf64x ++CFLAGS-s_faddf128.c += -fno-builtin-f32addf64x ++CFLAGS-s_fdimf128.c += -fno-builtin-fdimf64x ++CFLAGS-s_fdivf128.c += -fno-builtin-f32divf64x ++CFLAGS-s_ffmaf128.c += -fno-builtin-f32fmaf64x ++CFLAGS-s_floorf128.c += -fno-builtin-floorf64x ++CFLAGS-s_fmaf128.c += -fno-builtin-fmaf64x ++CFLAGS-s_fmaxf128.c += -fno-builtin-fmaxf64x ++CFLAGS-s_fmaximumf128.c += -fno-builtin-fmaximumf64x ++CFLAGS-s_fmaximum_magf128.c += -fno-builtin-fmaximum_magf64x ++CFLAGS-s_fmaximum_mag_numf128.c += -fno-builtin-fmaximum_mag_numf64x ++CFLAGS-s_fmaximum_numf128.c += -fno-builtin-fmaximum_numf64x ++CFLAGS-s_fmaxmagf128.c += -fno-builtin-fmaxmagf64x ++CFLAGS-s_fminf128.c += -fno-builtin-fminf64x ++CFLAGS-s_fminimumf128.c += -fno-builtin-fminimumf64x ++CFLAGS-s_fminimum_magf128.c += -fno-builtin-fminimum_magf64x ++CFLAGS-s_fminimum_mag_numf128.c += -fno-builtin-fminimum_mag_numf64x ++CFLAGS-s_fminimum_numf128.c += -fno-builtin-fminimum_numf64x ++CFLAGS-s_fminmagf128.c += -fno-builtin-fminmagf64x ++CFLAGS-w_fmodf128.c += -fno-builtin-fmodf64x ++CFLAGS-s_fmulf128.c += -fno-builtin-f32mulf64x ++CFLAGS-s_frexpf128.c += -fno-builtin-frexpf64x ++CFLAGS-s_fromfpf128.c += -fno-builtin-fromfpf64x ++CFLAGS-s_fromfpxf128.c += -fno-builtin-fromfpxf64x ++CFLAGS-s_fsqrtf128.c += -fno-builtin-f32sqrtf64x ++CFLAGS-s_fsubf128.c += -fno-builtin-f32subf64x ++CFLAGS-s_getpayloadf128.c += -fno-builtin-getpayloadf64x ++CFLAGS-w_hypotf128.c += -fno-builtin-hypotf64x ++CFLAGS-w_ilogbf128.c += -fno-builtin-ilogbf64x ++CFLAGS-w_j0f128.c += -fno-builtin-j0f64x ++CFLAGS-w_j1f128.c += -fno-builtin-j1f64x ++CFLAGS-w_jnf128.c += -fno-builtin-jnf64x ++CFLAGS-s_ldexpf128.c += -fno-builtin-ldexpf64x ++CFLAGS-w_lgammaf128.c += -fno-builtin-lgammaf64x ++CFLAGS-w_lgammaf128_r.c += -fno-builtin-lgammaf64x_r ++CFLAGS-w_llogbf128.c += -fno-builtin-llogbf64x ++CFLAGS-s_llrintf128.c += -fno-builtin-llrintf64x ++CFLAGS-s_llroundf128.c += -fno-builtin-llroundf64x ++CFLAGS-e_logf128.c += -fno-builtin-logf64x ++CFLAGS-w_log10f128.c += -fno-builtin-log10f64x ++CFLAGS-w_log1pf128.c += -fno-builtin-log1pf64x ++CFLAGS-e_log2f128.c += -fno-builtin-log2f64x ++CFLAGS-s_logbf128.c += -fno-builtin-logbf64x ++CFLAGS-s_lrintf128.c += -fno-builtin-lrintf64x ++CFLAGS-s_lroundf128.c += -fno-builtin-lroundf64x ++CFLAGS-s_modff128.c += -fno-builtin-modff64x ++CFLAGS-s_nanf128.c += -fno-builtin-nanf64x ++CFLAGS-s_nearbyintf128.c += -fno-builtin-nearbyintf64x ++CFLAGS-s_nextafterf128.c += -fno-builtin-nextafterf64x ++CFLAGS-s_nextdownf128.c += -fno-builtin-nextdownf64x ++CFLAGS-s_nextupf128.c += -fno-builtin-nextupf64x ++CFLAGS-e_powf128.c += -fno-builtin-powf64x ++CFLAGS-w_remainderf128.c += -fno-builtin-remainderf64x ++CFLAGS-s_remquof128.c += -fno-builtin-remquof64x ++CFLAGS-s_rintf128.c += -fno-builtin-rintf64x ++CFLAGS-s_roundf128.c += -fno-builtin-roundf64x ++CFLAGS-s_roundevenf128.c += -fno-builtin-roundevenf64x ++CFLAGS-w_scalblnf128.c += -fno-builtin-scalblnf64x ++CFLAGS-s_scalbnf128.c += -fno-builtin-scalbnf64x ++CFLAGS-s_setpayloadf128.c += -fno-builtin-setpayloadf64x ++CFLAGS-s_setpayloadsigf128.c += -fno-builtin-setpayloadsigf64x ++CFLAGS-s_sinf128.c += -fno-builtin-sinf64x ++CFLAGS-s_sincosf128.c += -fno-builtin-sincosf64x ++CFLAGS-w_sinhf128.c += -fno-builtin-sinhf64x ++CFLAGS-w_sqrtf128.c += -fno-builtin-sqrtf64x ++CFLAGS-s_tanf128.c += -fno-builtin-tanf64x ++CFLAGS-s_tanhf128.c += -fno-builtin-tanhf64x ++CFLAGS-w_tgammaf128.c += -fno-builtin-tgammaf64x ++CFLAGS-s_totalorderf128.c += -fno-builtin-totalorderf64x ++CFLAGS-s_totalordermagf128.c += -fno-builtin-totalordermagf64x ++CFLAGS-s_truncf128.c += -fno-builtin-truncf64x ++CFLAGS-s_ufromfpf128.c += -fno-builtin-ufromfpf64x ++CFLAGS-s_ufromfpxf128.c += -fno-builtin-ufromfpxf64x ++CFLAGS-s_y0f128.c += -fno-builtin-y0f64x ++CFLAGS-s_y1f128.c += -fno-builtin-y1f64x ++CFLAGS-s_ynf128.c += -fno-builtin-ynf64x ++endif +diff --git a/sysdeps/ieee754/ldbl-128/Makefile b/sysdeps/ieee754/ldbl-128/Makefile +index 8fd6dad343bde2c9..9cbfc7ff6e8cd6f7 100644 +--- a/sysdeps/ieee754/ldbl-128/Makefile ++++ b/sysdeps/ieee754/ldbl-128/Makefile +@@ -1 +1,128 @@ + long-double-fcts = yes ++ ++ifeq ($(subdir),math) ++CFLAGS-w_acosl.c += -fno-builtin-acosf64x -fno-builtin-acosf128 ++CFLAGS-w_acoshl.c += -fno-builtin-acoshf64x -fno-builtin-acoshf128 ++CFLAGS-w_asinl.c += -fno-builtin-asinf64x -fno-builtin-asinf128 ++CFLAGS-s_asinhl.c += -fno-builtin-asinhf64x -fno-builtin-asinhf128 ++CFLAGS-s_atanl.c += -fno-builtin-atanf64x -fno-builtin-atanf128 ++CFLAGS-w_atan2l.c += -fno-builtin-atan2f64x -fno-builtin-atan2f128 ++CFLAGS-w_atanhl.c += -fno-builtin-atanhf64x -fno-builtin-atanhf128 ++CFLAGS-s_cabsl.c += -fno-builtin-cabsf64x -fno-builtin-cabsf128 ++CFLAGS-s_cacosl.c += -fno-builtin-cacosf64x -fno-builtin-cacosf128 ++CFLAGS-s_cacoshl.c += -fno-builtin-cacoshf64x -fno-builtin-cacoshf128 ++CFLAGS-s_canonicalizel.c += -fno-builtin-canonicalizef64x -fno-builtin-canonicalizef128 ++CFLAGS-s_cargl.c += -fno-builtin-cargf64x -fno-builtin-cargf128 ++CFLAGS-s_casinl.c += -fno-builtin-casinf64x -fno-builtin-casinf128 ++CFLAGS-s_casinhl.c += -fno-builtin-casinhf64x -fno-builtin-casinhf128 ++CFLAGS-s_catanl.c += -fno-builtin-catanf64x -fno-builtin-catanf128 ++CFLAGS-s_catanhl.c += -fno-builtin-catanhf64x -fno-builtin-catanhf128 ++CFLAGS-s_cbrtl.c += -fno-builtin-cbrtf64x -fno-builtin-cbrtf128 ++CFLAGS-s_ccosl.c += -fno-builtin-ccosf64x -fno-builtin-ccosf128 ++CFLAGS-s_ccoshl.c += -fno-builtin-ccoshf64x -fno-builtin-ccoshf128 ++CFLAGS-s_ceill.c += -fno-builtin-ceilf64x -fno-builtin-ceilf128 ++CFLAGS-s_cexpl.c += -fno-builtin-cexpf64x -fno-builtin-cexpf128 ++CFLAGS-s_cimagl.c += -fno-builtin-cimagf64x -fno-builtin-cimagf128 ++CFLAGS-s_clogl.c += -fno-builtin-clogf64x -fno-builtin-clogf128 ++CFLAGS-s_clog10l.c += -fno-builtin-clog10f64x -fno-builtin-clog10f128 ++CFLAGS-s_conjl.c += -fno-builtin-conjf64x -fno-builtin-conjf128 ++CFLAGS-s_copysignl.c += -fno-builtin-copysignf64x -fno-builtin-copysignf128 ++CFLAGS-s_cosl.c += -fno-builtin-cosf64x -fno-builtin-cosf128 ++CFLAGS-w_coshl.c += -fno-builtin-coshf64x -fno-builtin-coshf128 ++CFLAGS-s_cpowl.c += -fno-builtin-cpowf64x -fno-builtin-cpowf128 ++CFLAGS-s_cprojl.c += -fno-builtin-cprojf64x -fno-builtin-cprojf128 ++CFLAGS-s_creall.c += -fno-builtin-crealf64x -fno-builtin-crealf128 ++CFLAGS-s_csinl.c += -fno-builtin-csinf64x -fno-builtin-csinf128 ++CFLAGS-s_csinhl.c += -fno-builtin-csinhf64x -fno-builtin-csinhf128 ++CFLAGS-s_csqrtl.c += -fno-builtin-csqrtf64x -fno-builtin-csqrtf128 ++CFLAGS-s_ctanl.c += -fno-builtin-ctanf64x -fno-builtin-ctanf128 ++CFLAGS-s_ctanhl.c += -fno-builtin-ctanhf64x -fno-builtin-ctanhf128 ++CFLAGS-s_daddl.c += -fno-builtin-f64addf64x -fno-builtin-f64addf128 ++CFLAGS-s_ddivl.c += -fno-builtin-f64divf64x -fno-builtin-f64divf128 ++CFLAGS-s_dfmal.c += -fno-builtin-f64fmaf64x -fno-builtin-f64fmaf128 ++CFLAGS-s_dmull.c += -fno-builtin-f64mulf64x -fno-builtin-f64mulf128 ++CFLAGS-s_dsqrtl.c += -fno-builtin-f64sqrtf64x -fno-builtin-f64sqrtf128 ++CFLAGS-s_dsubl.c += -fno-builtin-f64subf64x -fno-builtin-f64subf128 ++CFLAGS-s_erfl.c += -fno-builtin-erff64x -fno-builtin-erff128 ++CFLAGS-s_erfcl.c += -fno-builtin-erfcf64x -fno-builtin-erfcf128 ++CFLAGS-e_expl.c += -fno-builtin-expf64x -fno-builtin-expf128 ++CFLAGS-w_exp10l.c += -fno-builtin-exp10f64x -fno-builtin-exp10f128 ++CFLAGS-e_exp2l.c += -fno-builtin-exp2f64x -fno-builtin-exp2f128 ++CFLAGS-s_expm1l.c += -fno-builtin-expm1f64x -fno-builtin-expm1f128 ++CFLAGS-s_fabsl.c += -fno-builtin-fabsf64x -fno-builtin-fabsf128 ++CFLAGS-s_faddl.c += -fno-builtin-f32addf64x -fno-builtin-f32addf128 ++CFLAGS-s_fdiml.c += -fno-builtin-fdimf64x -fno-builtin-fdimf128 ++CFLAGS-s_fdivl.c += -fno-builtin-f32divf64x -fno-builtin-f32divf128 ++CFLAGS-s_ffmal.c += -fno-builtin-f32fmaf64x -fno-builtin-f32fmaf128 ++CFLAGS-s_floorl.c += -fno-builtin-floorf64x -fno-builtin-floorf128 ++CFLAGS-s_fmal.c += -fno-builtin-fmaf64x -fno-builtin-fmaf128 ++CFLAGS-s_fmaxl.c += -fno-builtin-fmaxf64x -fno-builtin-fmaxf128 ++CFLAGS-s_fmaximuml.c += -fno-builtin-fmaximumf64x -fno-builtin-fmaximumf128 ++CFLAGS-s_fmaximum_magl.c += -fno-builtin-fmaximum_magf64x -fno-builtin-fmaximum_magf128 ++CFLAGS-s_fmaximum_mag_numl.c += -fno-builtin-fmaximum_mag_numf64x -fno-builtin-fmaximum_mag_numf128 ++CFLAGS-s_fmaximum_numl.c += -fno-builtin-fmaximum_numf64x -fno-builtin-fmaximum_numf128 ++CFLAGS-s_fmaxmagl.c += -fno-builtin-fmaxmagf64x -fno-builtin-fmaxmagf128 ++CFLAGS-s_fminl.c += -fno-builtin-fminf64x -fno-builtin-fminf128 ++CFLAGS-s_fminimuml.c += -fno-builtin-fminimumf64x -fno-builtin-fminimumf128 ++CFLAGS-s_fminimum_magl.c += -fno-builtin-fminimum_magf64x -fno-builtin-fminimum_magf128 ++CFLAGS-s_fminimum_mag_numl.c += -fno-builtin-fminimum_mag_numf64x -fno-builtin-fminimum_mag_numf128 ++CFLAGS-s_fminimum_numl.c += -fno-builtin-fminimum_numf64x -fno-builtin-fminimum_numf128 ++CFLAGS-s_fminmagl.c += -fno-builtin-fminmagf64x -fno-builtin-fminmagf128 ++CFLAGS-w_fmodl.c += -fno-builtin-fmodf64x -fno-builtin-fmodf128 ++CFLAGS-s_fmull.c += -fno-builtin-f32mulf64x -fno-builtin-f32mulf128 ++CFLAGS-s_frexpl.c += -fno-builtin-frexpf64x -fno-builtin-frexpf128 ++CFLAGS-s_fromfpl.c += -fno-builtin-fromfpf64x -fno-builtin-fromfpf128 ++CFLAGS-s_fromfpxl.c += -fno-builtin-fromfpxf64x -fno-builtin-fromfpxf128 ++CFLAGS-s_fsqrtl.c += -fno-builtin-f32sqrtf64x -fno-builtin-f32sqrtf128 ++CFLAGS-s_fsubl.c += -fno-builtin-f32subf64x -fno-builtin-f32subf128 ++CFLAGS-s_getpayloadl.c += -fno-builtin-getpayloadf64x -fno-builtin-getpayloadf128 ++CFLAGS-w_hypotl.c += -fno-builtin-hypotf64x -fno-builtin-hypotf128 ++CFLAGS-w_ilogbl.c += -fno-builtin-ilogbf64x -fno-builtin-ilogbf128 ++CFLAGS-w_j0l.c += -fno-builtin-j0f64x -fno-builtin-j0f128 ++CFLAGS-w_j1l.c += -fno-builtin-j1f64x -fno-builtin-j1f128 ++CFLAGS-w_jnl.c += -fno-builtin-jnf64x -fno-builtin-jnf128 ++CFLAGS-s_ldexpl.c += -fno-builtin-ldexpf64x -fno-builtin-ldexpf128 ++CFLAGS-w_lgammal.c += -fno-builtin-lgammaf64x -fno-builtin-lgammaf128 ++CFLAGS-w_lgammal_r.c += -fno-builtin-lgammaf64x_r ++CFLAGS-w_llogbl.c += -fno-builtin-llogbf64x -fno-builtin-llogbf128 ++CFLAGS-s_llrintl.c += -fno-builtin-llrintf64x -fno-builtin-llrintf128 ++CFLAGS-s_llroundl.c += -fno-builtin-llroundf64x -fno-builtin-llroundf128 ++CFLAGS-e_logl.c += -fno-builtin-logf64x -fno-builtin-logf128 ++CFLAGS-w_log10l.c += -fno-builtin-log10f64x -fno-builtin-log10f128 ++CFLAGS-w_log1pl.c += -fno-builtin-log1pf64x -fno-builtin-log1pf128 ++CFLAGS-e_log2l.c += -fno-builtin-log2f64x -fno-builtin-log2f128 ++CFLAGS-s_logbl.c += -fno-builtin-logbf64x -fno-builtin-logbf128 ++CFLAGS-s_lrintl.c += -fno-builtin-lrintf64x -fno-builtin-lrintf128 ++CFLAGS-s_lroundl.c += -fno-builtin-lroundf64x -fno-builtin-lroundf128 ++CFLAGS-s_modfl.c += -fno-builtin-modff64x -fno-builtin-modff128 ++CFLAGS-s_nanl.c += -fno-builtin-nanf64x -fno-builtin-nanf128 ++CFLAGS-s_nearbyintl.c += -fno-builtin-nearbyintf64x -fno-builtin-nearbyintf128 ++CFLAGS-s_nextafterl.c += -fno-builtin-nextafterf64x -fno-builtin-nextafterf128 ++CFLAGS-s_nextdownl.c += -fno-builtin-nextdownf64x -fno-builtin-nextdownf128 ++CFLAGS-s_nextupl.c += -fno-builtin-nextupf64x -fno-builtin-nextupf128 ++CFLAGS-e_powl.c += -fno-builtin-powf64x -fno-builtin-powf128 ++CFLAGS-w_remainderl.c += -fno-builtin-remainderf64x -fno-builtin-remainderf128 ++CFLAGS-s_remquol.c += -fno-builtin-remquof64x -fno-builtin-remquof128 ++CFLAGS-s_rintl.c += -fno-builtin-rintf64x -fno-builtin-rintf128 ++CFLAGS-s_roundl.c += -fno-builtin-roundf64x -fno-builtin-roundf128 ++CFLAGS-s_roundevenl.c += -fno-builtin-roundevenf64x -fno-builtin-roundevenf128 ++CFLAGS-w_scalblnl.c += -fno-builtin-scalblnf64x -fno-builtin-scalblnf128 ++CFLAGS-s_scalbnl.c += -fno-builtin-scalbnf64x -fno-builtin-scalbnf128 ++CFLAGS-s_setpayloadl.c += -fno-builtin-setpayloadf64x -fno-builtin-setpayloadf128 ++CFLAGS-s_setpayloadsigl.c += -fno-builtin-setpayloadsigf64x -fno-builtin-setpayloadsigf128 ++CFLAGS-s_sinl.c += -fno-builtin-sinf64x -fno-builtin-sinf128 ++CFLAGS-s_sincosl.c += -fno-builtin-sincosf64x -fno-builtin-sincosf128 ++CFLAGS-w_sinhl.c += -fno-builtin-sinhf64x -fno-builtin-sinhf128 ++CFLAGS-w_sqrtl.c += -fno-builtin-sqrtf64x -fno-builtin-sqrtf128 ++CFLAGS-s_tanl.c += -fno-builtin-tanf64x -fno-builtin-tanf128 ++CFLAGS-s_tanhl.c += -fno-builtin-tanhf64x -fno-builtin-tanhf128 ++CFLAGS-w_tgammal.c += -fno-builtin-tgammaf64x -fno-builtin-tgammaf128 ++CFLAGS-s_totalorderl.c += -fno-builtin-totalorderf64x -fno-builtin-totalorderf128 ++CFLAGS-s_totalordermagl.c += -fno-builtin-totalordermagf64x -fno-builtin-totalordermagf128 ++CFLAGS-s_truncl.c += -fno-builtin-truncf64x -fno-builtin-truncf128 ++CFLAGS-s_ufromfpl.c += -fno-builtin-ufromfpf64x -fno-builtin-ufromfpf128 ++CFLAGS-s_ufromfpxl.c += -fno-builtin-ufromfpxf64x -fno-builtin-ufromfpxf128 ++CFLAGS-s_y0l.c += -fno-builtin-y0f64x -fno-builtin-y0f128 ++CFLAGS-s_y1l.c += -fno-builtin-y1f64x -fno-builtin-y1f128 ++CFLAGS-s_ynl.c += -fno-builtin-ynf64x -fno-builtin-ynf128 ++endif +diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile +index 75aed7ae6ca217ed..f28f91fa6a1e61a7 100644 +--- a/sysdeps/ieee754/ldbl-96/Makefile ++++ b/sysdeps/ieee754/ldbl-96/Makefile +@@ -21,4 +21,130 @@ tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 test-sinl-pseudo + ifeq ($(have-ssp),yes) + CFLAGS-test-sinl-pseudo.c += -fstack-protector-all + endif ++ ++CFLAGS-w_acosl.c += -fno-builtin-acosf64x ++CFLAGS-w_acoshl.c += -fno-builtin-acoshf64x ++CFLAGS-w_asinl.c += -fno-builtin-asinf64x ++CFLAGS-s_asinhl.c += -fno-builtin-asinhf64x ++CFLAGS-s_atanl.c += -fno-builtin-atanf64x ++CFLAGS-w_atan2l.c += -fno-builtin-atan2f64x ++CFLAGS-w_atanhl.c += -fno-builtin-atanhf64x ++CFLAGS-s_cabsl.c += -fno-builtin-cabsf64x ++CFLAGS-s_cacosl.c += -fno-builtin-cacosf64x ++CFLAGS-s_cacoshl.c += -fno-builtin-cacoshf64x ++CFLAGS-s_canonicalizel.c += -fno-builtin-canonicalizef64x ++CFLAGS-s_cargl.c += -fno-builtin-cargf64x ++CFLAGS-s_casinl.c += -fno-builtin-casinf64x ++CFLAGS-s_casinhl.c += -fno-builtin-casinhf64x ++CFLAGS-s_catanl.c += -fno-builtin-catanf64x ++CFLAGS-s_catanhl.c += -fno-builtin-catanhf64x ++CFLAGS-s_cbrtl.c += -fno-builtin-cbrtf64x ++CFLAGS-s_ccosl.c += -fno-builtin-ccosf64x ++CFLAGS-s_ccoshl.c += -fno-builtin-ccoshf64x ++CFLAGS-s_ceill.c += -fno-builtin-ceilf64x ++CFLAGS-s_cexpl.c += -fno-builtin-cexpf64x ++CFLAGS-s_cimagl.c += -fno-builtin-cimagf64x ++CFLAGS-s_clogl.c += -fno-builtin-clogf64x ++CFLAGS-s_clog10l.c += -fno-builtin-clog10f64x ++CFLAGS-s_conjl.c += -fno-builtin-conjf64x ++CFLAGS-s_copysignl.c += -fno-builtin-copysignf64x ++CFLAGS-s_cosl.c += -fno-builtin-cosf64x ++CFLAGS-w_coshl.c += -fno-builtin-coshf64x ++CFLAGS-s_cpowl.c += -fno-builtin-cpowf64x ++CFLAGS-s_cprojl.c += -fno-builtin-cprojf64x ++CFLAGS-s_creall.c += -fno-builtin-crealf64x ++CFLAGS-s_csinl.c += -fno-builtin-csinf64x ++CFLAGS-s_csinhl.c += -fno-builtin-csinhf64x ++CFLAGS-s_csqrtl.c += -fno-builtin-csqrtf64x ++CFLAGS-s_ctanl.c += -fno-builtin-ctanf64x ++CFLAGS-s_ctanhl.c += -fno-builtin-ctanhf64x ++CFLAGS-s_daddl.c += -fno-builtin-f64addf64x ++CFLAGS-s_ddivl.c += -fno-builtin-f64divf64x ++CFLAGS-s_dfmal.c += -fno-builtin-f64fmaf64x ++CFLAGS-s_dmull.c += -fno-builtin-f64mulf64x ++CFLAGS-s_dsqrtl.c += -fno-builtin-f64sqrtf64x ++CFLAGS-s_dsubl.c += -fno-builtin-f64subf64x ++CFLAGS-s_erfl.c += -fno-builtin-erff64x ++CFLAGS-s_erfcl.c += -fno-builtin-erfcf64x ++CFLAGS-e_expl.c += -fno-builtin-expf64x ++CFLAGS-w_exp10l.c += -fno-builtin-exp10f64x ++CFLAGS-e_exp2l.c += -fno-builtin-exp2f64x ++CFLAGS-s_expm1l.c += -fno-builtin-expm1f64x ++CFLAGS-s_fabsl.c += -fno-builtin-fabsf64x ++CFLAGS-s_faddl.c += -fno-builtin-f32addf64x ++CFLAGS-s_fdiml.c += -fno-builtin-fdimf64x ++CFLAGS-s_fdivl.c += -fno-builtin-f32divf64x ++CFLAGS-s_ffmal.c += -fno-builtin-f32fmaf64x ++CFLAGS-s_floorl.c += -fno-builtin-floorf64x ++CFLAGS-s_fmal.c += -fno-builtin-fmaf64x ++CFLAGS-s_fmaxl.c += -fno-builtin-fmaxf64x ++CFLAGS-s_fmaximuml.c += -fno-builtin-fmaximumf64x ++CFLAGS-s_fmaximum_magl.c += -fno-builtin-fmaximum_magf64x ++CFLAGS-s_fmaximum_mag_numl.c += -fno-builtin-fmaximum_mag_numf64x ++CFLAGS-s_fmaximum_numl.c += -fno-builtin-fmaximum_numf64x ++CFLAGS-s_fmaxmagl.c += -fno-builtin-fmaxmagf64x ++CFLAGS-s_fminl.c += -fno-builtin-fminf64x ++CFLAGS-s_fminimuml.c += -fno-builtin-fminimumf64x ++CFLAGS-s_fminimum_magl.c += -fno-builtin-fminimum_magf64x ++CFLAGS-s_fminimum_mag_numl.c += -fno-builtin-fminimum_mag_numf64x ++CFLAGS-s_fminimum_numl.c += -fno-builtin-fminimum_numf64x ++CFLAGS-s_fminmagl.c += -fno-builtin-fminmagf64x ++CFLAGS-w_fmodl.c += -fno-builtin-fmodf64x ++CFLAGS-s_fmull.c += -fno-builtin-f32mulf64x ++CFLAGS-s_frexpl.c += -fno-builtin-frexpf64x ++CFLAGS-s_fromfpl.c += -fno-builtin-fromfpf64x ++CFLAGS-s_fromfpxl.c += -fno-builtin-fromfpxf64x ++CFLAGS-s_fsqrtl.c += -fno-builtin-f32sqrtf64x ++CFLAGS-s_fsubl.c += -fno-builtin-f32subf64x ++CFLAGS-s_getpayloadl.c += -fno-builtin-getpayloadf64x ++CFLAGS-w_hypotl.c += -fno-builtin-hypotf64x ++CFLAGS-w_ilogbl.c += -fno-builtin-ilogbf64x ++CFLAGS-w_j0l.c += -fno-builtin-j0f64x ++CFLAGS-w_j1l.c += -fno-builtin-j1f64x ++CFLAGS-w_jnl.c += -fno-builtin-jnf64x ++CFLAGS-s_ldexpl.c += -fno-builtin-ldexpf64x ++CFLAGS-w_lgammal.c += -fno-builtin-lgammaf64x ++CFLAGS-w_lgammal_r.c += -fno-builtin-lgammaf64x_r ++CFLAGS-w_llogbl.c += -fno-builtin-llogbf64x ++CFLAGS-s_llrintl.c += -fno-builtin-llrintf64x ++CFLAGS-s_llroundl.c += -fno-builtin-llroundf64x ++CFLAGS-e_logl.c += -fno-builtin-logf64x ++CFLAGS-w_log10l.c += -fno-builtin-log10f64x ++CFLAGS-w_log1pl.c += -fno-builtin-log1pf64x ++CFLAGS-e_log2l.c += -fno-builtin-log2f64x ++CFLAGS-s_logbl.c += -fno-builtin-logbf64x ++CFLAGS-s_lrintl.c += -fno-builtin-lrintf64x ++CFLAGS-s_lroundl.c += -fno-builtin-lroundf64x ++CFLAGS-s_modfl.c += -fno-builtin-modff64x ++CFLAGS-s_nanl.c += -fno-builtin-nanf64x ++CFLAGS-s_nearbyintl.c += -fno-builtin-nearbyintf64x ++CFLAGS-s_nextafterl.c += -fno-builtin-nextafterf64x ++CFLAGS-s_nextdownl.c += -fno-builtin-nextdownf64x ++CFLAGS-s_nextupl.c += -fno-builtin-nextupf64x ++CFLAGS-e_powl.c += -fno-builtin-powf64x ++CFLAGS-w_remainderl.c += -fno-builtin-remainderf64x ++CFLAGS-s_remquol.c += -fno-builtin-remquof64x ++CFLAGS-s_rintl.c += -fno-builtin-rintf64x ++CFLAGS-s_roundl.c += -fno-builtin-roundf64x ++CFLAGS-s_roundevenl.c += -fno-builtin-roundevenf64x ++CFLAGS-w_scalblnl.c += -fno-builtin-scalblnf64x ++CFLAGS-s_scalbnl.c += -fno-builtin-scalbnf64x ++CFLAGS-s_setpayloadl.c += -fno-builtin-setpayloadf64x ++CFLAGS-s_setpayloadsigl.c += -fno-builtin-setpayloadsigf64x ++CFLAGS-s_sinl.c += -fno-builtin-sinf64x ++CFLAGS-s_sincosl.c += -fno-builtin-sincosf64x ++CFLAGS-w_sinhl.c += -fno-builtin-sinhf64x ++CFLAGS-w_sqrtl.c += -fno-builtin-sqrtf64x ++CFLAGS-s_tanl.c += -fno-builtin-tanf64x ++CFLAGS-s_tanhl.c += -fno-builtin-tanhf64x ++CFLAGS-w_tgammal.c += -fno-builtin-tgammaf64x ++CFLAGS-s_totalorderl.c += -fno-builtin-totalorderf64x ++CFLAGS-s_totalordermagl.c += -fno-builtin-totalordermagf64x ++CFLAGS-s_truncl.c += -fno-builtin-truncf64x ++CFLAGS-s_ufromfpl.c += -fno-builtin-ufromfpf64x ++CFLAGS-s_ufromfpxl.c += -fno-builtin-ufromfpxf64x ++CFLAGS-s_y0l.c += -fno-builtin-y0f64x ++CFLAGS-s_y1l.c += -fno-builtin-y1f64x ++CFLAGS-s_ynl.c += -fno-builtin-ynf64x ++ + endif # $(subdir) == math +diff --git a/sysdeps/powerpc/powerpc32/fpu/Makefile b/sysdeps/powerpc/powerpc32/fpu/Makefile +index b8b6bb0fa2efcf8c..4c0c65c18a5daea8 100644 +--- a/sysdeps/powerpc/powerpc32/fpu/Makefile ++++ b/sysdeps/powerpc/powerpc32/fpu/Makefile +@@ -1,8 +1,8 @@ + ifeq ($(subdir),math) + # lrint is aliased to lrintf, so suppress compiler builtins to + # avoid mismatched signatures. +-CFLAGS-s_lrint.c += -fno-builtin-lrintf +-CFLAGS-s_lround.c += -fno-builtin-lroundf ++CFLAGS-s_lrint.c += -fno-builtin-lrintf -fno-builtin-lrintf32 ++CFLAGS-s_lround.c += -fno-builtin-lroundf -fno-builtin-lroundf32 + endif + + ifeq ($(subdir),misc) +diff --git a/sysdeps/powerpc/powerpc64/fpu/Makefile b/sysdeps/powerpc/powerpc64/fpu/Makefile +index 05075c2a75c294c3..9359049b555d4457 100644 +--- a/sysdeps/powerpc/powerpc64/fpu/Makefile ++++ b/sysdeps/powerpc/powerpc64/fpu/Makefile +@@ -1,7 +1,9 @@ + ifeq ($(subdir),math) + # lrintf and llrintf are aliased to llrint, so suppress compiler builtins to + # avoid mismatched signatures. +-CFLAGS-s_llrint.c += -fno-builtin-lrintf -fno-builtin-llrintf ++CFLAGS-s_llrint.c += -fno-builtin-lrintf -fno-builtin-llrintf \ ++ -fno-builtin-lrintf32 -fno-builtin-llrintf32 + # Same as before but for lroundf and llroundf +-CFLAGS-s_llround.c += -fno-builtin-lroundf -fno-builtin-llroundf ++CFLAGS-s_llround.c += -fno-builtin-lroundf -fno-builtin-llroundf \ ++ -fno-builtin-lroundf32 -fno-builtin-llroundf32 + endif +diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile +index cc073b53d3292ff8..858061484e1ab419 100644 +--- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile ++++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile +@@ -207,6 +207,131 @@ endef + object-suffixes-left := $(all-object-suffixes) + include $(o-iterator) + ++CFLAGS-w_acosf128-ifunc.c += -fno-builtin-acosf64x ++CFLAGS-w_acoshf128-ifunc.c += -fno-builtin-acoshf64x ++CFLAGS-w_asinf128-ifunc.c += -fno-builtin-asinf64x ++CFLAGS-s_asinhf128-ifunc.c += -fno-builtin-asinhf64x ++CFLAGS-s_atanf128-ifunc.c += -fno-builtin-atanf64x ++CFLAGS-w_atan2f128-ifunc.c += -fno-builtin-atan2f64x ++CFLAGS-w_atanhf128-ifunc.c += -fno-builtin-atanhf64x ++CFLAGS-s_cabsf128-ifunc.c += -fno-builtin-cabsf64x ++CFLAGS-s_cacosf128-ifunc.c += -fno-builtin-cacosf64x ++CFLAGS-s_cacoshf128-ifunc.c += -fno-builtin-cacoshf64x ++CFLAGS-s_canonicalizef128-ifunc.c += -fno-builtin-canonicalizef64x ++CFLAGS-s_cargf128-ifunc.c += -fno-builtin-cargf64x ++CFLAGS-s_casinf128-ifunc.c += -fno-builtin-casinf64x ++CFLAGS-s_casinhf128-ifunc.c += -fno-builtin-casinhf64x ++CFLAGS-s_catanf128-ifunc.c += -fno-builtin-catanf64x ++CFLAGS-s_catanhf128-ifunc.c += -fno-builtin-catanhf64x ++CFLAGS-s_cbrtf128-ifunc.c += -fno-builtin-cbrtf64x ++CFLAGS-s_ccosf128-ifunc.c += -fno-builtin-ccosf64x ++CFLAGS-s_ccoshf128-ifunc.c += -fno-builtin-ccoshf64x ++CFLAGS-s_ceilf128-ifunc.c += -fno-builtin-ceilf64x ++CFLAGS-s_cexpf128-ifunc.c += -fno-builtin-cexpf64x ++CFLAGS-s_cimagf128-ifunc.c += -fno-builtin-cimagf64x ++CFLAGS-s_clogf128-ifunc.c += -fno-builtin-clogf64x ++CFLAGS-s_clog10f128-ifunc.c += -fno-builtin-clog10f64x ++CFLAGS-s_conjf128-ifunc.c += -fno-builtin-conjf64x ++CFLAGS-s_copysignf128-ifunc.c += -fno-builtin-copysignf64x ++CFLAGS-s_cosf128-ifunc.c += -fno-builtin-cosf64x ++CFLAGS-w_coshf128-ifunc.c += -fno-builtin-coshf64x ++CFLAGS-s_cpowf128-ifunc.c += -fno-builtin-cpowf64x ++CFLAGS-s_cprojf128-ifunc.c += -fno-builtin-cprojf64x ++CFLAGS-s_crealf128-ifunc.c += -fno-builtin-crealf64x ++CFLAGS-s_csinf128-ifunc.c += -fno-builtin-csinf64x ++CFLAGS-s_csinhf128-ifunc.c += -fno-builtin-csinhf64x ++CFLAGS-s_csqrtf128-ifunc.c += -fno-builtin-csqrtf64x ++CFLAGS-s_ctanf128-ifunc.c += -fno-builtin-ctanf64x ++CFLAGS-s_ctanhf128-ifunc.c += -fno-builtin-ctanhf64x ++CFLAGS-s_daddf128-ifunc.c += -fno-builtin-f64addf64x ++CFLAGS-s_ddivf128-ifunc.c += -fno-builtin-f64divf64x ++CFLAGS-s_dfmaf128-ifunc.c += -fno-builtin-f64fmaf64x ++CFLAGS-s_dmulf128-ifunc.c += -fno-builtin-f64mulf64x ++CFLAGS-s_dsqrtf128-ifunc.c += -fno-builtin-f64sqrtf64x ++CFLAGS-s_dsubf128-ifunc.c += -fno-builtin-f64subf64x ++CFLAGS-s_erff128-ifunc.c += -fno-builtin-erff64x ++CFLAGS-s_erfcf128-ifunc.c += -fno-builtin-erfcf64x ++CFLAGS-e_expf128-ifunc.c += -fno-builtin-expf64x ++CFLAGS-w_exp10f128-ifunc.c += -fno-builtin-exp10f64x ++CFLAGS-e_exp2f128-ifunc.c += -fno-builtin-exp2f64x ++CFLAGS-s_expm1f128-ifunc.c += -fno-builtin-expm1f64x ++CFLAGS-s_fabsf128-ifunc.c += -fno-builtin-fabsf64x ++CFLAGS-s_faddf128-ifunc.c += -fno-builtin-f32addf64x ++CFLAGS-s_fdimf128-ifunc.c += -fno-builtin-fdimf64x ++CFLAGS-s_fdivf128-ifunc.c += -fno-builtin-f32divf64x ++CFLAGS-s_ffmaf128-ifunc.c += -fno-builtin-f32fmaf64x ++CFLAGS-s_floorf128-ifunc.c += -fno-builtin-floorf64x ++CFLAGS-s_fmaf128-ifunc.c += -fno-builtin-fmaf64x ++CFLAGS-s_fmaxf128-ifunc.c += -fno-builtin-fmaxf64x ++CFLAGS-s_fmaximumf128-ifunc.c += -fno-builtin-fmaximumf64x ++CFLAGS-s_fmaximum_magf128-ifunc.c += -fno-builtin-fmaximum_magf64x ++CFLAGS-s_fmaximum_mag_numf128-ifunc.c += -fno-builtin-fmaximum_mag_numf64x ++CFLAGS-s_fmaximum_numf128-ifunc.c += -fno-builtin-fmaximum_numf64x ++CFLAGS-s_fmaxmagf128-ifunc.c += -fno-builtin-fmaxmagf64x ++CFLAGS-s_fminf128-ifunc.c += -fno-builtin-fminf64x ++CFLAGS-s_fminimumf128-ifunc.c += -fno-builtin-fminimumf64x ++CFLAGS-s_fminimum_magf128-ifunc.c += -fno-builtin-fminimum_magf64x ++CFLAGS-s_fminimum_mag_numf128-ifunc.c += -fno-builtin-fminimum_mag_numf64x ++CFLAGS-s_fminimum_numf128-ifunc.c += -fno-builtin-fminimum_numf64x ++CFLAGS-s_fminmagf128-ifunc.c += -fno-builtin-fminmagf64x ++CFLAGS-w_fmodf128-ifunc.c += -fno-builtin-fmodf64x ++CFLAGS-s_fmulf128-ifunc.c += -fno-builtin-f32mulf64x ++CFLAGS-s_frexpf128-ifunc.c += -fno-builtin-frexpf64x ++CFLAGS-s_fromfpf128-ifunc.c += -fno-builtin-fromfpf64x ++CFLAGS-s_fromfpxf128-ifunc.c += -fno-builtin-fromfpxf64x ++CFLAGS-s_fsqrtf128-ifunc.c += -fno-builtin-f32sqrtf64x ++CFLAGS-s_fsubf128-ifunc.c += -fno-builtin-f32subf64x ++CFLAGS-s_getpayloadf128-ifunc.c += -fno-builtin-getpayloadf64x ++CFLAGS-w_hypotf128-ifunc.c += -fno-builtin-hypotf64x ++CFLAGS-w_ilogbf128-ifunc.c += -fno-builtin-ilogbf64x ++CFLAGS-w_j0f128-ifunc.c += -fno-builtin-j0f64x ++CFLAGS-w_j1f128-ifunc.c += -fno-builtin-j1f64x ++CFLAGS-w_jnf128-ifunc.c += -fno-builtin-jnf64x ++CFLAGS-s_ldexpf128-ifunc.c += -fno-builtin-ldexpf64x ++CFLAGS-w_lgammaf128-ifunc.c += -fno-builtin-lgammaf64x ++CFLAGS-w_lgammaf128_r-ifunc.c += -fno-builtin-lgammaf64x_r ++CFLAGS-w_llogbf128-ifunc.c += -fno-builtin-llogbf64x ++CFLAGS-s_llrintf128-ifunc.c += -fno-builtin-llrintf64x ++CFLAGS-s_llroundf128-ifunc.c += -fno-builtin-llroundf64x ++CFLAGS-e_logf128-ifunc.c += -fno-builtin-logf64x ++CFLAGS-w_log10f128-ifunc.c += -fno-builtin-log10f64x ++CFLAGS-w_log1pf128-ifunc.c += -fno-builtin-log1pf64x ++CFLAGS-e_log2f128-ifunc.c += -fno-builtin-log2f64x ++CFLAGS-s_logbf128-ifunc.c += -fno-builtin-logbf64x ++CFLAGS-s_lrintf128-ifunc.c += -fno-builtin-lrintf64x ++CFLAGS-s_lroundf128-ifunc.c += -fno-builtin-lroundf64x ++CFLAGS-s_modff128-ifunc.c += -fno-builtin-modff64x ++CFLAGS-s_nanf128-ifunc.c += -fno-builtin-nanf64x ++CFLAGS-s_nearbyintf128-ifunc.c += -fno-builtin-nearbyintf64x ++CFLAGS-s_nextafterf128-ifunc.c += -fno-builtin-nextafterf64x ++CFLAGS-s_nextdownf128-ifunc.c += -fno-builtin-nextdownf64x ++CFLAGS-s_nextupf128-ifunc.c += -fno-builtin-nextupf64x ++CFLAGS-e_powf128-ifunc.c += -fno-builtin-powf64x ++CFLAGS-w_remainderf128-ifunc.c += -fno-builtin-remainderf64x ++CFLAGS-s_remquof128-ifunc.c += -fno-builtin-remquof64x ++CFLAGS-s_rintf128-ifunc.c += -fno-builtin-rintf64x ++CFLAGS-s_roundf128-ifunc.c += -fno-builtin-roundf64x ++CFLAGS-s_roundevenf128-ifunc.c += -fno-builtin-roundevenf64x ++CFLAGS-w_scalblnf128-ifunc.c += -fno-builtin-scalblnf64x ++CFLAGS-s_scalbnf128-ifunc.c += -fno-builtin-scalbnf64x ++CFLAGS-s_setpayloadf128-ifunc.c += -fno-builtin-setpayloadf64x ++CFLAGS-s_setpayloadsigf128-ifunc.c += -fno-builtin-setpayloadsigf64x ++CFLAGS-s_sinf128-ifunc.c += -fno-builtin-sinf64x ++CFLAGS-s_sincosf128-ifunc.c += -fno-builtin-sincosf64x ++CFLAGS-w_sinhf128-ifunc.c += -fno-builtin-sinhf64x ++CFLAGS-w_sqrtf128-ifunc.c += -fno-builtin-sqrtf64x ++CFLAGS-s_tanf128-ifunc.c += -fno-builtin-tanf64x ++CFLAGS-s_tanhf128-ifunc.c += -fno-builtin-tanhf64x ++CFLAGS-w_tgammaf128-ifunc.c += -fno-builtin-tgammaf64x ++CFLAGS-s_totalorderf128-ifunc.c += -fno-builtin-totalorderf64x ++CFLAGS-s_totalordermagf128-ifunc.c += -fno-builtin-totalordermagf64x ++CFLAGS-s_truncf128-ifunc.c += -fno-builtin-truncf64x ++CFLAGS-s_ufromfpf128-ifunc.c += -fno-builtin-ufromfpf64x ++CFLAGS-s_ufromfpxf128-ifunc.c += -fno-builtin-ufromfpxf64x ++CFLAGS-s_y0f128-ifunc.c += -fno-builtin-y0f64x ++CFLAGS-s_y1f128-ifunc.c += -fno-builtin-y1f64x ++CFLAGS-s_ynf128-ifunc.c += -fno-builtin-ynf64x ++ + endif # do_f128_multiarch + + libm-sysdep_routines += e_log-ppc64 +diff --git a/sysdeps/x86_64/x32/Makefile b/sysdeps/x86_64/x32/Makefile +index 8748956563babf8f..31732aa248fe62cf 100644 +--- a/sysdeps/x86_64/x32/Makefile ++++ b/sysdeps/x86_64/x32/Makefile +@@ -2,7 +2,8 @@ ifeq ($(subdir),math) + # Since x32 returns 32-bit long int and 64-bit long long int in the + # same 64-bit register, we make the 32b-bit lround an alias of the + # 64-bit llround. Add -fno-builtin-lround to silence the compiler. +-CFLAGS-s_llround.c += -fno-builtin-lround ++CFLAGS-s_llround.c += -fno-builtin-lround -fno-builtin-lroundf32x \ ++ -fno-builtin-lroundf64 + endif + + ifeq ($(subdir),string) diff --git a/glibc-rh2222188-4.patch b/glibc-rh2222188-4.patch new file mode 100644 index 0000000..52e3e3e --- /dev/null +++ b/glibc-rh2222188-4.patch @@ -0,0 +1,89 @@ +commit 9cc9d61ee12f2f8620d8e0ea3c42af02bf07fe1e +Author: Florian Weimer +Date: Fri Nov 4 18:37:16 2022 +0100 + + elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE + +diff --git a/elf/ifuncmain1.c b/elf/ifuncmain1.c +index 747fc02648a5493e..6effce3d77b1f706 100644 +--- a/elf/ifuncmain1.c ++++ b/elf/ifuncmain1.c +@@ -19,7 +19,14 @@ typedef int (*foo_p) (void); + #endif + + foo_p foo_ptr = foo; ++ ++/* Address-significant access to protected symbols is not supported in ++ position-dependent mode on several architectures because GCC ++ generates relocations that assume that the address is local to the ++ main program. */ ++#ifdef __PIE__ + foo_p foo_procted_ptr = foo_protected; ++#endif + + extern foo_p get_foo_p (void); + extern foo_p get_foo_hidden_p (void); +@@ -37,12 +44,16 @@ main (void) + if ((*foo_ptr) () != -1) + abort (); + ++#ifdef __PIE__ + if (foo_procted_ptr != foo_protected) + abort (); ++#endif + if (foo_protected () != 0) + abort (); ++#ifdef __PIE__ + if ((*foo_procted_ptr) () != 0) + abort (); ++#endif + + p = get_foo_p (); + if (p != foo) +@@ -55,8 +66,10 @@ main (void) + abort (); + + p = get_foo_protected_p (); ++#ifdef __PIE__ + if (p != foo_protected) + abort (); ++#endif + if (ret_foo_protected != 0 || (*p) () != ret_foo_protected) + abort (); + +diff --git a/elf/ifuncmain5.c b/elf/ifuncmain5.c +index f398085cb46719d1..6fda768fb6908aed 100644 +--- a/elf/ifuncmain5.c ++++ b/elf/ifuncmain5.c +@@ -14,12 +14,19 @@ get_foo (void) + return foo; + } + ++ ++/* Address-significant access to protected symbols is not supported in ++ position-dependent mode on several architectures because GCC ++ generates relocations that assume that the address is local to the ++ main program. */ ++#ifdef __PIE__ + foo_p + __attribute__ ((noinline)) + get_foo_protected (void) + { + return foo_protected; + } ++#endif + + int + main (void) +@@ -30,9 +37,11 @@ main (void) + if ((*p) () != -1) + abort (); + ++#ifdef __PIE__ + p = get_foo_protected (); + if ((*p) () != 0) + abort (); ++#endif + + return 0; + } diff --git a/glibc-rh2222188-5.patch b/glibc-rh2222188-5.patch new file mode 100644 index 0000000..451ac21 --- /dev/null +++ b/glibc-rh2222188-5.patch @@ -0,0 +1,938 @@ +commit 8a78f833d670f86302f2d0c32eb1e4357d9166ff +Author: Joseph Myers +Date: Fri Jan 6 19:33:29 2023 +0000 + + C2x semantics for + + implements semantics for integer generic arguments that + handle cases involving _FloatN / _FloatNx types as specified in TS + 18661-3 plus some defect fixes. + + C2x has further changes to the semantics for macros with + such types, which should also be considered defect fixes (although + handled through the integration of TS 18661-3 in C2x rather than + through an issue tracking process). Specifically, the rules were + changed because of problems raised with using the macros with the + evaluation format types such as float_t and _Float32_t: the older + version of the rules didn't allow passing _FloatN / _FloatNx types to + the narrowing macros returning float or double, or passing float / + double / long double to the narrowing macros returning _FloatN / + _FloatNx, which was a problem with the evaluation format types which + could be either kind of type depending on the value of + FLT_EVAL_METHOD. + + Thus the new rules allow cases of mixing types which were not allowed + before, and, as part of the changes, the handling of integer arguments + was also changed: if there is any _FloatNx generic argument, integer + generic arguments are treated as _Float32x (not double), while the + rule about treating integer arguments to narrowing macros returning + _FloatN or _FloatNx as _Float64 not double was removed (no longer + needed now double is a valid argument to such macros). + + I've implemented the changes in GCC's __builtin_tgmath, which thus + requires updates to glibc's test expectations so that the tests + continue to build with GCC 13 (the test is also updated to test the + argument types that weren't allowed before but are now valid under C2x + rules). + + Given those test changes, it's then also necessary to fix the + implementations in to have appropriate semantics with older + GCC so that the tests pass with GCC versions before GCC 13 as well. + For some cases (non-narrowing macros with two or three generic + arguments; narrowing macros returning _Float32x), the older version of + __builtin_tgmath doesn't correspond sufficiently well to C2x + semantics, so in those cases is adjusted to use the older + macro implementation instead of __builtin_tgmath. The older macro + implementation is itself adjusted to give the desired semantics, with + GCC 7 and later. (It's not possible to get the right semantics in all + cases for the narrowing macros with GCC 6 and before when the _FloatN + / _FloatNx names are typedefs rather than distinct types.) + + Tested as follows: with the full glibc testsuite for x86_64, GCC 6, 7, + 11, 13; with execution of the math/tests for aarch64, arm, powerpc and + powerpc64le, GCC 6, 7, 12 and 13 (powerpc64le only with GCC 12 and + 13); with build-many-glibcs.py with GCC 6, 7, 12 and 13. + +Conflicts: + math/tgmath.h + (missing support for narrowing fma/sqrt downstream + means that the definitions for __TGMATH_1_NARROW_* + and __TGMATH_3_NARROW_* are not needed) + +diff --git a/math/gen-tgmath-tests.py b/math/gen-tgmath-tests.py +index 364963da6525e08d..be5e8cd9a07ef071 100755 +--- a/math/gen-tgmath-tests.py ++++ b/math/gen-tgmath-tests.py +@@ -19,14 +19,13 @@ + + # As glibc does not support decimal floating point, the types to + # consider for generic parameters are standard and binary +-# floating-point types, and integer types which are treated as double. +-# The corresponding complex types may also be used (including complex +-# integer types, which are a GNU extension, but are currently disabled +-# here because they do not work properly with tgmath.h). +- +-# The proposed resolution to TS 18661-1 DR#9 +-# +-# makes the rules for selecting a function to call ++# floating-point types, and integer types which are treated as ++# _Float32x if any argument has a _FloatNx type and otherwise as ++# double. The corresponding complex types may also be used (including ++# complex integer types, which are a GNU extension, but are currently ++# disabled here because they do not work properly with tgmath.h). ++ ++# C2x makes the rules for selecting a function to call + # correspond to the usual arithmetic conversions (applied successively + # to the arguments for generic parameters in order), which choose the + # type whose set of values contains that of the other type (undefined +@@ -69,10 +68,6 @@ class Type(object): + # Real argument types that correspond to a standard floating type + # (float, double or long double; not _FloatN or _FloatNx). + standard_real_argument_types_list = [] +- # Real argument types other than float, double and long double +- # (i.e., those that are valid as arguments to narrowing macros +- # returning _FloatN or _FloatNx). +- non_standard_real_argument_types_list = [] + # The real floating types by their order properties (which are + # tuples giving the positions in both the possible orders above). + real_types_order = {} +@@ -86,13 +81,16 @@ class Type(object): + float64_type = None + # The type _Complex _Float64. + complex_float64_type = None ++ # The type _Float32x. ++ float32x_type = None ++ # The type _Complex _Float32x. ++ complex_float32x_type = None + # The type _Float64x. + float64x_type = None +- # The type _Float64x if available, otherwise _Float64. +- float32x_ext_type = None + + def __init__(self, name, suffix=None, mant_dig=None, condition='1', +- order=None, integer=False, complex=False, real_type=None): ++ order=None, integer=False, complex=False, real_type=None, ++ floatnx=False): + """Initialize a Type object, creating any corresponding complex type + in the process.""" + self.name = name +@@ -102,6 +100,7 @@ class Type(object): + self.order = order + self.integer = integer + self.complex = complex ++ self.floatnx = floatnx + if complex: + self.complex_type = self + self.real_type = real_type +@@ -119,8 +118,6 @@ class Type(object): + Type.real_argument_types_list.append(self) + if not self.name.startswith('_Float'): + Type.standard_real_argument_types_list.append(self) +- if self.name not in ('float', 'double', 'long double'): +- Type.non_standard_real_argument_types_list.append(self) + if self.order is not None: + Type.real_types_order[self.order] = self + if self.name == 'double': +@@ -133,26 +130,28 @@ class Type(object): + Type.float64_type = self + if self.name == '_Complex _Float64': + Type.complex_float64_type = self ++ if self.name == '_Float32x': ++ Type.float32x_type = self ++ if self.name == '_Complex _Float32x': ++ Type.complex_float32x_type = self + if self.name == '_Float64x': + Type.float64x_type = self +- if self.name == 'Float32x_ext': +- Type.float32x_ext_type = self + + @staticmethod + def create_type(name, suffix=None, mant_dig=None, condition='1', order=None, + integer=False, complex_name=None, complex_ok=True, +- internal=False): ++ floatnx=False, internal=False): + """Create and register a Type object for a real type, creating any + corresponding complex type in the process.""" + real_type = Type(name, suffix=suffix, mant_dig=mant_dig, + condition=condition, order=order, integer=integer, +- complex=False) ++ complex=False, floatnx=floatnx) + if complex_ok: + if complex_name is None: + complex_name = '_Complex %s' % name + complex_type = Type(complex_name, condition=condition, + integer=integer, complex=True, +- real_type=real_type) ++ real_type=real_type, floatnx=floatnx) + else: + complex_type = None + real_type.complex_type = complex_type +@@ -160,13 +159,13 @@ class Type(object): + if complex_type is not None: + complex_type.register_type(internal) + +- def floating_type(self, floatn): ++ def floating_type(self, integer_float32x): + """Return the corresponding floating type.""" + if self.integer: +- if floatn: +- return (Type.complex_float64_type ++ if integer_float32x: ++ return (Type.complex_float32x_type + if self.complex +- else Type.float64_type) ++ else Type.float32x_type) + else: + return (Type.complex_double_type + if self.complex +@@ -174,9 +173,9 @@ class Type(object): + else: + return self + +- def real_floating_type(self, floatn): ++ def real_floating_type(self, integer_float32x): + """Return the corresponding real floating type.""" +- return self.real_type.floating_type(floatn) ++ return self.real_type.floating_type(integer_float32x) + + def __str__(self): + """Return string representation of a type.""" +@@ -194,7 +193,8 @@ class Type(object): + condition='defined HUGE_VAL_F32', order=(2, 2)) + Type.create_type('_Float32x', 'f32x', 'FLT32X_MANT_DIG', + complex_name='__CFLOAT32X', +- condition='defined HUGE_VAL_F32X', order=(3, 3)) ++ condition='defined HUGE_VAL_F32X', order=(3, 3), ++ floatnx=True) + Type.create_type('double', '', 'DBL_MANT_DIG', order=(4, 4)) + Type.create_type('long double', 'l', 'LDBL_MANT_DIG', order=(5, 7)) + Type.create_type('_Float64', 'f64', 'FLT64_MANT_DIG', +@@ -202,7 +202,8 @@ class Type(object): + condition='defined HUGE_VAL_F64', order=(6, 5)) + Type.create_type('_Float64x', 'f64x', 'FLT64X_MANT_DIG', + complex_name='__CFLOAT64X', +- condition='defined HUGE_VAL_F64X', order=(7, 6)) ++ condition='defined HUGE_VAL_F64X', order=(7, 6), ++ floatnx=True) + Type.create_type('_Float128', 'f128', 'FLT128_MANT_DIG', + complex_name='__CFLOAT128', + condition='defined HUGE_VAL_F128', order=(8, 8)) +@@ -235,21 +236,16 @@ class Type(object): + complex_name='complex_long_double_Float64x', + condition='defined HUGE_VAL_F64X', order=(7, 7), + internal=True) +- # An internal type for the argument type used by f32x* +- # narrowing macros (_Float64x if available, otherwise +- # _Float64). +- Type.create_type('Float32x_ext', None, 'FLT32X_EXT_MANT_DIG', +- complex_name='complex_Float32x_ext', +- condition='1', internal=True) + + @staticmethod +- def can_combine_types(types, floatn): ++ def can_combine_types(types): + """Return a C preprocessor conditional for whether the given list of + types can be used together as type-generic macro arguments.""" + have_long_double = False + have_float128 = False ++ integer_float32x = any(t.floatnx for t in types) + for t in types: +- t = t.real_floating_type(floatn) ++ t = t.real_floating_type(integer_float32x) + if t.name == 'long double': + have_long_double = True + if t.name == '_Float128' or t.name == '_Float64x': +@@ -262,14 +258,15 @@ class Type(object): + return '1' + + @staticmethod +- def combine_types(types, floatn): ++ def combine_types(types): + """Return the result of combining a set of types.""" + have_complex = False + combined = None ++ integer_float32x = any(t.floatnx for t in types) + for t in types: + if t.complex: + have_complex = True +- t = t.real_floating_type(floatn) ++ t = t.real_floating_type(integer_float32x) + if combined is None: + combined = t + else: +@@ -375,18 +372,8 @@ class Tests(object): + '# endif\n') + float64x_text = if_cond_text([Type.float64x_type.condition], + float64x_text) +- float32x_ext_text = ('#ifdef HUGE_VAL_F64X\n' +- 'typedef _Float64x Float32x_ext;\n' +- 'typedef __CFLOAT64X complex_Float32x_ext;\n' +- '# define FLT32X_EXT_MANT_DIG FLT64X_MANT_DIG\n' +- '#else\n' +- 'typedef _Float64 Float32x_ext;\n' +- 'typedef __CFLOAT64 complex_Float32x_ext;\n' +- '# define FLT32X_EXT_MANT_DIG FLT64_MANT_DIG\n' +- '#endif\n') + self.header_list.append(float64_text) + self.header_list.append(float64x_text) +- self.header_list.append(float32x_ext_text) + self.types_seen = set() + for t in Type.all_types_list: + self.add_type_var(t.name, t.condition) +@@ -439,39 +426,33 @@ class Tests(object): + narrowing_std = True + narrow_cond = '1' + narrow_args = [Type.double_type, Type.long_double_type] +- narrow_fallback = Type.double_type + elif ret == 'double': + narrowing = True + narrowing_std = True + narrow_cond = '1' + narrow_args = [Type.long_double_type] +- narrow_fallback = Type.long_double_type + elif ret.startswith('_Float'): + narrowing = True +- narrow_args = [] ++ narrow_args_1 = [] ++ narrow_args_2 = [] + nret_type = None +- narrow_fallback = None + for order, real_type in sorted(Type.real_types_order.items()): + if real_type.name == ret: + nret_type = real_type + elif nret_type and real_type.name.startswith('_Float'): +- narrow_args.append(real_type) +- if (narrow_fallback is None +- and ret.endswith('x') == real_type.name.endswith('x')): +- narrow_fallback = real_type ++ if ret.endswith('x') == real_type.name.endswith('x'): ++ narrow_args_1.append(real_type) ++ else: ++ narrow_args_2.append(real_type) ++ narrow_args = narrow_args_1 + narrow_args_2 + if narrow_args: + narrow_cond = ('(%s && (%s))' + % (nret_type.condition, + ' || '.join(t.condition + for t in narrow_args))) +- if narrow_fallback is None: +- narrow_fallback = narrow_args[0] +- if ret == '_Float32x': +- narrow_fallback = Type.float32x_ext_type + else: + # No possible argument types, even conditionally. + narrow_cond = '0' +- narrowing_nonstd = narrowing and not narrowing_std + types = [ret] + args + for t in types: + if t != 'c' and t != 'g' and t != 'r' and t != 's': +@@ -530,19 +511,13 @@ class Tests(object): + if t == 'g' or t == 'c': + arg_types.append(Type.argument_types_list) + elif t == 'r': +- if narrowing_std: +- arg_types.append(Type.standard_real_argument_types_list) +- elif narrowing: +- arg_types.append( +- Type.non_standard_real_argument_types_list) +- else: +- arg_types.append(Type.real_argument_types_list) ++ arg_types.append(Type.real_argument_types_list) + elif t == 's': + arg_types.append(Type.standard_real_argument_types_list) + arg_types_product = list_product(arg_types) + test_num = 0 + for this_args in arg_types_product: +- comb_type = Type.combine_types(this_args, narrowing_nonstd) ++ comb_type = Type.combine_types(this_args) + if narrowing: + # As long as there are no integer arguments, and as + # long as the chosen argument type is as wide as all +@@ -550,22 +525,22 @@ class Tests(object): + # of the macro call do not depend on the exact + # function chosen. In particular, for f32x functions + # when _Float64x exists, the chosen type should differ +- # for _Float32x and _Float64 arguments, but it is not +- # always possible to distinguish those types before +- # GCC 7 and the implementation does not attempt to do +- # so before GCC 8. ++ # for double / _Float32x and _Float64 arguments, but ++ # it is not always possible to distinguish those types ++ # before GCC 7 (resulting in some cases - only real ++ # arguments - where a wider argument type is used, ++ # which is semantically OK, and others - integer ++ # arguments present - where it may not be OK, but is ++ # unavoidable). + narrow_mant_dig = comb_type.real_type.mant_dig + for arg_type in this_args: + if arg_type.integer: + narrow_mant_dig = 0 + else: + narrow_mant_dig = 0 +- if (narrowing +- and comb_type not in narrow_args +- and narrow_fallback is not None): +- comb_type = narrow_fallback +- can_comb = Type.can_combine_types(this_args, narrowing_nonstd) ++ can_comb = Type.can_combine_types(this_args) + all_conds = [t.condition for t in this_args] ++ narrow_args_cond = '(%s)' % ' && '.join(sorted(set(all_conds))) + all_conds.append(can_comb) + if narrowing: + all_conds.append(narrow_cond) +@@ -579,10 +554,69 @@ class Tests(object): + test_func_name = 'test_%s_%d' % (macro, test_num) + test_num += 1 + mant_dig = comb_type.real_type.mant_dig ++ test_mant_dig_comp = '' ++ if (narrowing ++ and comb_type not in narrow_args): ++ # The expected argument type is the first in ++ # narrow_args that can represent all the values of ++ # comb_type (which, for the supported cases, means the ++ # first with mant_dig at least as large as that for ++ # comb_type, provided this isn't the case of an IBM ++ # long double argument with binary128 type from ++ # narrow_args). ++ narrow_extra_conds = [] ++ test_mant_dig_list = ['#undef NARROW_MANT_DIG\n#if 0\n'] ++ for t in narrow_args: ++ t_cond = '(%s && %s && %s <= %s && %s)' % ( ++ narrow_args_cond, t.condition, mant_dig, t.mant_dig, ++ Type.can_combine_types(this_args + [t])) ++ narrow_extra_conds.append(t_cond) ++ test_mant_dig_list.append('#elif %s\n' ++ '#define NARROW_MANT_DIG %s\n' ++ % (t_cond, t.mant_dig)) ++ test_mant_dig_list.append('#endif\n') ++ test_mant_dig_comp = ''.join(test_mant_dig_list) ++ all_conds.append('(%s)' % ' || '.join(narrow_extra_conds)) ++ # A special case where this logic isn't correct is ++ # where comb_type is the internal long_double_Float64 ++ # or long_double_Float64x, which will be detected as ++ # not in narrow_args even if the actual type chosen in ++ # a particular configuration would have been in ++ # narrow_args, so check for that case and handle it ++ # appropriately. In particular, if long double has ++ # the same format as double and there are long double ++ # and _Float64 arguments, and the macro returns ++ # _Float32x, the function called should be one for ++ # _Float64 arguments, not one for _Float64x arguments ++ # that would arise from this logic. ++ if comb_type.real_type.name == 'long_double_Float64': ++ comb_type_1 = Type.long_double_type ++ comb_type_2 = Type.float64_type ++ comb_type_is_2_cond = 'LDBL_MANT_DIG <= FLT64_MANT_DIG' ++ elif comb_type.real_type.name == 'long_double_Float64x': ++ comb_type_1 = Type.long_double_type ++ comb_type_2 = Type.float64x_type ++ comb_type_is_2_cond = 'LDBL_MANT_DIG < FLT64X_MANT_DIG' ++ else: ++ comb_type_1 = None ++ comb_type_2 = None ++ if comb_type_1 is None: ++ mant_dig = 'NARROW_MANT_DIG' ++ else: ++ mant_dig = '' ++ if comb_type_1 in narrow_args: ++ mant_dig += '!(%s) ? %s : ' % (comb_type_is_2_cond, ++ comb_type_1.mant_dig) ++ if comb_type_2 in narrow_args: ++ mant_dig += '%s ? %s : ' % (comb_type_is_2_cond, ++ comb_type_2.mant_dig) ++ mant_dig += 'NARROW_MANT_DIG' ++ if narrow_mant_dig != 0: ++ narrow_mant_dig = mant_dig + test_text = '%s, "%s", "%s", %s, %s' % (test_func_name, func_name, + test_name, mant_dig, + narrow_mant_dig) +- test_text = ' { %s },\n' % test_text ++ test_text = '%s { %s },\n' % (test_mant_dig_comp, test_text) + test_text = if_cond_text(all_conds, test_text) + self.test_array_list.append(test_text) + call_args = [] +@@ -730,7 +764,7 @@ class Tests(object): + ' && strcmp (called_func_name,\n' + ' tests[i].func_name) == 0)\n' + ' num_pass++;\n' +- '#if !__GNUC_PREREQ (8, 0)\n' ++ '#if !__GNUC_PREREQ (7, 0)\n' + ' else if (tests[i].narrow_mant_dig > 0\n' + ' && (called_mant_dig\n' + ' >= tests[i].narrow_mant_dig)\n' +@@ -747,6 +781,21 @@ class Tests(object): + ' tests[i].mant_dig,\n' + ' called_func_name, called_mant_dig);\n' + ' }\n' ++ ' else if (tests[i].narrow_mant_dig == 0\n' ++ ' && strcmp (called_func_name,\n' ++ ' tests[i].func_name) == 0)\n' ++ ' {\n' ++ ' num_pass++;\n' ++ ' printf ("Test %zu (%s):\\n"\n' ++ ' " Expected: %s precision %d\\n"\n' ++ ' " Actual: %s precision %d\\n"\n' ++ ' " (unavoidable with old GCC)' ++ '\\n\\n",\n' ++ ' i, tests[i].test_name,\n' ++ ' tests[i].func_name,\n' ++ ' tests[i].mant_dig,\n' ++ ' called_func_name, called_mant_dig);\n' ++ ' }\n' + '#endif\n' + ' else\n' + ' {\n' +diff --git a/math/tgmath.h b/math/tgmath.h +index b55cb39c93575ddc..dbd165dd1882dcc4 100644 +--- a/math/tgmath.h ++++ b/math/tgmath.h +@@ -37,9 +37,17 @@ + for older GCC, using other compiler extensions but with macros + expanding their arguments many times (so resulting in exponential + blowup of the size of expansions when calls to such macros are +- nested inside arguments to such macros). */ ++ nested inside arguments to such macros). Because of a long series ++ of defect fixes made after the initial release of TS 18661-1, GCC ++ versions before GCC 13 have __builtin_tgmath semantics that, when ++ integer arguments are passed to narrowing macros returning ++ _Float32x, or non-narrowing macros with at least two generic ++ arguments, do not always correspond to the C2X semantics, so more ++ complicated macro definitions are also used in some cases for ++ versions from GCC 8 to GCC 12. */ + + #define __HAVE_BUILTIN_TGMATH __GNUC_PREREQ (8, 0) ++#define __HAVE_BUILTIN_TGMATH_C2X __GNUC_PREREQ (13, 0) + + #if __GNUC_PREREQ (2, 7) + +@@ -135,13 +143,14 @@ + __builtin_tgmath (__TGMATH_NARROW_FUNCS_F32 (F) (X), (Y)) + # define __TGMATH_2_NARROW_F64(F, X, Y) \ + __builtin_tgmath (__TGMATH_NARROW_FUNCS_F64 (F) (X), (Y)) +-# if __HAVE_FLOAT128 ++# if __HAVE_FLOAT128 && __HAVE_BUILTIN_TGMATH_C2X + # define __TGMATH_2_NARROW_F32X(F, X, Y) \ + __builtin_tgmath (__TGMATH_NARROW_FUNCS_F32X (F) (X), (Y)) + # endif + +-# else /* !__HAVE_BUILTIN_TGMATH. */ ++# endif + ++# if !__HAVE_BUILTIN_TGMATH_C2X + # ifdef __NO_LONG_DOUBLE_MATH + # define __tgml(fct) fct + # else +@@ -181,13 +190,17 @@ + /* Whether an expression (of arithmetic type) has a real type. */ + # define __expr_is_real(E) (__builtin_classify_type (E) != 9) + ++/* Type T1 if E is 1, type T2 is E is 0. */ ++# define __tgmath_type_if(T1, T2, E) \ ++ __typeof__ (*(0 ? (__typeof__ (0 ? (T2 *) 0 : (void *) (E))) 0 \ ++ : (__typeof__ (0 ? (T1 *) 0 : (void *) (!(E)))) 0)) ++ + /* The tgmath real type for T, where E is 0 if T is an integer type + and 1 for a floating type. If T has a complex type, it is + unspecified whether the return type is real or complex (but it has + the correct corresponding real type). */ + # define __tgmath_real_type_sub(T, E) \ +- __typeof__ (*(0 ? (__typeof__ (0 ? (double *) 0 : (void *) (E))) 0 \ +- : (__typeof__ (0 ? (T *) 0 : (void *) (!(E)))) 0)) ++ __tgmath_type_if (T, double, E) + + /* The tgmath real type of EXPR. */ + # define __tgmath_real_type(expr) \ +@@ -215,6 +228,56 @@ + __real_integer_type (__typeof__ (+(expr))), \ + __complex_integer_type (__typeof__ (+(expr)))) + ++/* The tgmath real type of EXPR1 combined with EXPR2, without handling ++ the C2X rule of interpreting integer arguments as _Float32x if any ++ argument is _FloatNx. */ ++# define __tgmath_real_type2_base(expr1, expr2) \ ++ __typeof ((__tgmath_real_type (expr1)) 0 + (__tgmath_real_type (expr2)) 0) ++ ++/* The tgmath complex type of EXPR1 combined with EXPR2, without ++ handling the C2X rule of interpreting integer arguments as ++ _Float32x if any argument is _FloatNx. */ ++# define __tgmath_complex_type2_base(expr1, expr2) \ ++ __typeof ((__tgmath_complex_type (expr1)) 0 \ ++ + (__tgmath_complex_type (expr2)) 0) ++ ++/* The tgmath real type of EXPR1 combined with EXPR2 and EXPR3, ++ without handling the C2X rule of interpreting integer arguments as ++ _Float32x if any argument is _FloatNx. */ ++# define __tgmath_real_type3_base(expr1, expr2, expr3) \ ++ __typeof ((__tgmath_real_type (expr1)) 0 \ ++ + (__tgmath_real_type (expr2)) 0 \ ++ + (__tgmath_real_type (expr3)) 0) ++ ++/* The tgmath real or complex type of EXPR1 combined with EXPR2 (and ++ EXPR3 if applicable). */ ++# if __HAVE_FLOATN_NOT_TYPEDEF ++# define __tgmath_real_type2(expr1, expr2) \ ++ __tgmath_type_if (_Float32x, __tgmath_real_type2_base (expr1, expr2), \ ++ _Generic ((expr1) + (expr2), _Float32x: 1, default: 0)) ++# define __tgmath_complex_type2(expr1, expr2) \ ++ __tgmath_type_if (_Float32x, \ ++ __tgmath_type_if (_Complex _Float32x, \ ++ __tgmath_complex_type2_base (expr1, \ ++ expr2), \ ++ _Generic ((expr1) + (expr2), \ ++ _Complex _Float32x: 1, \ ++ default: 0)), \ ++ _Generic ((expr1) + (expr2), _Float32x: 1, default: 0)) ++# define __tgmath_real_type3(expr1, expr2, expr3) \ ++ __tgmath_type_if (_Float32x, \ ++ __tgmath_real_type3_base (expr1, expr2, expr3), \ ++ _Generic ((expr1) + (expr2) + (expr3), \ ++ _Float32x: 1, default: 0)) ++# else ++# define __tgmath_real_type2(expr1, expr2) \ ++ __tgmath_real_type2_base (expr1, expr2) ++# define __tgmath_complex_type2(expr1, expr2) \ ++ __tgmath_complex_type2_base (expr1, expr2) ++# define __tgmath_real_type3(expr1, expr2, expr3) \ ++ __tgmath_real_type3_base (expr1, expr2, expr3) ++# endif ++ + # if (__HAVE_DISTINCT_FLOAT16 \ + || __HAVE_DISTINCT_FLOAT32 \ + || __HAVE_DISTINCT_FLOAT64 \ +@@ -226,7 +289,10 @@ + + /* Expand to text that checks if ARG_COMB has type _Float128, and if + so calls the appropriately suffixed FCT (which may include a cast), +- or FCT and CFCT for complex functions, with arguments ARG_CALL. */ ++ or FCT and CFCT for complex functions, with arguments ARG_CALL. ++ __TGMATH_F128LD (only used in the __HAVE_FLOAT64X_LONG_DOUBLE case, ++ for narrowing macros) handles long double the same as ++ _Float128. */ + # if __HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) + # if (!__HAVE_FLOAT64X \ + || __HAVE_FLOAT64X_LONG_DOUBLE \ +@@ -234,6 +300,10 @@ + # define __TGMATH_F128(arg_comb, fct, arg_call) \ + __builtin_types_compatible_p (__typeof (+(arg_comb)), _Float128) \ + ? fct ## f128 arg_call : ++# define __TGMATH_F128LD(arg_comb, fct, arg_call) \ ++ (__builtin_types_compatible_p (__typeof (+(arg_comb)), _Float128) \ ++ || __builtin_types_compatible_p (__typeof (+(arg_comb)), long double)) \ ++ ? fct ## f128 arg_call : + # define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) \ + __builtin_types_compatible_p (__typeof (+__real__ (arg_comb)), _Float128) \ + ? (__expr_is_real (arg_comb) \ +@@ -259,7 +329,7 @@ + # define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) /* Nothing. */ + # endif + +-# endif /* !__HAVE_BUILTIN_TGMATH. */ ++# endif /* !__HAVE_BUILTIN_TGMATH_C2X. */ + + /* We have two kinds of generic macros: to support functions which are + only defined on real valued parameters and those which are defined +@@ -272,14 +342,18 @@ + __TGMATH_2 (Fct, (Val1), (Val2)) + # define __TGMATH_BINARY_FIRST_REAL_STD_ONLY(Val1, Val2, Fct) \ + __TGMATH_2STD (Fct, (Val1), (Val2)) +-# define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ ++# if __HAVE_BUILTIN_TGMATH_C2X ++# define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ + __TGMATH_2 (Fct, (Val1), (Val2)) ++# endif + # define __TGMATH_BINARY_REAL_STD_ONLY(Val1, Val2, Fct) \ + __TGMATH_2STD (Fct, (Val1), (Val2)) +-# define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ ++# if __HAVE_BUILTIN_TGMATH_C2X ++# define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ + __TGMATH_3 (Fct, (Val1), (Val2), (Val3)) +-# define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \ ++# define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \ + __TGMATH_3 (Fct, (Val1), (Val2), (Val3)) ++# endif + # define __TGMATH_TERNARY_FIRST_REAL_RET_ONLY(Val1, Val2, Val3, Fct) \ + __TGMATH_3 (Fct, (Val1), (Val2), (Val3)) + # define __TGMATH_UNARY_REAL_IMAG(Val, Fct, Cfct) \ +@@ -289,11 +363,14 @@ + __TGMATH_1C (Fct, Cfct, (Val)) + # define __TGMATH_UNARY_REAL_IMAG_RET_REAL_SAME(Val, Cfct) \ + __TGMATH_1 (Cfct, (Val)) +-# define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ ++# if __HAVE_BUILTIN_TGMATH_C2X ++# define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ + __TGMATH_2C (Fct, Cfct, (Val1), (Val2)) ++# endif + +-# else /* !__HAVE_BUILTIN_TGMATH. */ ++# endif + ++# if !__HAVE_BUILTIN_TGMATH + # define __TGMATH_UNARY_REAL_ONLY(Val, Fct) \ + (__extension__ ((sizeof (+(Val)) == sizeof (double) \ + || __builtin_classify_type (Val) != 8) \ +@@ -330,29 +407,28 @@ + : (sizeof (+(Val1)) == sizeof (float)) \ + ? (__tgmath_real_type (Val1)) Fct##f (Val1, Val2) \ + : (__tgmath_real_type (Val1)) __tgml(Fct) (Val1, Val2))) ++# endif + ++# if !__HAVE_BUILTIN_TGMATH_C2X + # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ + (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double) \ + && __builtin_classify_type ((Val1) + (Val2)) == 8) \ + ? __TGMATH_F128 ((Val1) + (Val2), \ +- (__typeof \ +- ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) Fct, \ ++ (__tgmath_real_type2 (Val1, Val2)) Fct, \ + (Val1, Val2)) \ +- (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) \ ++ (__tgmath_real_type2 (Val1, Val2)) \ + __tgml(Fct) (Val1, Val2) \ + : (sizeof (+(Val1)) == sizeof (double) \ + || sizeof (+(Val2)) == sizeof (double) \ + || __builtin_classify_type (Val1) != 8 \ + || __builtin_classify_type (Val2) != 8) \ +- ? (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) \ ++ ? (__tgmath_real_type2 (Val1, Val2)) \ + Fct (Val1, Val2) \ +- : (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) \ ++ : (__tgmath_real_type2 (Val1, Val2)) \ + Fct##f (Val1, Val2))) ++# endif + ++# if !__HAVE_BUILTIN_TGMATH + # define __TGMATH_BINARY_REAL_STD_ONLY(Val1, Val2, Fct) \ + (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double) \ + && __builtin_classify_type ((Val1) + (Val2)) == 8) \ +@@ -369,27 +445,24 @@ + : (__typeof ((__tgmath_real_type (Val1)) 0 \ + + (__tgmath_real_type (Val2)) 0)) \ + Fct##f (Val1, Val2))) ++# endif + ++# if !__HAVE_BUILTIN_TGMATH_C2X + # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ + (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double) \ + && __builtin_classify_type ((Val1) + (Val2)) == 8) \ + ? __TGMATH_F128 ((Val1) + (Val2), \ +- (__typeof \ +- ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) Fct, \ ++ (__tgmath_real_type2 (Val1, Val2)) Fct, \ + (Val1, Val2, Val3)) \ +- (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) \ ++ (__tgmath_real_type2 (Val1, Val2)) \ + __tgml(Fct) (Val1, Val2, Val3) \ + : (sizeof (+(Val1)) == sizeof (double) \ + || sizeof (+(Val2)) == sizeof (double) \ + || __builtin_classify_type (Val1) != 8 \ + || __builtin_classify_type (Val2) != 8) \ +- ? (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) \ ++ ? (__tgmath_real_type2 (Val1, Val2)) \ + Fct (Val1, Val2, Val3) \ +- : (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0)) \ ++ : (__tgmath_real_type2 (Val1, Val2)) \ + Fct##f (Val1, Val2, Val3))) + + # define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \ +@@ -397,14 +470,10 @@ + && __builtin_classify_type ((Val1) + (Val2) + (Val3)) \ + == 8) \ + ? __TGMATH_F128 ((Val1) + (Val2) + (Val3), \ +- (__typeof \ +- ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0 \ +- + (__tgmath_real_type (Val3)) 0)) Fct, \ ++ (__tgmath_real_type3 (Val1, Val2, \ ++ Val3)) Fct, \ + (Val1, Val2, Val3)) \ +- (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0 \ +- + (__tgmath_real_type (Val3)) 0)) \ ++ (__tgmath_real_type3 (Val1, Val2, Val3)) \ + __tgml(Fct) (Val1, Val2, Val3) \ + : (sizeof (+(Val1)) == sizeof (double) \ + || sizeof (+(Val2)) == sizeof (double) \ +@@ -412,15 +481,13 @@ + || __builtin_classify_type (Val1) != 8 \ + || __builtin_classify_type (Val2) != 8 \ + || __builtin_classify_type (Val3) != 8) \ +- ? (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0 \ +- + (__tgmath_real_type (Val3)) 0)) \ ++ ? (__tgmath_real_type3 (Val1, Val2, Val3)) \ + Fct (Val1, Val2, Val3) \ +- : (__typeof ((__tgmath_real_type (Val1)) 0 \ +- + (__tgmath_real_type (Val2)) 0 \ +- + (__tgmath_real_type (Val3)) 0)) \ ++ : (__tgmath_real_type3 (Val1, Val2, Val3)) \ + Fct##f (Val1, Val2, Val3))) ++# endif + ++# if !__HAVE_BUILTIN_TGMATH + # define __TGMATH_TERNARY_FIRST_REAL_RET_ONLY(Val1, Val2, Val3, Fct) \ + (__extension__ ((sizeof (+(Val1)) == sizeof (double) \ + || __builtin_classify_type (Val1) != 8) \ +@@ -496,7 +563,9 @@ + __tgml(Cfct) (Val)))) + # define __TGMATH_UNARY_REAL_IMAG_RET_REAL_SAME(Val, Cfct) \ + __TGMATH_UNARY_REAL_IMAG_RET_REAL ((Val), Cfct, Cfct) ++# endif + ++# if !__HAVE_BUILTIN_TGMATH_C2X + /* XXX This definition has to be changed as soon as the compiler understands + the imaginary keyword. */ + # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ +@@ -505,46 +574,39 @@ + && __builtin_classify_type (__real__ (Val1) \ + + __real__ (Val2)) == 8) \ + ? __TGMATH_CF128 ((Val1) + (Val2), \ +- (__typeof \ +- ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ (__tgmath_complex_type2 (Val1, Val2)) \ + Fct, \ +- (__typeof \ +- ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ (__tgmath_complex_type2 (Val1, Val2)) \ + Cfct, \ + (Val1, Val2)) \ + (__expr_is_real ((Val1) + (Val2)) \ +- ? (__typeof ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ ? (__tgmath_complex_type2 (Val1, Val2)) \ + __tgml(Fct) (Val1, Val2) \ +- : (__typeof ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ : (__tgmath_complex_type2 (Val1, Val2)) \ + __tgml(Cfct) (Val1, Val2)) \ + : (sizeof (+__real__ (Val1)) == sizeof (double) \ + || sizeof (+__real__ (Val2)) == sizeof (double) \ + || __builtin_classify_type (__real__ (Val1)) != 8 \ + || __builtin_classify_type (__real__ (Val2)) != 8) \ + ? (__expr_is_real ((Val1) + (Val2)) \ +- ? (__typeof ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ ? (__tgmath_complex_type2 (Val1, Val2)) \ + Fct (Val1, Val2) \ +- : (__typeof ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ : (__tgmath_complex_type2 (Val1, Val2)) \ + Cfct (Val1, Val2)) \ + : (__expr_is_real ((Val1) + (Val2)) \ +- ? (__typeof ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ ? (__tgmath_complex_type2 (Val1, Val2)) \ + Fct##f (Val1, Val2) \ +- : (__typeof ((__tgmath_complex_type (Val1)) 0 \ +- + (__tgmath_complex_type (Val2)) 0)) \ ++ : (__tgmath_complex_type2 (Val1, Val2)) \ + Cfct##f (Val1, Val2)))) ++# endif + ++# if !__HAVE_BUILTIN_TGMATH + # define __TGMATH_2_NARROW_F(F, X, Y) \ + (__extension__ (sizeof ((__tgmath_real_type (X)) 0 \ + + (__tgmath_real_type (Y)) 0) > sizeof (double) \ + ? F ## l (X, Y) \ + : F (X, Y))) ++# endif + /* In most cases, these narrowing macro definitions based on sizeof + ensure that the function called has the right argument format, as + for other macros for compilers before GCC 8, but may not +@@ -553,35 +615,50 @@ + + In the case of macros for _Float32x return type, when _Float64x + exists, _Float64 arguments should result in the *f64 function being +- called while _Float32x arguments should result in the *f64x +- function being called. These cases cannot be distinguished using +- sizeof (or at all if the types are typedefs rather than different +- types). However, for these functions it is OK (does not affect the +- final result) to call a function with any argument format at least +- as wide as all the floating-point arguments, unless that affects +- rounding of integer arguments. Integer arguments are considered to +- have type _Float64, so the *f64 functions are preferred for f32x* +- macros when no argument has a wider floating-point type. */ +-# if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128 ++ called while _Float32x, float and double arguments should result in ++ the *f64x function being called (and integer arguments are ++ considered to have type _Float32x if any argument has type ++ _FloatNx, or double otherwise). These cases cannot be ++ distinguished using sizeof (or at all if the types are typedefs ++ rather than different types, in which case we err on the side of ++ using the wider type if unsure). */ ++# if !__HAVE_BUILTIN_TGMATH_C2X ++# if __HAVE_FLOATN_NOT_TYPEDEF ++# define __TGMATH_NARROW_F32X_USE_F64X(X) \ ++ !__builtin_types_compatible_p (__typeof (+(X)), _Float64) ++# else ++# define __TGMATH_NARROW_F32X_USE_F64X(X) \ ++ (__builtin_types_compatible_p (__typeof (+(X)), double) \ ++ || __builtin_types_compatible_p (__typeof (+(X)), float) \ ++ || !__floating_type (__typeof (+(X)))) ++# endif ++# endif ++# if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128 ++# if !__HAVE_BUILTIN_TGMATH + # define __TGMATH_2_NARROW_F32(F, X, Y) \ + (__extension__ (sizeof ((__tgmath_real_type (X)) 0 \ + + (__tgmath_real_type (Y)) 0) > sizeof (_Float64) \ +- ? __TGMATH_F128 ((X) + (Y), F, (X, Y)) \ ++ ? __TGMATH_F128LD ((X) + (Y), F, (X, Y)) \ + F ## f64x (X, Y) \ + : F ## f64 (X, Y))) + # define __TGMATH_2_NARROW_F64(F, X, Y) \ + (__extension__ (sizeof ((__tgmath_real_type (X)) 0 \ + + (__tgmath_real_type (Y)) 0) > sizeof (_Float64) \ +- ? __TGMATH_F128 ((X) + (Y), F, (X, Y)) \ ++ ? __TGMATH_F128LD ((X) + (Y), F, (X, Y)) \ + F ## f64x (X, Y) \ + : F ## f128 (X, Y))) ++# endif ++# if !__HAVE_BUILTIN_TGMATH_C2X + # define __TGMATH_2_NARROW_F32X(F, X, Y) \ + (__extension__ (sizeof ((__tgmath_real_type (X)) 0 \ + + (__tgmath_real_type (Y)) 0) > sizeof (_Float64) \ ++ || __TGMATH_NARROW_F32X_USE_F64X ((X) + (Y)) \ + ? __TGMATH_F128 ((X) + (Y), F, (X, Y)) \ + F ## f64x (X, Y) \ + : F ## f64 (X, Y))) +-# elif __HAVE_FLOAT128 ++# endif ++# elif __HAVE_FLOAT128 ++# if !__HAVE_BUILTIN_TGMATH + # define __TGMATH_2_NARROW_F32(F, X, Y) \ + (__extension__ (sizeof ((__tgmath_real_type (X)) 0 \ + + (__tgmath_real_type (Y)) 0) > sizeof (_Float64) \ +@@ -589,16 +666,21 @@ + : F ## f64 (X, Y))) + # define __TGMATH_2_NARROW_F64(F, X, Y) \ + (F ## f128 (X, Y)) ++# endif ++# if !__HAVE_BUILTIN_TGMATH_C2X + # define __TGMATH_2_NARROW_F32X(F, X, Y) \ + (__extension__ (sizeof ((__tgmath_real_type (X)) 0 \ + + (__tgmath_real_type (Y)) 0) > sizeof (_Float32x) \ ++ || __TGMATH_NARROW_F32X_USE_F64X ((X) + (Y)) \ + ? F ## f64x (X, Y) \ + : F ## f64 (X, Y))) +-# else ++# endif ++# else ++# if !__HAVE_BUILTIN_TGMATH + # define __TGMATH_2_NARROW_F32(F, X, Y) \ + (F ## f64 (X, Y)) + # endif +-# endif /* !__HAVE_BUILTIN_TGMATH. */ ++# endif + #else + # error "Unsupported compiler; you cannot use " + #endif diff --git a/glibc.spec b/glibc.spec index a2c8507..94191ec 100644 --- a/glibc.spec +++ b/glibc.spec @@ -155,7 +155,7 @@ end \ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: 72%{?dist} +Release: 73%{?dist} # In general, GPLv2+ is used by programs, LGPLv2+ is used for # libraries. @@ -726,6 +726,11 @@ Patch485: glibc-rh2215368.patch Patch486: glibc-rh2213908.patch Patch487: glibc-rh2189923.patch Patch488: glibc-RHEL-729.patch +Patch489: glibc-rh2222188-1.patch +Patch490: glibc-rh2222188-2.patch +Patch491: glibc-rh2222188-3.patch +Patch492: glibc-rh2222188-4.patch +Patch493: glibc-rh2222188-5.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2883,6 +2888,9 @@ update_gconv_modules_cache () %endif %changelog +* Thu Jul 20 2023 Florian Weimer - 2.34-73 +- GCC Toolset 13 C++ compatibility for iseqsig (#2222188) + * Fri Jul 07 2023 Carlos O'Donell - 2.34-72 - Update ESTALE error message translations (RHEL-729)