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,