From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 791071F8C6 for ; Mon, 16 Aug 2021 18:16:27 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8B4E43954836 for ; Mon, 16 Aug 2021 18:16:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B4E43954836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629137786; bh=V6phRLOL6mwXdI/XPODvumtfjTTXZw/YiDAaL/SNih4=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QcA5YnIqVz0zgODJN8EChBTfMLbQm2oVs2dTzcq6tTxDK+qMhI2vdRSwSWzoxCKCd CqGvUnutwMTXUu4FgSDzQU/u6JCkD764mOhMYbathQwX6qoAFIcYPKh42h78tjEvAn 3iiL+T18eU+7dnd7/no4+ILY6U9C//BKGmo+Do/s= Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with UTF8SMTPS id 073723858417 for ; Mon, 16 Aug 2021 18:15:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 073723858417 Received: by mail-wm1-x32a.google.com with SMTP id f9-20020a05600c1549b029025b0f5d8c6cso32889wmg.4 for ; Mon, 16 Aug 2021 11:15:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version; bh=V6phRLOL6mwXdI/XPODvumtfjTTXZw/YiDAaL/SNih4=; b=ZkxaVMBIdG9H/1iNaURC6Qt1Ra5EZj9onEq8ODlK8U4Dj4hhrs7F1OINy94yzOkUDS Xz2Gxbxb73ILzYwCd72bcR5jfmyPw/F8Pg9Lq74djPzdAjytie5wA7Xalitfz8b0HdNq pCm969gYypDH8f+4b+NxKwm90eWo/nHZfg90l7fjNN6/LGggQnuoKh/GfzqfTkeV+0Dt pI0QJ8bSu6ljXEeRO/c/2gwoxvITgdxZ4n3/LCqxloTx1aGwN4CDBEP+woK5ga1fqLFG PheAscxg1O/xtpDVE6NYww/kqgAWkfY4skQfpQ+lBStQfNcA0MZZ0ICWkWtRPhWFT2O/ JjWA== X-Gm-Message-State: AOAM531B/PHHyj2cADMkNfuNUU/5clV4P2UDCqSaAVU3YX+TsOz8FUIu HuAnxD+eVdl4k8sUhJh29kg2QnF9gks= X-Google-Smtp-Source: ABdhPJwrmyhpmi3pmA+/n8EkJDE+eU/c6Vq+sS55oeTywMAJfRfY+qicQhDa3c1BHrDPBoSGJ44LEA== X-Received: by 2002:a05:600c:4f42:: with SMTP id m2mr373830wmq.47.1629137757062; Mon, 16 Aug 2021 11:15:57 -0700 (PDT) Received: from zn3 (host81-129-83-184.range81-129.btcentralplus.com. [81.129.83.184]) by smtp.gmail.com with ESMTPSA id q17sm12056880wrr.91.2021.08.16.11.15.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 11:15:56 -0700 (PDT) Date: Mon, 16 Aug 2021 19:15:52 +0100 To: libc-alpha@sourceware.org Subject: Re: [PATCH] configure.ac: fix include header discovery on gcc-12 [BZ #28183] Message-ID: <20210816191552.35cba85d@zn3> In-Reply-To: <20210804103739.2755644-1-slyfox@gentoo.org> References: <20210804103739.2755644-1-slyfox@gentoo.org> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/uocOEYSyS3kPreT7mm9g1UY"; protocol="application/pgp-signature"; micalg=pgp-sha512 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: , From: Sergei Trofimovich via Libc-alpha Reply-To: Sergei Trofimovich Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" --Sig_/uocOEYSyS3kPreT7mm9g1UY Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 4 Aug 2021 11:37:39 +0100 Sergei Trofimovich wrote: > In https://gcc.gnu.org/PR101305 gcc introduced ABI-specific > internal `include` include directory: >=20 > gcc-12: > /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/32/include > /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/include > gcc-11: > /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include >=20 > glibc's build system tries to extract only one of them and fails > the build for 32-bit ABI on x86_64: >=20 > ../glibc/configure \ > --prefix=3D/usr \ > --build=3Dx86_64-pc-linux-gnu \ > --host=3Di686-pc-linux-gnu \ > --with-headers=3D/usr/include \ > CC=3D'x86_64-pc-linux-gnu-gcc -m32' \ > CXX=3D'x86_64-pc-linux-gnu-g++ -m32' && > make >=20 > python3 -B ../scripts/gen-as-const.py ... > :1:10: fatal error: stddef.h: No such file or directory >=20 > To workaround the failure we extend `configure.ac` to also > lookup `stddef.h` include directory and add it as a lower priority > search path. >=20 > Signed-off-by: Sergei Trofimovich > --- > configure | 37 ++++++++++++++++++++++++++++++++++--- > configure.ac | 15 ++++++++++++--- > 2 files changed, 46 insertions(+), 6 deletions(-) >=20 > diff --git a/configure b/configure > index 9619c10991..cac124f346 100755 > --- a/configure > +++ b/configure > @@ -5452,15 +5452,46 @@ $as_echo "$as_me: WARNING: > *** some features or tests will be disabled. > *** Check the INSTALL file for required versions." >&2;} > =20 > -# if using special system headers, find out the compiler's sekrit > -# header directory and add that to the list. NOTE: Only does the right > -# thing on a system that doesn't need fixincludes. (Not presently a pro= blem.) > +# If using special system headers, find out the compiler's internal > +# header directory and add that to the list to negate -nostdinc effect. > +# NOTE: Only does the right thing on a system that doesn't need fixinclu= des. > +# (Not presently a problem.) > +# NOTE: sometimes 'include' is also present in gcc's ABI-specific paths > +# like in https://sourceware.org/PR28183. To avoid it we probe a known > +# 'stddef.h' header that resides in a common include directory. > if test -n "$sysheaders"; then > SYSINCLUDES=3D-nostdinc > for d in include include-fixed; do > i=3D`$CC -print-file-name=3D"$d"` && test "x$i" !=3D x && test "x$i"= !=3D "x$d" && > SYSINCLUDES=3D"$SYSINCLUDES -isystem $i" > done > + for f in include/stddef.h; do > + i=3D`$CC -print-file-name=3D"$f"` && test "x$i" !=3D x && test "x$i"= !=3D "x$f" && > + d=3D`$as_dirname -- "$i" || > +$as_expr X"$i" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ > + X"$i" : 'X\(//\)[^/]' \| \ > + X"$i" : 'X\(//\)$' \| \ > + X"$i" : 'X\(/\)' \| . 2>/dev/null || > +$as_echo X"$i" | > + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ > + s//\1/ > + q > + } > + /^X\(\/\/\)[^/].*/{ > + s//\1/ > + q > + } > + /^X\(\/\/\)$/{ > + s//\1/ > + q > + } > + /^X\(\/\).*/{ > + s//\1/ > + q > + } > + s/.*/./; q'` && > + SYSINCLUDES=3D"$SYSINCLUDES -isystem $d" > + done > SYSINCLUDES=3D"$SYSINCLUDES \ > -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`" > if test -n "$CXX"; then > diff --git a/configure.ac b/configure.ac > index 34ecbba540..9507a552ff 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1083,15 +1083,24 @@ test -n "$aux_missing" && AC_MSG_WARN([ > *** some features or tests will be disabled. > *** Check the INSTALL file for required versions.]) > =20 > -# if using special system headers, find out the compiler's sekrit > -# header directory and add that to the list. NOTE: Only does the right > -# thing on a system that doesn't need fixincludes. (Not presently a pro= blem.) > +# If using special system headers, find out the compiler's internal > +# header directory and add that to the list to negate -nostdinc effect. > +# NOTE: Only does the right thing on a system that doesn't need fixinclu= des. > +# (Not presently a problem.) > +# NOTE: sometimes 'include' is also present in gcc's ABI-specific paths > +# like in https://sourceware.org/PR28183. To avoid it we probe a known > +# 'stddef.h' header that resides in a common include directory. > if test -n "$sysheaders"; then > SYSINCLUDES=3D-nostdinc > for d in include include-fixed; do > i=3D`$CC -print-file-name=3D"$d"` && test "x$i" !=3D x && test "x$i"= !=3D "x$d" && > SYSINCLUDES=3D"$SYSINCLUDES -isystem $i" > done > + for f in include/stddef.h; do > + i=3D`$CC -print-file-name=3D"$f"` && test "x$i" !=3D x && test "x$i"= !=3D "x$f" && > + d=3D`AS_DIRNAME(["$i"])` && > + SYSINCLUDES=3D"$SYSINCLUDES -isystem $d" > + done > SYSINCLUDES=3D"$SYSINCLUDES \ > -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`" > if test -n "$CXX"; then Does approach look reasonable? --=20 Sergei --Sig_/uocOEYSyS3kPreT7mm9g1UY Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQKTBAEBCgB9FiEE+g11JqJ4cL44QkmN7V5F4G8qwpMFAmEaq1hfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEZB MEQ3NTI2QTI3ODcwQkUzODQyNDk4REVENUU0NUUwNkYyQUMyOTMACgkQ7V5F4G8q wpMpnRAAprVfuTrlJ0/2yLGdk677biOjDauas5Jp9OysXN1UALDeQZ0epAoGez3M etHMmSzNwYV6mzOoAB1aG0OxywocM3gHG4MEYWiAltm0hstFUc34HQpClwZSGlBL UFRX5LKOPKbeW9CZSdOvy3lJF2odo1kFdq7EgBGgoIPLGo2s4T1GI8Yis03XtvhB Uc+O2+7OVg/A6v2wtnPLk39K/X6WQDizM4dXaQy3ls3/QtxkANp3BYxYulG4+OBE 8Aom6YhgPdyZsDtNNcXU9qwN7lQhgSZQQY8FPQr1TPncnx9zDNyvGII7cF5WwnCS Z3ci7jIIyn+l8+/JtHaOh+MtvXDyCkvkEbwy+UKQSKkKRJijHE1C8H3tJgpI7z2W y7MKDXMqyNJVpr3E29GTa9puzUKEy67aZd+MPcjIqce9OshLCXHx2Kd69wpQAPzF nSXGr6wxx67C+pfhCemiWt5B8f15WBpsfr7QN0plmnh9vGc0JmzrcPbvCGUXL0Xp YIq/QMWMrBdJccr8yMrsBl67ga/pedcV0uPXK/03yxGvR2XPCWTm4oAMNMF14GHy K44nRDenU5m6UJ3HM8OTWWeTixk0aU29TV6qgsPDXiIwkjM1jaPSF2/YTzIKjXLI fRZ0wTtRBuhhpdLcrMv3ox6aqs4XrO5jHv1syiuaZNBLdVrc8kQ= =KJ9N -----END PGP SIGNATURE----- --Sig_/uocOEYSyS3kPreT7mm9g1UY--