From patchwork Tue Dec 15 14:18:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 41400 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4F23386EC7A; Tue, 15 Dec 2020 14:19:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4F23386EC7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608041973; bh=DiJAkHYqblWTopnfnwUBSYxxgrAyFmcrvGA418AcYHc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Tm5D/AKxVa0Zdg0epNUBvicPpvPLwEyZMR7re27vGYQffii4TB1/3qgqSle3IX/mD ZbAolJgcL+VsGvvxW+KKjJiWURH3TzeuOzC4HmrVq3nRrkBhN6q/ISA2EmYcdwgpxc NJEnm4OyZcXGhlE8XNZsHoau04Ub3croPPGchnr0= 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 D323D386EC7A for ; Tue, 15 Dec 2020 14:19:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D323D386EC7A Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BFE2FMU144989 for ; Tue, 15 Dec 2020 09:19:28 -0500 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 35ewkyjkfr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 15 Dec 2020 09:19:28 -0500 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BFEJDiF001038 for ; Tue, 15 Dec 2020 14:19:26 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03fra.de.ibm.com with ESMTP id 35cng8cx7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 15 Dec 2020 14:19:26 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BFEI8SE20906328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Dec 2020 14:18:08 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DDB2AE053; Tue, 15 Dec 2020 14:18:08 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 472F6AE045; Tue, 15 Dec 2020 14:18:08 +0000 (GMT) Received: from t35lp56.lnxne.boe (unknown [9.152.108.100]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 15 Dec 2020 14:18:08 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] s390x: Require GCC 7.1 or later to build glibc. Date: Tue, 15 Dec 2020 15:18:03 +0100 Message-Id: <20201215141803.252050-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-15_10:2020-12-15, 2020-12-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 suspectscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012150097 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, 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-Patchwork-Original-From: Stefan Liebler via Libc-alpha From: Stefan Liebler Reply-To: Stefan Liebler Cc: Stefan Liebler Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" GCC 6.5 fails to correctly build ldconfig with recent ld.so.cache commits, e.g.: 785969a047ad2f23f758901c6816422573544453 elf: Implement a string table for ldconfig, with tail merging If glibc is build with gcc 6.5.0: __builtin_add_overflow is used in /elf/stringtable.c:stringtable_finalize() which leads to ldconfig failing with "String table is too large". This is also recognizable in following tests: FAIL: elf/tst-glibc-hwcaps-cache FAIL: elf/tst-glibc-hwcaps-prepend-cache FAIL: elf/tst-ldconfig-X FAIL: elf/tst-ldconfig-bad-aux-cache FAIL: elf/tst-ldconfig-ld_so_conf-update FAIL: elf/tst-stringtable See gcc "Bug 98269 - gcc 6.5.0 __builtin_add_overflow() with small uint32_t values incorrectly detects overflow" (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269) --- INSTALL | 3 +++ NEWS | 2 ++ manual/install.texi | 2 ++ sysdeps/s390/configure | 35 +++++++++++++++++++++++++++++++++++ sysdeps/s390/configure.ac | 17 +++++++++++++++++ 5 files changed, 59 insertions(+) diff --git a/INSTALL b/INSTALL index 2b00f80df5..accdc39821 100644 --- a/INSTALL +++ b/INSTALL @@ -467,6 +467,9 @@ build the GNU C Library: For ARC architecture builds, GCC 8.3 or higher is needed. + For s390x architecture builds, GCC 7.1 or higher is needed (See gcc + Bug 98269). + 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 0820984547..86e05fb023 100644 --- a/NEWS +++ b/NEWS @@ -67,6 +67,8 @@ Changes to build and runtime requirements: (and pseudo-terminals are supported), a devpts file system is mounted on /dev/pts. Current systems already meet these requirements. +* s390x requires GCC 7.1 or newer. See gcc Bug 98269. + Security related changes: CVE-2020-27618: An infinite loop has been fixed in the iconv program when diff --git a/manual/install.texi b/manual/install.texi index 2e164476d5..648f366371 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -509,6 +509,8 @@ Library with support for IEEE long double. For ARC architecture builds, GCC 8.3 or higher is needed. +For s390x architecture builds, GCC 7.1 or higher is needed (See gcc Bug 98269). + 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/s390/configure b/sysdeps/s390/configure index fa46e9e351..5f98640d0f 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -296,5 +296,40 @@ then fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc on s390x" >&5 +$as_echo_n "checking if $CC is sufficient to build libc on s390x... " >&6; } +if ${libc_cv_compiler_ok_on_s390x+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1) +#error insufficient compiler for building on s390x +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_cv_compiler_ok_on_s390x=yes +else + libc_cv_compiler_ok_on_s390x=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5 +$as_echo "$libc_cv_compiler_ok_on_s390x" >&6; } +if test "$libc_cv_compiler_ok_on_s390x" != yes; then + critic_missing="$critic_missing On s390x, GCC >= 7.1.0 is required." +fi + test -n "$critic_missing" && as_fn_error $? " *** $critic_missing" "$LINENO" 5 diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac index 3ed5a8ef87..dfe007a774 100644 --- a/sysdeps/s390/configure.ac +++ b/sysdeps/s390/configure.ac @@ -212,5 +212,22 @@ then AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT) fi +dnl test if GCC is new enough. See gcc "Bug 98269 - gcc 6.5.0 +dnl __builtin_add_overflow() with small uint32_t values incorrectly detects +dnl overflow +dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269) +AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x], +libc_cv_compiler_ok_on_s390x, [ +AC_TRY_COMPILE([], [ +#if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1) +#error insufficient compiler for building on s390x +#endif +], + [libc_cv_compiler_ok_on_s390x=yes], + [libc_cv_compiler_ok_on_s390x=no])]) +if test "$libc_cv_compiler_ok_on_s390x" != yes; then + critic_missing="$critic_missing On s390x, GCC >= 7.1.0 is required." +fi + test -n "$critic_missing" && AC_MSG_ERROR([ *** $critic_missing])