From patchwork Thu Apr 23 21:09:43 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: 38856 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 EE0F1396E42C for ; Thu, 23 Apr 2020 21:09:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EE0F1396E42C Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NL8gY6059634 for ; Thu, 23 Apr 2020 17:09:51 -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 30gmuasjjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 17:09:51 -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 03NL3Cvq012338 for ; Thu, 23 Apr 2020 21:09:50 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma04dal.us.ibm.com with ESMTP id 30fs677pqb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 21:09:50 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NL9nam48955760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 23 Apr 2020 21:09:49 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 581F0124052 for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 291D112405A for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.141.68]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv3 1/6] ldbl-128ibm-compat: workaround GCC 9 C++ PR90731 Date: Thu, 23 Apr 2020 16:09:43 -0500 Message-Id: <0c4ba80b4578a966d92690600cd097f6a7fe2284.1587675931.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-23_15:2020-04-23, 2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 mlxscore=0 malwarescore=0 suspectscore=1 mlxlogscore=999 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230150 X-Spam-Status: No, score=-28.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, 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: Thu, 23 Apr 2020 21:09:53 -0000 GCC 9 has a bug (PR90731) 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..bddc660ce2 100644 --- a/include/monetary.h +++ b/include/monetary.h @@ -1,3 +1,11 @@ +/* Workaround PR90731 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..bdcfd29f63 100644 --- a/include/printf.h +++ b/include/printf.h @@ -1,5 +1,13 @@ #ifndef _PRINTF_H +/* Workaround PR90731 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..1c09daf13a 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -2,8 +2,18 @@ # if !defined _ISOMAC && defined _IO_MTSAFE_IO # include # endif + +/* Workaround PR90731 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..187a41e754 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -3,6 +3,15 @@ #ifndef _ISOMAC # include #endif + +/* Workaround PR90731 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..bb49d844be 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -1,4 +1,13 @@ #ifndef _WCHAR_H + +/* Workaround PR90731 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 Thu Apr 23 21:09:44 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: 38861 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 5A480396EC23 for ; Thu, 23 Apr 2020 21:09:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5A480396EC23 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NL8TQB110375 for ; Thu, 23 Apr 2020 17:09:51 -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 30jrc6799x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 17:09:51 -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 03NL5M80013183 for ; Thu, 23 Apr 2020 21:09:50 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma02dal.us.ibm.com with ESMTP id 30fs67fqdn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 21:09:50 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NL9nGV34144694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 23 Apr 2020 21:09:49 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ABFF412405A for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 70CD8124055 for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.141.68]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv3 2/6] Rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI Date: Thu, 23 Apr 2020 16:09:44 -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-23_15:2020-04-23, 2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 impostorscore=0 clxscore=1015 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230150 X-Spam-Status: No, score=-29.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, 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: Thu, 23 Apr 2020 21:09:55 -0000 per feedback and discussion 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 bddc660ce2..5390411d8f 100644 --- a/include/monetary.h +++ b/include/monetary.h @@ -1,6 +1,6 @@ /* Workaround PR90731 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 bdcfd29f63..0ed6e87387 100644 --- a/include/printf.h +++ b/include/printf.h @@ -2,7 +2,7 @@ /* Workaround PR90731 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 1c09daf13a..9df98b2833 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -5,7 +5,7 @@ /* Workaround PR90731 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 187a41e754..ffcefd7b85 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -6,7 +6,7 @@ /* Workaround PR90731 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 bb49d844be..4267985625 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -2,7 +2,7 @@ /* Workaround PR90731 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 777d108347..e48860e391 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 Thu Apr 23 21:09:45 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: 38858 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 57D0C396DC3B for ; Thu, 23 Apr 2020 21:09:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 57D0C396DC3B Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NL8QlC081764 for ; Thu, 23 Apr 2020 17:09:51 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 30jrj77gs1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 17:09:50 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03NL3DKG020608 for ; Thu, 23 Apr 2020 21:09:50 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04wdc.us.ibm.com with ESMTP id 30fs66vjqn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 21:09:50 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NL9of812321306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 23 Apr 2020 21:09:50 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F3EC4124052 for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4B1F12405E for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.141.68]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 21:09:49 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv3 3/6] powerpc64le: raise GCC requirement to 7.4 for long double transition Date: Thu, 23 Apr 2020 16:09:45 -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-23_15:2020-04-23, 2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 phishscore=0 suspectscore=1 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230150 X-Spam-Status: No, score=-28.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: Thu, 23 Apr 2020 21:09:55 -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..2fa7a81fd9 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', '-mabi=ieeelongdouble', and + '-mabi=ibmlondouble' is required. These additional features are + 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 0e627b3405..dac306c4c3 100644 --- a/NEWS +++ b/NEWS @@ -28,7 +28,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..34fe75487f 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}, @option{-mabi=ieeelongdouble}, and +@option{-mabi=ibmlondouble} is required. These additional features are +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..071d881a5a 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 (PR83862)." +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..6dabd9be6b 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 PR83862 and backported +dnl to gcc6 and gcc7. This test is to check if we are using the compiler +dnl that has this bug (fixed in GCC 8.0, backported to 7.4). +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 (PR83862)."]) + + test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing]) From patchwork Thu Apr 23 21:09:46 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: 38862 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 47B6E396EC5C for ; Thu, 23 Apr 2020 21:10:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 47B6E396EC5C Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NLA3EC050982 for ; Thu, 23 Apr 2020 17:10:08 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 30k7rmekf8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 17:10:05 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03NL3Aal022876 for ; Thu, 23 Apr 2020 21:09:51 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01dal.us.ibm.com with ESMTP id 30fs67fp7u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 21:09:51 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NL9oxY41353556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 23 Apr 2020 21:09:50 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B72D124058 for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A721124054 for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.141.68]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv3 4/6] powerpc64le: bump binutils version requirement to >= 2.26 Date: Thu, 23 Apr 2020 16:09:46 -0500 Message-Id: <762258d46417cf248b5aeef1f379b0def0112718.1587675931.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-23_15:2020-04-23, 2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 impostorscore=0 malwarescore=0 suspectscore=1 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230150 X-Spam-Status: No, score=-29.2 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: Thu, 23 Apr 2020 21:10:09 -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 | 63 +++++++++++++++++++++++ sysdeps/powerpc/powerpc64/le/configure.ac | 6 +++ 4 files changed, 77 insertions(+) diff --git a/INSTALL b/INSTALL index 2fa7a81fd9..4bf4bd0908 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), 'objcopy' is + required to support '--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 34fe75487f..e801abd8be 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), @command{objcopy} is required +to support @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 071d881a5a..bd7b8e77d0 100644 --- a/sysdeps/powerpc/powerpc64/le/configure +++ b/sysdeps/powerpc/powerpc64/le/configure @@ -90,5 +90,68 @@ 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 (PR83862)." fi +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 6dabd9be6b..405933e710 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 (PR83862)."]) +dnl objcopy (binutils) 2.26 or newer required to support the --update-section +dnl 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 Thu Apr 23 21:09:47 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: 38859 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 98A52396EC62 for ; Thu, 23 Apr 2020 21:09:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98A52396EC62 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 03NL8RLf027007 for ; Thu, 23 Apr 2020 17:09:52 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 30ghu9eer6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 17:09:52 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03NL3wva018651 for ; Thu, 23 Apr 2020 21:09:51 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma03dal.us.ibm.com with ESMTP id 30fs67fp3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 21:09:51 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NL9oSU41353562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 23 Apr 2020 21:09:50 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0523124058 for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66E19124053 for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.141.68]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv3 5/6] powerpc64le: blacklist broken GCC compilers (e.g GCC 7.5.0) Date: Thu, 23 Apr 2020 16:09:47 -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-23_15:2020-04-23, 2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 suspectscore=1 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230150 X-Spam-Status: No, score=-28.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: Thu, 23 Apr 2020 21:09:55 -0000 GCC 7.5.0 (PR94200) 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 maintaining status quo, test for and blacklist such compilers. Tested with a GCC 8.3.1 and GCC 7.5.0 compiler for ppc64le. --- INSTALL | 8 +++--- manual/install.texi | 10 ++++++-- sysdeps/ieee754/ldbl-128ibm-compat/Makefile | 12 --------- sysdeps/powerpc/powerpc64/le/configure | 27 +++++++++++++++++++++ sysdeps/powerpc/powerpc64/le/configure.ac | 15 ++++++++++++ 5 files changed, 55 insertions(+), 17 deletions(-) diff --git a/INSTALL b/INSTALL index 4bf4bd0908..b7676d1c9f 100644 --- a/INSTALL +++ b/INSTALL @@ -469,9 +469,11 @@ build the GNU C Library: For PowerPC 64-bits little-endian (powerpc64le), a GCC version with support for '-mno-gnu-attribute', '-mabi=ieeelongdouble', and - '-mabi=ibmlondouble' is required. These additional features are - required for building the GNU C Library with support for IEEE long - double. + '-mabi=ibmlondouble' is required. Likewise, the compiler must also + support passing '-mlong-double-128' with the preceding options. As + of release, this implies GCC 7.4 and newer (excepting GCC 7.5.0, + see GCC PR94200). These additional features are 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 diff --git a/manual/install.texi b/manual/install.texi index e801abd8be..f6d9d92317 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -509,8 +509,14 @@ release time, GCC 9.2.1 is the newest compiler verified to work to build For PowerPC 64-bits little-endian (powerpc64le), a GCC version with support for @option{-mno-gnu-attribute}, @option{-mabi=ieeelongdouble}, and -@option{-mabi=ibmlondouble} is required. These additional features are -required for building the GNU C Library with support for IEEE long double. +@option{-mabi=ibmlondouble} is required. Likewise, the compiler must also +support passing @option{-mlong-double-128} with the preceding options. As +of release, this implies GCC 7.4 and newer (excepting GCC 7.5.0, see GCC +PR94200). These additional features are required for building the GNU C +Library with support for IEEE long double. + +@c powerpc64le performs an autoconf test to verify the compiler compiles with +@c commands like "$CC -c foo.c -mabi=ibmlongdouble -mlong-double-128". 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 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 bd7b8e77d0..98a4889945 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 (PR83862)." 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 + for ac_prog in $OBJCOPY do # Extract the first word of "$ac_prog", so it can be a program name with args. diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac index 405933e710..769c06709e 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 (PR83862)."]) +dnl Some old compiler versions give out error messages when combining +dnl -mabi=% and -mlong-double-128. i.e GCC 7.5.0 (PR94200) +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."]) + dnl objcopy (binutils) 2.26 or newer required to support the --update-section dnl feature for fixing up .gnu.attribute section with IEEE ldbl. AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version, From patchwork Thu Apr 23 21:09:48 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: 38860 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 7C249396EC63 for ; Thu, 23 Apr 2020 21:09:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C249396EC63 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NL8f4r090664 for ; Thu, 23 Apr 2020 17:09:52 -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 30jtk32su3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 17:09:52 -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 03NL3Cvt012338 for ; Thu, 23 Apr 2020 21:09:51 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 30fs677pqh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 21:09:51 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NL9pJm53739918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 23 Apr 2020 21:09:51 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EAA26124052 for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9C9612405B for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.141.68]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 21:09:50 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv3 6/6] powerpc64le: Enable support for IEEE long double Date: Thu, 23 Apr 2020 16:09:48 -0500 Message-Id: <91e53fc22389f772490f62f44e05d3aa29fc11b1.1587675931.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-23_16:2020-04-23, 2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 suspectscore=1 impostorscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230151 X-Spam-Status: No, score=-30.0 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: Thu, 23 Apr 2020 21:09:55 -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 dac306c4c3..d4b528296e 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,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: * The deprecated header and the sysctl function have been diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps index 1c989e020f..cd2a5fed45 100644 --- a/sysdeps/powerpc/fpu/libm-test-ulps +++ b/sysdeps/powerpc/fpu/libm-test-ulps @@ -1266,21 +1266,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 2b6a76d9c2..0c2513a4b3 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2248,4 +2248,97 @@ 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 GLIBC_2.32 pthread_sigmask 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