From patchwork Mon Apr 6 19:12:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38754 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 98031385DC3E for ; Mon, 6 Apr 2020 19:12:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98031385DC3E Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036J4CJ1076200 for ; Mon, 6 Apr 2020 15:12:41 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 3082pdpras-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 15:12:41 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 036JAmVr004326 for ; Mon, 6 Apr 2020 19:12:40 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02wdc.us.ibm.com with ESMTP id 306hv6aagv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 19:12:40 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036JCe3939453034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 6 Apr 2020 19:12:40 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C840112061 for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1747112063 for ; Mon, 6 Apr 2020 19:12:39 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.183.58]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 19:12:39 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v3 1/6] ldbl-128ibm-compat: workaround GCC 9 C++ BZ 90731 Date: Mon, 6 Apr 2020 14:12:34 -0500 Message-Id: X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_09:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxlogscore=999 suspectscore=1 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060145 X-Spam-Status: No, score=-24.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 19:12:44 -0000 GCC 9 has a bug (BZ 90731) whereby __typeof does not correctly copy exception specifiers[1]. Surprisingly, this can be quieted by declaring "#pragma system_header", or if the headers are installed in a system directory. Work around this by using the pragma for any gcc version between 9.0 and 9.2 to ensure tests continue to compile. [1] Example error from g++ 9.2.1: In file included from ../include/sys/cdefs.h:3, from ../include/features.h:465, from ../bits/libc-header-start.h:33, from ../math/math.h:27, from ../include/math.h:7, from test-math-isinff.cc:21: ../libio/bits/stdio-ldbl.h:25:20: error: declaration of ‘int sprintf(char*, const char*, ...)’ has a different exception specifier 25 | __LDBL_REDIR_DECL (sprintf) | ^~~~~~~ ../misc/sys/cdefs.h:461:26: note: in definition of macro ‘__LDBL_REDIR_DECL’ 461 | extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); | ^~~~ In file included from ../include/stdio.h:5, from test-math-isinff.cc:22: ../libio/stdio.h:334:12: note: from previous declaration ‘int sprintf(char*, const char*, ...) throw ()’ 334 | extern int sprintf (char *__restrict __s, | ^~~~~~~ --- include/monetary.h | 8 ++++++++ include/printf.h | 8 ++++++++ include/stdio.h | 10 ++++++++++ include/stdlib.h | 9 +++++++++ include/wchar.h | 9 +++++++++ 5 files changed, 44 insertions(+) diff --git a/include/monetary.h b/include/monetary.h index 240925e87d..b6da7326c7 100644 --- a/include/monetary.h +++ b/include/monetary.h @@ -1,3 +1,11 @@ +/* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ +#include +#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +# if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) +# pragma GCC system_header +# endif +#endif + #include #ifndef _ISOMAC #include diff --git a/include/printf.h b/include/printf.h index d051514119..7430f9a833 100644 --- a/include/printf.h +++ b/include/printf.h @@ -1,5 +1,13 @@ #ifndef _PRINTF_H +/* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ +#include +#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +# if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) +# pragma GCC system_header +# endif +#endif + #include # ifndef _ISOMAC diff --git a/include/stdio.h b/include/stdio.h index 6718af4108..8ce73c768b 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -2,8 +2,18 @@ # if !defined _ISOMAC && defined _IO_MTSAFE_IO # include # endif + +/* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ +# include +# if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +# if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) +# pragma GCC system_header +# endif +# endif + # include # ifndef _ISOMAC + # define _LIBC_STDIO_H 1 # include diff --git a/include/stdlib.h b/include/stdlib.h index 926f965f69..d1c4d41ba6 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -3,6 +3,15 @@ #ifndef _ISOMAC # include #endif + +/* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ +#include +#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +# if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) +# pragma GCC system_header +# endif +#endif + #include /* Now define the internal interfaces. */ diff --git a/include/wchar.h b/include/wchar.h index 617906eb14..e70d275cad 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -1,4 +1,13 @@ #ifndef _WCHAR_H + +/* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ +# include +# if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +# if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) +# pragma GCC system_header +# endif +# endif + # include # ifndef _ISOMAC From patchwork Mon Apr 6 19:12:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38757 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 0128F385DC3D for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0128F385DC3D Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036J4eff085742 for ; Mon, 6 Apr 2020 15:12:41 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com with ESMTP id 3082hxfpk3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 15:12:41 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 036JAv2p011480 for ; Mon, 6 Apr 2020 19:12:41 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma05wdc.us.ibm.com with ESMTP id 306hv6acbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 19:12:40 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036JCejO39453038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 6 Apr 2020 19:12:40 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 73518112064 for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 386AC112065 for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.183.58]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v3 2/6] Rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI Date: Mon, 6 Apr 2020 14:12:35 -0500 Message-Id: <051ed553501de83ffdf59ac09dd2a73c29f69343.1586199342.git.murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_09:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 mlxscore=0 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060145 X-Spam-Status: No, score=-24.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 19:12:45 -0000 per feedback and disucssion on libc-alpha [2]. Likewise, add documentation to the macro in the common bits/long-double.h header. This is effectively V2 of [2]. Per the feedback from Joseph [1]. Good comments and a more self-explanatory macro name will be very helpful when this macro is able to assume a non-zero value. [1] [2] ---8<--- Improve the commentary to aid future developers who will stumble upon this novel, yet not always perfect, mechanism to support alternative formats for long double. Likewise, rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI now that development work has settled down. The command used was git grep -l __LONG_DOUBLE_USES_FLOAT128 ':!./ChangeLog*' | \ xargs sed -i 's/__LONG_DOUBLE_USES_FLOAT128/__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI/g' --- argp/argp.h | 2 +- bits/long-double.h | 15 ++++++++++++++- elf/tst-addr1.c | 2 +- include/math.h | 6 +++--- include/monetary.h | 2 +- include/printf.h | 2 +- include/stdio.h | 8 ++++---- include/stdlib.h | 4 ++-- include/sys/cdefs.h | 2 +- include/wchar.h | 2 +- libio/bits/stdio-ldbl.h | 4 ++-- libio/stdio.h | 8 ++++---- math/complex.h | 4 ++-- math/math.h | 12 ++++++------ math/test-ldouble.h | 2 +- misc/err.h | 2 +- misc/error.h | 2 +- misc/sys/cdefs.h | 4 ++-- misc/sys/syslog.h | 2 +- stdio-common/printf.h | 2 +- stdio-common/tst-vfprintf-user-type.c | 2 +- stdlib/bits/stdlib-ldbl.h | 2 +- stdlib/monetary.h | 2 +- stdlib/stdlib.h | 2 +- sysdeps/ieee754/ldbl-128/bits/long-double.h | 2 +- .../ieee754/ldbl-128ibm-compat/bits/long-double.h | 7 ++----- sysdeps/ieee754/ldbl-128ibm-compat/math_ldbl.h | 2 +- sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h | 2 +- sysdeps/ieee754/ldbl-128ibm/ieee754.h | 6 +++--- .../ldbl-128ibm/include/bits/iscanonical.h | 2 +- sysdeps/ieee754/ldbl-96/bits/long-double.h | 2 +- sysdeps/ieee754/ldbl-opt/bits/long-double.h | 2 +- sysdeps/mips/ieee754/bits/long-double.h | 2 +- .../sysv/linux/sparc/sparc32/bits/long-double.h | 2 +- .../sysv/linux/sparc/sparc64/bits/long-double.h | 2 +- wcsmbs/bits/wchar-ldbl.h | 4 ++-- wcsmbs/wchar.h | 8 ++++---- 37 files changed, 74 insertions(+), 64 deletions(-) diff --git a/argp/argp.h b/argp/argp.h index 358d9b43cd..a5b861a4d3 100644 --- a/argp/argp.h +++ b/argp/argp.h @@ -555,7 +555,7 @@ __NTH (__option_is_end (const struct argp_option *__opt)) #endif /* Use extern inlines. */ #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/bits/long-double.h b/bits/long-double.h index 6e16447e65..bdde78f49a 100644 --- a/bits/long-double.h +++ b/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/elf/tst-addr1.c b/elf/tst-addr1.c index 27dc0f00f4..93ce669cbd 100644 --- a/elf/tst-addr1.c +++ b/elf/tst-addr1.c @@ -15,7 +15,7 @@ do_test (void) if (i.dli_sname == NULL) return 1; -#if __LONG_DOUBLE_USES_FLOAT128 == 1 +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 /* On architectures which redirect long double to _Float128 (e.g powerpc64le), printf will resolve to __printfieee128 due to header redirects. There diff --git a/include/math.h b/include/math.h index 1b3199b3f6..3979c47400 100644 --- a/include/math.h +++ b/include/math.h @@ -19,7 +19,7 @@ hidden_proto (__isinff) hidden_proto (__isnanf) # if !defined __NO_LONG_DOUBLE_MATH \ - && __LONG_DOUBLE_USES_FLOAT128 == 0 + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 hidden_proto (__finitel) hidden_proto (__isinfl) hidden_proto (__isnanl) @@ -42,7 +42,7 @@ libm_hidden_proto (__expf) libm_hidden_proto (__roundeven) # if !defined __NO_LONG_DOUBLE_MATH \ - && __LONG_DOUBLE_USES_FLOAT128 == 0 + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 libm_hidden_proto (__fpclassifyl) libm_hidden_proto (__issignalingl) libm_hidden_proto (__expl) @@ -143,7 +143,7 @@ fabsf128 (_Float128 x) MATH_REDIRECT_LDBL (FUNC, PREFIX, ARGS) \ MATH_REDIRECT_F128 (FUNC, PREFIX, ARGS) # if defined __NO_LONG_DOUBLE_MATH \ - || __LONG_DOUBLE_USES_FLOAT128 == 1 + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define MATH_REDIRECT_LDBL(FUNC, PREFIX, ARGS) # else # define MATH_REDIRECT_LDBL(FUNC, PREFIX, ARGS) \ diff --git a/include/monetary.h b/include/monetary.h index b6da7326c7..06fd59fd73 100644 --- a/include/monetary.h +++ b/include/monetary.h @@ -1,6 +1,6 @@ /* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ #include -#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __cplusplus && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) # pragma GCC system_header # endif diff --git a/include/printf.h b/include/printf.h index 7430f9a833..13b7f211fc 100644 --- a/include/printf.h +++ b/include/printf.h @@ -2,7 +2,7 @@ /* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ #include -#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __cplusplus && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) # pragma GCC system_header # endif diff --git a/include/stdio.h b/include/stdio.h index 8ce73c768b..1534022f7b 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -5,7 +5,7 @@ /* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ # include -# if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +# if defined __cplusplus && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) # pragma GCC system_header # endif @@ -22,10 +22,10 @@ /* Some libc_hidden_ldbl_proto's do not map to a unique symbol when redirecting ldouble to _Float128 variants. We can therefore safely directly alias them to their internal name. */ -# if __LONG_DOUBLE_USES_FLOAT128 == 1 && IS_IN (libc) +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) # define stdio_hidden_ldbl_proto(p, f) \ extern __typeof (p ## f) p ## f __asm (__ASMNAME ("___ieee128_" #f)); -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define stdio_hidden_ldbl_proto(p,f) __LDBL_REDIR1_DECL (p ## f, p ## f ## ieee128) # else # define stdio_hidden_ldbl_proto(p,f) libc_hidden_proto (p ## f) @@ -101,7 +101,7 @@ libc_hidden_proto (__isoc99_vfscanf) # define sscanf __isoc99_sscanf # endif -# if __LONG_DOUBLE_USES_FLOAT128 == 1 && IS_IN (libc) +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) /* These are implemented as redirects to other public API. Therefore, the usual redirection fails to avoid PLT. */ extern __typeof (__isoc99_sscanf) ___ieee128_isoc99_sscanf __THROW; diff --git a/include/stdlib.h b/include/stdlib.h index d1c4d41ba6..54630de44b 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -6,7 +6,7 @@ /* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ #include -#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __cplusplus && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) # pragma GCC system_header # endif @@ -216,7 +216,7 @@ libc_hidden_proto (____strtoull_l_internal) #include libc_hidden_proto (strtof) libc_hidden_proto (strtod) -#if __LONG_DOUBLE_USES_FLOAT128 == 0 +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 libc_hidden_proto (strtold) #endif libc_hidden_proto (strtol) diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 9f44ac5a0a..6a76160ed4 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -16,7 +16,7 @@ rtld_hidden_proto (__chk_fail) /* If we are using redirects internally to support long double, we need to tweak some macros to ensure the PLT bypass tricks continue to work in libc. */ -#if __LONG_DOUBLE_USES_FLOAT128 == 1 && IS_IN (libc) && defined SHARED +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED # undef __LDBL_REDIR_DECL # define __LDBL_REDIR_DECL(func) \ diff --git a/include/wchar.h b/include/wchar.h index e70d275cad..41812935fb 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -2,7 +2,7 @@ /* Workaround BZ 90731 with GCC 9 when using ldbl redirects in C++. */ # include -# if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1 +# if defined __cplusplus && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) # pragma GCC system_header # endif diff --git a/libio/bits/stdio-ldbl.h b/libio/bits/stdio-ldbl.h index 3bb9f7dd2c..28c44666e3 100644 --- a/libio/bits/stdio-ldbl.h +++ b/libio/bits/stdio-ldbl.h @@ -31,7 +31,7 @@ __LDBL_REDIR_DECL (vsprintf) __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 __LDBL_REDIR1_DECL (fscanf, __isoc99_fscanfieee128) __LDBL_REDIR1_DECL (scanf, __isoc99_scanfieee128) __LDBL_REDIR1_DECL (sscanf, __isoc99_sscanfieee128) @@ -55,7 +55,7 @@ __LDBL_REDIR_DECL (vsnprintf) __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 __LDBL_REDIR1_DECL (vfscanf, __isoc99_vfscanfieee128) __LDBL_REDIR1_DECL (vscanf, __isoc99_vscanfieee128) __LDBL_REDIR1_DECL (vsscanf, __isoc99_vsscanfieee128) diff --git a/libio/stdio.h b/libio/stdio.h index 18e29752c4..21ef36ae70 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -401,11 +401,11 @@ extern int sscanf (const char *__restrict __s, /* For historical reasons, the C99-compliant versions of the scanf functions are at alternative names. When __LDBL_COMPAT or - __LONG_DOUBLE_USES_FLOAT128 are in effect, this is handled in + __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in bits/stdio-ldbl.h. */ #include #if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ - && __LONG_DOUBLE_USES_FLOAT128 == 0 + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (fscanf, (FILE *__restrict __stream, const char *__restrict __format, ...), @@ -451,7 +451,7 @@ extern int vsscanf (const char *__restrict __s, /* Same redirection as above for the v*scanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __REDIRECT && !defined __LDBL_COMPAT \ - && __LONG_DOUBLE_USES_FLOAT128 == 0 + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 extern int __REDIRECT (vfscanf, (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg), @@ -872,7 +872,7 @@ extern int __overflow (FILE *, int); #endif #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/math/complex.h b/math/complex.h index b6d175e800..7c06add10c 100644 --- a/math/complex.h +++ b/math/complex.h @@ -126,7 +126,7 @@ __BEGIN_DECLS # undef __MATHDECL_1 # define __MATHDECL_1(type, function, args) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __MATHDECL_1 # undef __MATHDECL # define __REDIR_TO(function) \ @@ -142,7 +142,7 @@ __BEGIN_DECLS # define __MATH_PRECNAME(name) name##l # include # if defined __LDBL_COMPAT \ - || __LONG_DOUBLE_USES_FLOAT128 == 1 + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __REDIR_TO # undef __MATHDECL_1 # undef __MATHDECL diff --git a/math/math.h b/math/math.h index 5c3dcb9194..baa2e5e11b 100644 --- a/math/math.h +++ b/math/math.h @@ -343,7 +343,7 @@ extern long double __REDIRECT_NTH (nexttowardl, # define __MATHDECL_1(type, function,suffix, args) \ __MATHREDIR(type, function, suffix, args, __CONCAT(function,suffix)) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # ifdef __REDIRECT_NTH # ifdef __USE_ISOC99 extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), @@ -390,7 +390,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef __MATH_DECLARING_FLOATN # if defined __LDBL_COMPAT \ - || __LONG_DOUBLE_USES_FLOAT128 == 1 + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __REDIRTO # undef __REDIRTO_ALT # undef __MATHDECL_1 @@ -562,7 +562,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define __MATHCALL_REDIR_NAME(name) __ ## f32 ## name ## ieee128 # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -573,7 +573,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef _Marg_ # undef __MATHCALL_NAME # if defined __LDBL_COMPAT \ - || __LONG_DOUBLE_USES_FLOAT128 == 1 + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -588,7 +588,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define __MATHCALL_REDIR_NAME(name) __ ## f64 ## name ## ieee128 # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -599,7 +599,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), # undef _Marg_ # undef __MATHCALL_NAME # if defined __LDBL_COMPAT \ - || __LONG_DOUBLE_USES_FLOAT128 == 1 + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ diff --git a/math/test-ldouble.h b/math/test-ldouble.h index b9ef6f41f9..3d62c92e14 100644 --- a/math/test-ldouble.h +++ b/math/test-ldouble.h @@ -29,7 +29,7 @@ /* On architectures which redirect long double to _Float128 ABI, we must choose the float128 ulps. Similarly, on such architectures, the ABI used may be dependent on how the compiler was invoked. */ -#elif __LONG_DOUBLE_USES_FLOAT128 == 1 +#elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define TYPE_STR "float128" # define ULP_IDX ULP_FLT128 #else diff --git a/misc/err.h b/misc/err.h index d146a55054..e56cd73c0e 100644 --- a/misc/err.h +++ b/misc/err.h @@ -53,7 +53,7 @@ extern void verrx (int __status, const char *, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/misc/error.h b/misc/error.h index bb8a3b26a4..41d54c568f 100644 --- a/misc/error.h +++ b/misc/error.h @@ -48,7 +48,7 @@ extern unsigned int error_message_count; extern int error_one_per_line; #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #else /* Do not inline error and error_at_line when long double has the same diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index dd5f69f833..9fa371ab86 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -452,7 +452,7 @@ #include #include -#if __LONG_DOUBLE_USES_FLOAT128 == 1 +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # ifdef __REDIRECT /* Alias name defined automatically. */ @@ -503,7 +503,7 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif -#if (!defined __LDBL_COMPAT && __LONG_DOUBLE_USES_FLOAT128 == 0) \ +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h index c000b8e915..dc3b0e7ef8 100644 --- a/misc/sys/syslog.h +++ b/misc/sys/syslog.h @@ -208,7 +208,7 @@ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) #endif #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/stdio-common/printf.h b/stdio-common/printf.h index 00bedebfdb..7dccfcd6fb 100644 --- a/stdio-common/printf.h +++ b/stdio-common/printf.h @@ -183,7 +183,7 @@ extern int printf_size_info (const struct printf_info *__restrict __THROW; #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/stdio-common/tst-vfprintf-user-type.c b/stdio-common/tst-vfprintf-user-type.c index 40d714fdb1..0abd61cea3 100644 --- a/stdio-common/tst-vfprintf-user-type.c +++ b/stdio-common/tst-vfprintf-user-type.c @@ -147,7 +147,7 @@ do_test (void) /* Alias declaration for asprintf, to avoid the format string attribute and the associated warning. */ -#if __LONG_DOUBLE_USES_FLOAT128 == 1 +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 extern int asprintf_alias (char **, const char *, ...) __asm__ ("__asprintfieee128"); #else extern int asprintf_alias (char **, const char *, ...) __asm__ ("asprintf"); diff --git a/stdlib/bits/stdlib-ldbl.h b/stdlib/bits/stdlib-ldbl.h index 2469474532..cc8831dd16 100644 --- a/stdlib/bits/stdlib-ldbl.h +++ b/stdlib/bits/stdlib-ldbl.h @@ -51,7 +51,7 @@ __LDBL_REDIR1_DECL (qfcvt, fcvt) __LDBL_REDIR1_DECL (qgcvt, gcvt) __LDBL_REDIR1_DECL (qecvt_r, ecvt_r) __LDBL_REDIR1_DECL (qfcvt_r, fcvt_r) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 __LDBL_REDIR1_DECL (qecvt, __qecvtieee128) __LDBL_REDIR1_DECL (qfcvt, __qfcvtieee128) __LDBL_REDIR1_DECL (qgcvt, __qgcvtieee128) diff --git a/stdlib/monetary.h b/stdlib/monetary.h index 4a6d61fd2d..c9d3c64e14 100644 --- a/stdlib/monetary.h +++ b/stdlib/monetary.h @@ -51,7 +51,7 @@ extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize, #endif #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index a7c0c71a80..9b7537c545 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -1018,7 +1018,7 @@ extern int ttyslot (void) __THROW; #endif #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/sysdeps/ieee754/ldbl-128/bits/long-double.h b/sysdeps/ieee754/ldbl-128/bits/long-double.h index 941e60505f..dd64a06db6 100644 --- a/sysdeps/ieee754/ldbl-128/bits/long-double.h +++ b/sysdeps/ieee754/ldbl-128/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/bits/long-double.h b/sysdeps/ieee754/ldbl-128ibm-compat/bits/long-double.h index 91dddbdc8b..ef834c7748 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/bits/long-double.h +++ b/sysdeps/ieee754/ldbl-128ibm-compat/bits/long-double.h @@ -22,8 +22,5 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -/* On platforms that reuse the _Float128 implementation for IEEE long - double, access to the correct long double functions is selected based - on the long double mode being used during the compilation. On - powerpc64le, this is true when -mabi=ieeelongdouble is in use. */ -#define __LONG_DOUBLE_USES_FLOAT128 (__LDBL_MANT_DIG__ == 113) + +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI (__LDBL_MANT_DIG__ == 113) diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/math_ldbl.h b/sysdeps/ieee754/ldbl-128ibm-compat/math_ldbl.h index 352617e178..5490b400dd 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/math_ldbl.h +++ b/sysdeps/ieee754/ldbl-128ibm-compat/math_ldbl.h @@ -23,7 +23,7 @@ /* Trampoline in the ldbl-128ibm headers if building against the old abi. Otherwise, we have nothing to add. */ -#if __LONG_DOUBLE_USES_FLOAT128 == 0 +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 #include_next #endif diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h index b2021b5d64..e60b3017eb 100644 --- a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h +++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#if defined (__NO_LONG_DOUBLE_MATH) || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/sysdeps/ieee754/ldbl-128ibm/ieee754.h b/sysdeps/ieee754/ldbl-128ibm/ieee754.h index fe4892d84f..b66e3b9869 100644 --- a/sysdeps/ieee754/ldbl-128ibm/ieee754.h +++ b/sysdeps/ieee754/ldbl-128ibm/ieee754.h @@ -112,7 +112,7 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ -#if __LONG_DOUBLE_USES_FLOAT128 == 1 +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 /* long double is IEEE 128 bit */ union ieee854_long_double { @@ -170,7 +170,7 @@ union ieee854_long_double #endif -#if __LONG_DOUBLE_USES_FLOAT128 == 0 || __GNUC_PREREQ (7, 0) +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -183,7 +183,7 @@ union ieee854_long_double NaN is don't-care. */ union ibm_extended_long_double { -# if __LONG_DOUBLE_USES_FLOAT128 == 1 && __GNUC_PREREQ (7, 0) +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) __ibm128 ld; # else long double ld; diff --git a/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h index 8cbd6f74bf..60d5417089 100644 --- a/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h +++ b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h @@ -1,5 +1,5 @@ #include_next -#if !defined _ISOMAC && (__LONG_DOUBLE_USES_FLOAT128 == 0) +#if !defined _ISOMAC && (__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) libm_hidden_proto (__iscanonicall) #endif diff --git a/sysdeps/ieee754/ldbl-96/bits/long-double.h b/sysdeps/ieee754/ldbl-96/bits/long-double.h index b77124f842..9a2cd0dfe4 100644 --- a/sysdeps/ieee754/ldbl-96/bits/long-double.h +++ b/sysdeps/ieee754/ldbl-96/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/sysdeps/ieee754/ldbl-opt/bits/long-double.h b/sysdeps/ieee754/ldbl-opt/bits/long-double.h index 242e58410d..48688ad7e1 100644 --- a/sysdeps/ieee754/ldbl-opt/bits/long-double.h +++ b/sysdeps/ieee754/ldbl-opt/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/sysdeps/mips/ieee754/bits/long-double.h b/sysdeps/mips/ieee754/bits/long-double.h index 57007a84d6..1ad74e4497 100644 --- a/sysdeps/mips/ieee754/bits/long-double.h +++ b/sysdeps/mips/ieee754/bits/long-double.h @@ -21,4 +21,4 @@ #if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h index 7046cd40d7..107c5d179b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h index 7046cd40d7..107c5d179b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 diff --git a/wcsmbs/bits/wchar-ldbl.h b/wcsmbs/bits/wchar-ldbl.h index 75d547f680..1b063d1235 100644 --- a/wcsmbs/bits/wchar-ldbl.h +++ b/wcsmbs/bits/wchar-ldbl.h @@ -32,7 +32,7 @@ __LDBL_REDIR_DECL (vswprintf); __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 __LDBL_REDIR1_DECL (fwscanf, __isoc99_fwscanfieee128) __LDBL_REDIR1_DECL (wscanf, __isoc99_wscanfieee128) __LDBL_REDIR1_DECL (swscanf, __isoc99_swscanfieee128) @@ -57,7 +57,7 @@ __LDBL_REDIR1_DECL (wcstold, __wcstoieee128) __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) -# elif __LONG_DOUBLE_USES_FLOAT128 == 1 +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 __LDBL_REDIR1_DECL (vfwscanf, __isoc99_vfwscanfieee128) __LDBL_REDIR1_DECL (vwscanf, __isoc99_vwscanfieee128) __LDBL_REDIR1_DECL (vswscanf, __isoc99_vswscanfieee128) diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index fb2cec8167..9cf8b05a87 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -634,10 +634,10 @@ extern int swscanf (const wchar_t *__restrict __s, /* For historical reasons, the C99-compliant versions of the scanf functions are at alternative names. When __LDBL_COMPAT or - __LONG_DOUBLE_USES_FLOAT128 are in effect, this is handled in + __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in bits/wchar-ldbl.h. */ #if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ - && __LONG_DOUBLE_USES_FLOAT128 == 0 + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), @@ -691,7 +691,7 @@ extern int vswscanf (const wchar_t *__restrict __s, # if !__GLIBC_USE (DEPRECATED_SCANF) \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) \ - && __LONG_DOUBLE_USES_FLOAT128 == 0 + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, @@ -853,7 +853,7 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, #endif #include -#if defined __LDBL_COMPAT || __LONG_DOUBLE_USES_FLOAT128 == 1 +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif From patchwork Mon Apr 6 19:12:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38756 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 4BE37385E00A for ; Mon, 6 Apr 2020 19:12:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4BE37385E00A Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036J3ou2026860 for ; Mon, 6 Apr 2020 15:12:42 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 306nvv2u5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 15:12:42 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 036JBwsN024596 for ; Mon, 6 Apr 2020 19:12:41 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02dal.us.ibm.com with ESMTP id 306hv6pxmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 19:12:41 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036JCe0Y34865560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 6 Apr 2020 19:12:40 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD6F8112065 for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8EA41112063 for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.183.58]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v3 3/6] powerpc64le: raise GCC requirement to 7.4 for long double transition Date: Mon, 6 Apr 2020 14:12:36 -0500 Message-Id: X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_09:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 malwarescore=0 phishscore=0 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=1 lowpriorityscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060145 X-Spam-Status: No, score=-24.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 19:12:45 -0000 Add compiler feature tests to ensure we can build ieee128 long double. These test for -mabi=ieeelongdouble, -mno-gnu-attribute, and -Wno-psabi. Likewise, verify some compiler bugs have been addressed. These aren't helpful for building glibc, but may cause test failures when testing the new long double. See notes below from Raji. On powerpc64le, some older compiler versions give error for the function signbit() for 128-bit floating point types. This is fixed by PR83862 in gcc 8.0 and backported to gcc6 and gcc7. This patch adds a test to check compiler version to avoid compiler errors during make check. Likewise, test for -mno-gnu-attribute support which was On powerpc64le, a few files are built on IEEE long double mode (-mabi=ieeelongdouble), whereas most are built on IBM long double mode (-mabi=ibmlongdouble, the default for -mlong-double-128). Since binutils 2.31, linking object files with different long double modes causes errors similar to: ld: libc_pic.a(s_isinfl.os) uses IBM long double, libc_pic.a(ieee128-qefgcvt.os) uses IEEE long double. collect2: error: ld returned 1 exit status make[2]: *** [../Makerules:649: libc_pic.os] Error 1 The warnings are fair and correct, but in order for glibc to have support for both long double modes on powerpc64le, they have to be ignored. This can be accomplished with the use of -mno-gnu-attribute option when building the few files that require IEEE long double mode. However, -mno-gnu-attribute is not available in GCC 6, the minimum version required to build glibc, so this patch adds a test for this feature in powerpc64le builds, and fails early if it's not available. Co-Authored-By: Rajalakshmi Srinivasaraghavan Co-Authored-By: Gabriel F. T. Gomes --- INSTALL | 6 +++ NEWS | 3 +- manual/install.texi | 5 ++ sysdeps/powerpc/powerpc64/le/configure | 59 +++++++++++++++++++++++ sysdeps/powerpc/powerpc64/le/configure.ac | 35 ++++++++++++++ 5 files changed, 107 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 242cb06f91..d7c109358c 100644 --- a/INSTALL +++ b/INSTALL @@ -467,6 +467,12 @@ build the GNU C Library: better code. As of release time, GCC 9.2.1 is the newest compiler verified to work to build the GNU C Library. + For PowerPC 64-bits little-endian (powerpc64le), a GCC version with + support for '-mno-gnu-attribute' is required. As of release time, + this means GCC 7.4 (excepting 7.5) or newer. The compiler option + is required for building the GNU C Library with support for IEEE + long double. + For multi-arch support it is recommended to use a GCC which has been built with support for GNU indirect functions. This ensures that correct debugging information is generated for functions diff --git a/NEWS b/NEWS index 3cf738adfb..07da1545b4 100644 --- a/NEWS +++ b/NEWS @@ -20,7 +20,8 @@ Deprecated and removed features, and other changes affecting compatibility: Changes to build and runtime requirements: - [Add changes to build and runtime requirements here] +* powerpc64le requires GCC 7.4 or newer. This is required for supporting + long double redirects. Security related changes: diff --git a/manual/install.texi b/manual/install.texi index 71bf47cac6..66de8ea59b 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -507,6 +507,11 @@ the newest version of the compiler that is known to work for building release time, GCC 9.2.1 is the newest compiler verified to work to build @theglibc{}. +For PowerPC 64-bits little-endian (powerpc64le), a GCC version with +support for @option{-mno-gnu-attribute} is required. As of release time, +this means GCC 7.4 (excepting 7.5) or newer. The compiler option is required +for building the GNU C Library with support for IEEE long double. + For multi-arch support it is recommended to use a GCC which has been built with support for GNU indirect functions. This ensures that correct debugging information is generated for functions selected by IFUNC resolvers. This diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure index bca80cec76..4b4d6cff6f 100644 --- a/sysdeps/powerpc/powerpc64/le/configure +++ b/sysdeps/powerpc/powerpc64/le/configure @@ -32,4 +32,63 @@ if test "$libc_cv_target_power8_ok" != "yes"; then : fi CFLAGS="$OLD_CFLAGS" +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mno-gnu-attribute" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler supports -mno-gnu-attribute" >&5 +$as_echo_n "checking if the compiler supports -mno-gnu-attribute... " >&6; } +if ${libc_cv_no_gnu_attr_ok+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_cv_no_gnu_attr_ok=yes +else + libc_cv_no_gnu_attr_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_no_gnu_attr_ok" >&5 +$as_echo "$libc_cv_no_gnu_attr_ok" >&6; } +if test "$libc_cv_no_gnu_attr_ok" != "yes"; then : + critic_missing="$critic_missing A compiler with -mno-gnu-attribute is required on powerpc64le." +fi +CFLAGS="$OLD_CFLAGS" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC compiles signbit with 128-bit floating point type" >&5 +$as_echo_n "checking if $CC compiles signbit with 128-bit floating point type... " >&6; } +if ${libc_cv_compiler_powerpc64le_ice+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mabi=ieeelongdouble -Wno-psabi" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int sbr (long double a) { return __builtin_signbit (a); } +int sbm (long double *a) { return __builtin_signbit (*a); } +int sbo (long double *a) { return __builtin_signbit (a[4]); } +int sbi (long double *a, unsigned long n) { return __builtin_signbit (a[n]); } +void sbs (int *p, long double a) { *p = __builtin_signbit (a); } + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_cv_compiler_powerpc64le_ice=yes +else + libc_cv_compiler_powerpc64le_ice=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$save_CFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_ice" >&5 +$as_echo "$libc_cv_compiler_powerpc64le_ice" >&6; } +if test "$libc_cv_compiler_powerpc64le_ice" != "yes"; then : + critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (BZ 83862)." +fi + + test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5 diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac index 7f2c9fbf1f..26a54beaa0 100644 --- a/sysdeps/powerpc/powerpc64/le/configure.ac +++ b/sysdeps/powerpc/powerpc64/le/configure.ac @@ -17,4 +17,39 @@ AS_IF([test "$libc_cv_target_power8_ok" != "yes"], [critic_missing="$critic_missing POWER8 or newer is required on powerpc64le."]) CFLAGS="$OLD_CFLAGS" +dnl Require support for -mno-gnu-attribute +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mno-gnu-attribute" +AC_CACHE_CHECK([if the compiler supports -mno-gnu-attribute], + libc_cv_no_gnu_attr_ok, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +]])], + [libc_cv_no_gnu_attr_ok=yes], + [libc_cv_no_gnu_attr_ok=no])]) +AS_IF([test "$libc_cv_no_gnu_attr_ok" != "yes"], + [critic_missing="$critic_missing A compiler with -mno-gnu-attribute is required on powerpc64le."]) +CFLAGS="$OLD_CFLAGS" + +dnl Some old compiler versions give error for the function signbit() for +dnl 128-bit floating point types. This is fixed by BZ 83862 and backported +dnl to gcc6 and gcc7. This test is to check if we are using the compiler +dnl that has this bug. (available in GCC 8.0). +AC_CACHE_CHECK([if $CC compiles signbit with 128-bit floating point type], + libc_cv_compiler_powerpc64le_ice, [dnl +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mabi=ieeelongdouble -Wno-psabi" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +int sbr (long double a) { return __builtin_signbit (a); } +int sbm (long double *a) { return __builtin_signbit (*a); } +int sbo (long double *a) { return __builtin_signbit (a[4]); } +int sbi (long double *a, unsigned long n) { return __builtin_signbit (a[n]); } +void sbs (int *p, long double a) { *p = __builtin_signbit (a); } +]])], + [libc_cv_compiler_powerpc64le_ice=yes], + [libc_cv_compiler_powerpc64le_ice=no]) +CFLAGS="$save_CFLAGS"]) +AS_IF([test "$libc_cv_compiler_powerpc64le_ice" != "yes"], + [critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (BZ 83862)."]) + + test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing]) From patchwork Mon Apr 6 19:12:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38759 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id AABB6385E01F for ; Mon, 6 Apr 2020 19:12:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AABB6385E01F Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036J3oqM026885 for ; Mon, 6 Apr 2020 15:12:42 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 306nvv2u5w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 15:12:42 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 036JAjiS032718 for ; Mon, 6 Apr 2020 19:12:41 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04dal.us.ibm.com with ESMTP id 306hv5xxa1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 19:12:41 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036JCfjp14352984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 6 Apr 2020 19:12:41 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 10BBD112063 for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D612A112061 for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.183.58]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 19:12:40 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v3 4/6] powerpc64le: bump binutils version requirement to >= 2.26 Date: Mon, 6 Apr 2020 14:12:37 -0500 Message-Id: X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_09:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 malwarescore=0 phishscore=0 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=1 lowpriorityscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060145 X-Spam-Status: No, score=-24.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 19:12:45 -0000 This is a small step up from 2.25 which brings in support for rewriting the .gnu.attributes section of libc/libm.so. Reviewed-by: Tulio Magno Quites Machado Filho --- INSTALL | 4 ++ manual/install.texi | 4 ++ sysdeps/powerpc/powerpc64/le/configure | 65 +++++++++++++++++++++++ sysdeps/powerpc/powerpc64/le/configure.ac | 6 +++ 4 files changed, 79 insertions(+) diff --git a/INSTALL b/INSTALL index d7c109358c..551ca9434e 100644 --- a/INSTALL +++ b/INSTALL @@ -495,6 +495,10 @@ build the GNU C Library: moment. As of release time, GNU 'binutils' 2.32 is the newest verified to work to build the GNU C Library. + For PowerPC 64-bits little-endian (powerpc64le), binutils is + required to support the '--update-section'. This option requires + binutils 2.26 or newer. + * GNU 'texinfo' 4.7 or later To correctly translate and install the Texinfo documentation you diff --git a/manual/install.texi b/manual/install.texi index 66de8ea59b..acbcc8c091 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -533,6 +533,10 @@ No other assembler or linker has the necessary functionality at the moment. As of release time, GNU @code{binutils} 2.32 is the newest verified to work to build @theglibc{}. +For PowerPC 64-bits little-endian (powerpc64le), binutils is required +to support the @option{--update-section}. This option requires binutils +2.26 or newer. + @item GNU @code{texinfo} 4.7 or later diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure index 4b4d6cff6f..b08c3e0587 100644 --- a/sysdeps/powerpc/powerpc64/le/configure +++ b/sysdeps/powerpc/powerpc64/le/configure @@ -90,5 +90,70 @@ if test "$libc_cv_compiler_powerpc64le_ice" != "yes"; then : critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (BZ 83862)." fi +# Binutils (objcopy) 2.26 or newer required to support the --update-section +# feature for fixing up .gnu.attribute section with IEEE ldbl. +for ac_prog in $OBJCOPY +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJCOPY="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJCOPY=$ac_cv_prog_OBJCOPY +if test -n "$OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OBJCOPY" && break +done + +if test -z "$OBJCOPY"; then + ac_verc_fail=yes +else + # Found it, now check the version. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $OBJCOPY" >&5 +$as_echo_n "checking version of $OBJCOPY... " >&6; } + ac_prog_version=`$OBJCOPY --version 2>&1 | sed -n 's/^.*GNU objcopy.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 +$as_echo "$ac_prog_version" >&6; } +fi +if test $ac_verc_fail = yes; then + AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le" +fi + test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5 diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac index 26a54beaa0..630086bd88 100644 --- a/sysdeps/powerpc/powerpc64/le/configure.ac +++ b/sysdeps/powerpc/powerpc64/le/configure.ac @@ -51,5 +51,11 @@ CFLAGS="$save_CFLAGS"]) AS_IF([test "$libc_cv_compiler_powerpc64le_ice" != "yes"], [critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (BZ 83862)."]) +# Binutils (objcopy) 2.26 or newer required to support the --update-section +# feature for fixing up .gnu.attribute section with IEEE ldbl. +AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version, + [GNU objcopy.* \([0-9]*\.[0-9.]*\)], + [2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], + AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le") test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing]) From patchwork Mon Apr 6 19:12:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38760 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id D3E02385E021 for ; Mon, 6 Apr 2020 19:12:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D3E02385E021 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036J4CJ2076200 for ; Mon, 6 Apr 2020 15:12:43 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3082pdprbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 15:12:42 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 036JAj9H023610 for ; Mon, 6 Apr 2020 19:12:42 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02dal.us.ibm.com with ESMTP id 306hv6pxmt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 19:12:42 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036JCfQA28115436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 6 Apr 2020 19:12:41 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5896D112064 for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29163112061 for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.183.58]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v3 5/6] powerpc64le: blacklist broken GCC compilers (e.g GCC 7.5.0) Date: Mon, 6 Apr 2020 14:12:38 -0500 Message-Id: X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_09:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxlogscore=999 suspectscore=1 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060145 X-Spam-Status: No, score=-25.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 19:12:45 -0000 GCC 7.5.0 (BZ# 94200) will refuse to compile if both -mabi=% and -mlong-double-128 are passed on the command line. Surprisingly, it will work happily if the latter is not. For the sake of maintianing status quo, test for and blacklist such compilers. Tested with a GCC 8.3.1 and GCC 7.5.0 compiler for ppc64le. --- sysdeps/ieee754/ldbl-128ibm-compat/Makefile | 12 --------- sysdeps/powerpc/powerpc64/le/configure | 27 +++++++++++++++++++++ sysdeps/powerpc/powerpc64/le/configure.ac | 15 ++++++++++++ 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile index 0ac52a53bc..7b42746c34 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile @@ -249,13 +249,6 @@ ldbl-extra-routines += err \ CFLAGS-ieee128-qefgcvt.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute CFLAGS-ieee128-qefgcvt_r.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute -# Remove -mlong-double-128 because it does not work correctly with -# -mabi=ibmlongdoule in some GCC versions, e.g. GCC 7. -$(foreach o,$(all-object-suffixes),$(objpfx)ieee128-qefgcvt$(o)): \ - sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS)) -$(foreach o,$(all-object-suffixes),$(objpfx)ieee128-qefgcvt_r$(o)): \ - sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS)) - tests-internal += tst-ibm128-warn tst-ieee128-warn tests-internal += tst-ibm128-error tst-ieee128-error tests-internal += tst-ibm128-efgcvt tst-ieee128-efgcvt @@ -348,11 +341,6 @@ ldbl-ibm128-files := $(objpfx)test-%-ibm128^ \ $(foreach r,$(ldbl-extra-routines),$(objpfx)$(r)-internal^) obj-suf-foreach = $(foreach suf,$(all-object-suffixes),$(subst ^,$(suf),$(1))) -# Remove -mlong-double-128 because it does not work correctly with -# -mabi=ibmlongdoule in some GCC versions, e.g. GCC 7. -$(call obj-suf-foreach,$(ldbl-ibm128-files)): \ - sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS)) - # Explicitly add -mabi=ibm-long-double to required files. $(call obj-suf-foreach,$(ldbl-ibm128-files)): \ sysdep-CFLAGS += -mabi=ibmlongdouble diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure index b08c3e0587..f7f0804b7f 100644 --- a/sysdeps/powerpc/powerpc64/le/configure +++ b/sysdeps/powerpc/powerpc64/le/configure @@ -90,6 +90,33 @@ if test "$libc_cv_compiler_powerpc64le_ice" != "yes"; then : critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (BZ 83862)." fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC compiles with -mabi=ieeelongdouble and -mlong-double-128" >&5 +$as_echo_n "checking if $CC compiles with -mabi=ieeelongdouble and -mlong-double-128... " >&6; } +if ${libc_cv_compiler_powerpc64le_ldbl128_mabi+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mabi=ieeelongdouble -mlong-double-128" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +long double x; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_cv_compiler_powerpc64le_ldbl128_mabi=yes +else + libc_cv_compiler_powerpc64le_ldbl128_mabi=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$save_CFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_ldbl128_mabi" >&5 +$as_echo "$libc_cv_compiler_powerpc64le_ldbl128_mabi" >&6; } +if test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"; then : + critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlongdouble simultaneously." +fi + # Binutils (objcopy) 2.26 or newer required to support the --update-section # feature for fixing up .gnu.attribute section with IEEE ldbl. for ac_prog in $OBJCOPY diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac index 630086bd88..dde956505c 100644 --- a/sysdeps/powerpc/powerpc64/le/configure.ac +++ b/sysdeps/powerpc/powerpc64/le/configure.ac @@ -51,6 +51,21 @@ CFLAGS="$save_CFLAGS"]) AS_IF([test "$libc_cv_compiler_powerpc64le_ice" != "yes"], [critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (BZ 83862)."]) +dnl Some old compiler versions give out error messages when combining +dnl -mabi=% and -mlong-double-128. i.e GCC 7.5.0 (BZ# 94200) +AC_CACHE_CHECK([if $CC compiles with -mabi=ieeelongdouble and -mlong-double-128], + libc_cv_compiler_powerpc64le_ldbl128_mabi, [dnl +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mabi=ieeelongdouble -mlong-double-128" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +long double x; +]])], + [libc_cv_compiler_powerpc64le_ldbl128_mabi=yes], + [libc_cv_compiler_powerpc64le_ldbl128_mabi=no]) +CFLAGS="$save_CFLAGS"]) +AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"], + [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlongdouble simultaneously."]) + # Binutils (objcopy) 2.26 or newer required to support the --update-section # feature for fixing up .gnu.attribute section with IEEE ldbl. AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version, From patchwork Mon Apr 6 19:12:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38758 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 609FC385E018 for ; Mon, 6 Apr 2020 19:12:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 609FC385E018 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036J8uWw019773 for ; Mon, 6 Apr 2020 15:12:43 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0b-001b2d01.pphosted.com with ESMTP id 3082f1pu2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 15:12:43 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 036JBmKR001246 for ; Mon, 6 Apr 2020 19:12:42 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma04dal.us.ibm.com with ESMTP id 306hv5xxa5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Apr 2020 19:12:42 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036JCfAk49283340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 6 Apr 2020 19:12:41 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0637112061 for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 706DA112063 for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.183.58]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 19:12:41 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v3 6/6] powerpc64le: Enable support for IEEE long double Date: Mon, 6 Apr 2020 14:12:39 -0500 Message-Id: X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_09:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 mlxscore=0 spamscore=0 clxscore=1015 malwarescore=0 adultscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060145 X-Spam-Status: No, score=-24.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 19:12:45 -0000 From: "Gabriel F. T. Gomes" Changes since v5: - Rebase against inline math test removal Changes since v4: - More Makefile massaging - Add ULPs for ieee128 only _Float128 redirects - Update for glibc 2.32 - Add short NEWS entry Changes since v4: - Removed the redirections code (moved to a separate commit). No changes since v3. Changes since v2: - Added definition of LDBL_IBM128_COMPAT_VERSION and LDBL_IBM128_VERSION (moved from a previous commit). Changes since v1: - Use __LONG_DOUBLE_USES_FLOAT128 directly. -- 8< -- On platforms where long double may have two different formats, i.e.: the same format as double (64-bits) or something else (128-bits), building with -mlong-double-128 is the default and function calls in the user program match the name of the function in Glibc. When building with -mlong-double-64, Glibc installed headers redirect such calls to the appropriate function. Likewise, the internals of glibc are now built against IEEE long double. However, the only (minimally) notable usage of long double is difftime. --- NEWS | 5 + sysdeps/powerpc/fpu/libm-test-ulps | 4 + sysdeps/powerpc/powerpc64/le/Implies-before | 1 + sysdeps/powerpc/powerpc64/le/Makefile | 4 + .../powerpc64/le/ldbl-128ibm-compat-abi.h | 8 ++ .../linux/powerpc/powerpc64/le/libc.abilist | 93 ++++++++++++++ .../linux/powerpc/powerpc64/le/libm.abilist | 117 ++++++++++++++++++ 7 files changed, 232 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h diff --git a/NEWS b/NEWS index 07da1545b4..a54c0e0f65 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,11 @@ Major new features: * The GNU C Library now loads audit modules listed in the DT_AUDIT and DT_DEPAUDIT dynamic section entries of the main executable. +* powerpc64le supports IEEE128 long double libm/libc redirects when + using the -mabi=ieeelongdouble to compile C code on supported GCC + toolchains. It is recommended to use GCC 8 or newer when testing + this option. + Deprecated and removed features, and other changes affecting compatibility: [Add deprecations, removals and changes affecting compatibility here] diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps index 73f18cf1df..695c5eee7e 100644 --- a/sysdeps/powerpc/fpu/libm-test-ulps +++ b/sysdeps/powerpc/fpu/libm-test-ulps @@ -1264,21 +1264,25 @@ ldouble: 1 Function: "gamma": double: 3 float: 4 +float128: 5 ldouble: 3 Function: "gamma_downward": double: 4 float: 4 +float128: 8 ldouble: 15 Function: "gamma_towardzero": double: 4 float: 3 +float128: 5 ldouble: 16 Function: "gamma_upward": double: 4 float: 5 +float128: 8 ldouble: 11 Function: "hypot": diff --git a/sysdeps/powerpc/powerpc64/le/Implies-before b/sysdeps/powerpc/powerpc64/le/Implies-before index 7c20db4e97..2139f4dae8 100644 --- a/sysdeps/powerpc/powerpc64/le/Implies-before +++ b/sysdeps/powerpc/powerpc64/le/Implies-before @@ -1,4 +1,5 @@ # On PowerPC we use the IBM extended long double format. +ieee754/ldbl-128ibm-compat ieee754/ldbl-128ibm ieee754/ldbl-opt ieee754/dbl-64 diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile index 6afa1228dd..05ab13d85c 100644 --- a/sysdeps/powerpc/powerpc64/le/Makefile +++ b/sysdeps/powerpc/powerpc64/le/Makefile @@ -20,6 +20,10 @@ no-gnu-attribute-CFLAGS = -mno-gnu-attribute # We built an object file and extract the desired .gnu.attributes section # to be inserted into lib{c,m}.so. ifeq ($(build-shared),yes) + +# Build everything with IEEE 128-bit long double. +sysdep-CFLAGS += -mabi=ieeelongdouble -Wno-psabi $(no-gnu-attribute-CFLAGS) + before-compile += $(common-objpfx)no_ldbl_gnu_attribute.bin $(common-objpfx)no_ldbl_gnu_attribute.bin: $(..)sysdeps/powerpc/powerpc64/le/no_ldbl_gnu_attribute.c diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h new file mode 100644 index 0000000000..34c7b6bed6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ldbl-128ibm-compat-abi.h @@ -0,0 +1,8 @@ +/* ABI version for long double switch to IEEE 128-bit floating point.. + This is used by the Versions and math_ldbl_opt.h files in + sysdeps/ieee754/ldbl-128ibm-compat/. It gives the ABI version where + long double == ibm128 was replaced with long double == _Float128 + for libm *l functions and libc functions using long double. */ + +#define LDBL_IBM128_VERSION GLIBC_2.32 +#define LDBL_IBM128_COMPAT_VERSION GLIBC_2_32 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 2229a1dcc0..c0ca0d6907 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2247,3 +2247,96 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __argp_errorieee128 F +GLIBC_2.32 __argp_failureieee128 F +GLIBC_2.32 __asprintf_chkieee128 F +GLIBC_2.32 __asprintfieee128 F +GLIBC_2.32 __dprintf_chkieee128 F +GLIBC_2.32 __dprintfieee128 F +GLIBC_2.32 __errieee128 F +GLIBC_2.32 __error_at_lineieee128 F +GLIBC_2.32 __errorieee128 F +GLIBC_2.32 __errxieee128 F +GLIBC_2.32 __fprintf_chkieee128 F +GLIBC_2.32 __fprintfieee128 F +GLIBC_2.32 __fscanfieee128 F +GLIBC_2.32 __fwprintf_chkieee128 F +GLIBC_2.32 __fwprintfieee128 F +GLIBC_2.32 __fwscanfieee128 F +GLIBC_2.32 __isoc99_fscanfieee128 F +GLIBC_2.32 __isoc99_fwscanfieee128 F +GLIBC_2.32 __isoc99_scanfieee128 F +GLIBC_2.32 __isoc99_sscanfieee128 F +GLIBC_2.32 __isoc99_swscanfieee128 F +GLIBC_2.32 __isoc99_vfscanfieee128 F +GLIBC_2.32 __isoc99_vfwscanfieee128 F +GLIBC_2.32 __isoc99_vscanfieee128 F +GLIBC_2.32 __isoc99_vsscanfieee128 F +GLIBC_2.32 __isoc99_vswscanfieee128 F +GLIBC_2.32 __isoc99_vwscanfieee128 F +GLIBC_2.32 __isoc99_wscanfieee128 F +GLIBC_2.32 __obstack_printf_chkieee128 F +GLIBC_2.32 __obstack_printfieee128 F +GLIBC_2.32 __obstack_vprintf_chkieee128 F +GLIBC_2.32 __obstack_vprintfieee128 F +GLIBC_2.32 __printf_chkieee128 F +GLIBC_2.32 __printf_sizeieee128 F +GLIBC_2.32 __printfieee128 F +GLIBC_2.32 __qecvtieee128 F +GLIBC_2.32 __qecvtieee128_r F +GLIBC_2.32 __qfcvtieee128 F +GLIBC_2.32 __qfcvtieee128_r F +GLIBC_2.32 __qgcvtieee128 F +GLIBC_2.32 __scanfieee128 F +GLIBC_2.32 __snprintf_chkieee128 F +GLIBC_2.32 __snprintfieee128 F +GLIBC_2.32 __sprintf_chkieee128 F +GLIBC_2.32 __sprintfieee128 F +GLIBC_2.32 __sscanfieee128 F +GLIBC_2.32 __strfmon_lieee128 F +GLIBC_2.32 __strfmonieee128 F +GLIBC_2.32 __strfromieee128 F +GLIBC_2.32 __strtoieee128 F +GLIBC_2.32 __strtoieee128_l F +GLIBC_2.32 __swprintf_chkieee128 F +GLIBC_2.32 __swprintfieee128 F +GLIBC_2.32 __swscanfieee128 F +GLIBC_2.32 __syslog_chkieee128 F +GLIBC_2.32 __syslogieee128 F +GLIBC_2.32 __vasprintf_chkieee128 F +GLIBC_2.32 __vasprintfieee128 F +GLIBC_2.32 __vdprintf_chkieee128 F +GLIBC_2.32 __vdprintfieee128 F +GLIBC_2.32 __verrieee128 F +GLIBC_2.32 __verrxieee128 F +GLIBC_2.32 __vfprintf_chkieee128 F +GLIBC_2.32 __vfprintfieee128 F +GLIBC_2.32 __vfscanfieee128 F +GLIBC_2.32 __vfwprintf_chkieee128 F +GLIBC_2.32 __vfwprintfieee128 F +GLIBC_2.32 __vfwscanfieee128 F +GLIBC_2.32 __vprintf_chkieee128 F +GLIBC_2.32 __vprintfieee128 F +GLIBC_2.32 __vscanfieee128 F +GLIBC_2.32 __vsnprintf_chkieee128 F +GLIBC_2.32 __vsnprintfieee128 F +GLIBC_2.32 __vsprintf_chkieee128 F +GLIBC_2.32 __vsprintfieee128 F +GLIBC_2.32 __vsscanfieee128 F +GLIBC_2.32 __vswprintf_chkieee128 F +GLIBC_2.32 __vswprintfieee128 F +GLIBC_2.32 __vswscanfieee128 F +GLIBC_2.32 __vsyslog_chkieee128 F +GLIBC_2.32 __vsyslogieee128 F +GLIBC_2.32 __vwarnieee128 F +GLIBC_2.32 __vwarnxieee128 F +GLIBC_2.32 __vwprintf_chkieee128 F +GLIBC_2.32 __vwprintfieee128 F +GLIBC_2.32 __vwscanfieee128 F +GLIBC_2.32 __warnieee128 F +GLIBC_2.32 __warnxieee128 F +GLIBC_2.32 __wcstoieee128 F +GLIBC_2.32 __wcstoieee128_l F +GLIBC_2.32 __wprintf_chkieee128 F +GLIBC_2.32 __wprintfieee128 F +GLIBC_2.32 __wscanfieee128 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist index d479a64fca..aa45e2639c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist @@ -1097,3 +1097,120 @@ GLIBC_2.31 totalordermagf32x F GLIBC_2.31 totalordermagf64 F GLIBC_2.31 totalordermagf64x F GLIBC_2.31 totalordermagl F +GLIBC_2.32 __acoshieee128 F +GLIBC_2.32 __acosieee128 F +GLIBC_2.32 __asinhieee128 F +GLIBC_2.32 __asinieee128 F +GLIBC_2.32 __atan2ieee128 F +GLIBC_2.32 __atanhieee128 F +GLIBC_2.32 __atanieee128 F +GLIBC_2.32 __cabsieee128 F +GLIBC_2.32 __cacoshieee128 F +GLIBC_2.32 __cacosieee128 F +GLIBC_2.32 __canonicalizeieee128 F +GLIBC_2.32 __cargieee128 F +GLIBC_2.32 __casinhieee128 F +GLIBC_2.32 __casinieee128 F +GLIBC_2.32 __catanhieee128 F +GLIBC_2.32 __catanieee128 F +GLIBC_2.32 __cbrtieee128 F +GLIBC_2.32 __ccoshieee128 F +GLIBC_2.32 __ccosieee128 F +GLIBC_2.32 __ceilieee128 F +GLIBC_2.32 __cexpieee128 F +GLIBC_2.32 __cimagieee128 F +GLIBC_2.32 __clog10ieee128 F +GLIBC_2.32 __clogieee128 F +GLIBC_2.32 __conjieee128 F +GLIBC_2.32 __copysignieee128 F +GLIBC_2.32 __coshieee128 F +GLIBC_2.32 __cosieee128 F +GLIBC_2.32 __cpowieee128 F +GLIBC_2.32 __cprojieee128 F +GLIBC_2.32 __crealieee128 F +GLIBC_2.32 __csinhieee128 F +GLIBC_2.32 __csinieee128 F +GLIBC_2.32 __csqrtieee128 F +GLIBC_2.32 __ctanhieee128 F +GLIBC_2.32 __ctanieee128 F +GLIBC_2.32 __erfcieee128 F +GLIBC_2.32 __erfieee128 F +GLIBC_2.32 __exp10ieee128 F +GLIBC_2.32 __exp2ieee128 F +GLIBC_2.32 __expieee128 F +GLIBC_2.32 __expm1ieee128 F +GLIBC_2.32 __f32addieee128 F +GLIBC_2.32 __f32divieee128 F +GLIBC_2.32 __f32mulieee128 F +GLIBC_2.32 __f32subieee128 F +GLIBC_2.32 __f64addieee128 F +GLIBC_2.32 __f64divieee128 F +GLIBC_2.32 __f64mulieee128 F +GLIBC_2.32 __f64subieee128 F +GLIBC_2.32 __fabsieee128 F +GLIBC_2.32 __fdimieee128 F +GLIBC_2.32 __floorieee128 F +GLIBC_2.32 __fmaieee128 F +GLIBC_2.32 __fmaxieee128 F +GLIBC_2.32 __fmaxmagieee128 F +GLIBC_2.32 __fminieee128 F +GLIBC_2.32 __fminmagieee128 F +GLIBC_2.32 __fmodieee128 F +GLIBC_2.32 __frexpieee128 F +GLIBC_2.32 __fromfpieee128 F +GLIBC_2.32 __fromfpxieee128 F +GLIBC_2.32 __getpayloadieee128 F +GLIBC_2.32 __hypotieee128 F +GLIBC_2.32 __ilogbieee128 F +GLIBC_2.32 __j0ieee128 F +GLIBC_2.32 __j1ieee128 F +GLIBC_2.32 __jnieee128 F +GLIBC_2.32 __ldexpieee128 F +GLIBC_2.32 __lgammaieee128 F +GLIBC_2.32 __lgammaieee128_r F +GLIBC_2.32 __llogbieee128 F +GLIBC_2.32 __llrintieee128 F +GLIBC_2.32 __llroundieee128 F +GLIBC_2.32 __log10ieee128 F +GLIBC_2.32 __log1pieee128 F +GLIBC_2.32 __log2ieee128 F +GLIBC_2.32 __logbieee128 F +GLIBC_2.32 __logieee128 F +GLIBC_2.32 __lrintieee128 F +GLIBC_2.32 __lroundieee128 F +GLIBC_2.32 __modfieee128 F +GLIBC_2.32 __nanieee128 F +GLIBC_2.32 __nearbyintieee128 F +GLIBC_2.32 __nextafterieee128 F +GLIBC_2.32 __nextdownieee128 F +GLIBC_2.32 __nexttoward_to_ieee128 F +GLIBC_2.32 __nexttowardf_to_ieee128 F +GLIBC_2.32 __nexttowardieee128 F +GLIBC_2.32 __nextupieee128 F +GLIBC_2.32 __powieee128 F +GLIBC_2.32 __remainderieee128 F +GLIBC_2.32 __remquoieee128 F +GLIBC_2.32 __rintieee128 F +GLIBC_2.32 __roundevenieee128 F +GLIBC_2.32 __roundieee128 F +GLIBC_2.32 __scalbieee128 F +GLIBC_2.32 __scalblnieee128 F +GLIBC_2.32 __scalbnieee128 F +GLIBC_2.32 __setpayloadieee128 F +GLIBC_2.32 __setpayloadsigieee128 F +GLIBC_2.32 __significandieee128 F +GLIBC_2.32 __sincosieee128 F +GLIBC_2.32 __sinhieee128 F +GLIBC_2.32 __sinieee128 F +GLIBC_2.32 __sqrtieee128 F +GLIBC_2.32 __tanhieee128 F +GLIBC_2.32 __tanieee128 F +GLIBC_2.32 __tgammaieee128 F +GLIBC_2.32 __totalorderieee128 F +GLIBC_2.32 __totalordermagieee128 F +GLIBC_2.32 __truncieee128 F +GLIBC_2.32 __ufromfpieee128 F +GLIBC_2.32 __ufromfpxieee128 F +GLIBC_2.32 __y0ieee128 F +GLIBC_2.32 __y1ieee128 F +GLIBC_2.32 __ynieee128 F