Message ID | YzVECKV7e5nDSA0S@tucnak |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f2ce:0:0:0:0:0 with SMTP id d14csp545569wrp; Thu, 29 Sep 2022 00:07:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7cNb10sXiTiPKvfUqxpzCzecCp8JSRfdd19TLqf4L8ggs9DzunVkgo5O/Gakyywok7u2AK X-Received: by 2002:a17:907:724a:b0:782:405f:8115 with SMTP id ds10-20020a170907724a00b00782405f8115mr1483473ejc.147.1664435264760; Thu, 29 Sep 2022 00:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664435264; cv=none; d=google.com; s=arc-20160816; b=NTaXtJpkwIgTEmvkKbF38EcRAh2PFbkgTqrD2bL36zg1jihROfdoxUINI27ju4Oa29 efYd9IgBdd9ogXcg4a6KVTh7ULXQstIAnFbD+xYXFNCkCLG9uZUazkiJz0d2HzaAEyGK VmlVBULfE9+KZwxlGOgS7PMD95Lou9M7eetaOxhysmF9PAIzG7qQuzS7b1yXhNKNKzR6 JIrzcYxqnkpojkrtb/M0XMihBeyfP79xLX6/m+L4cPVd9rwk6gvahfScE+nw5xM82Qp5 p+oTeHvpfHCsf30t+xK6s3D1K+W/STebTidGwdWR0Nf8YB76nk/hI/UyIuXw9O26EsLd Ll2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=BIZ/Mf06cD43MPNsyMZPuKWt6zOK+ng5aygsTrAgCqs=; b=pPG7I4qIIC0PTdy7PdNW2v7j3qHJee785QKvzIpogbePX+IT78Ob3jBApsU/nzm6JU /Fvzd2uCU+rGgCQfWb3aU5xSpFWPn9Fwcq1BtcvA2dCmr5FtoOfEjj1gAW2iuq+l3Jat 3zZO9q7BGU78uXSHA2zH+sEO4n2mjYdqM+mSReV4eE7PvqlIQMpJZeb/k30/0Pc/PYmo gxR0yuItM9QgxLY87S1W/FG5HjFfDqOkRxg5UmKla5Bepa2rOsqCwps3QYFQ8gzHhp4x 9a3IruEzfMXtXRcJOwkHb1SvHx/nxud9UKhxUefGQZoKPh86USyqCPAWEcMJKhV1hI1J xrXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nUuapMnq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m10-20020a056402050a00b00450d0a3d76dsi7443928edv.197.2022.09.29.00.07.44 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 00:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nUuapMnq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 805CD3858CDA for <ouuuleilei@gmail.com>; Thu, 29 Sep 2022 07:07:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 805CD3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664435263; bh=BIZ/Mf06cD43MPNsyMZPuKWt6zOK+ng5aygsTrAgCqs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=nUuapMnqcJ3BLyXrYWfog8GxvGnx3TXIea7cj40wKk5OCyLAZOWHxO1SVf+8HCusU CUvSEZSRK763uvwXiqvAWvJ0igTua1t4X+1HAApSVp957hyJh/Cpo+eXyd6EELNs7O uzx7COOIH26sRLG8ZJ+MiHWQ75N/+/nucJNCceOI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7F2523858D39 for <gcc-patches@gcc.gnu.org>; Thu, 29 Sep 2022 07:07:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F2523858D39 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-_E67crw8PZeclM4dor2eZQ-1; Thu, 29 Sep 2022 03:06:54 -0400 X-MC-Unique: _E67crw8PZeclM4dor2eZQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CD4C7802801; Thu, 29 Sep 2022 07:06:53 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B2C6C15BA4; Thu, 29 Sep 2022 07:06:53 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 28T76owa3886835 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 29 Sep 2022 09:06:50 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28T76m8c3886834; Thu, 29 Sep 2022 09:06:48 +0200 Date: Thu, 29 Sep 2022 09:06:48 +0200 To: Richard Biener <rguenther@suse.de>, Jason Merrill <jason@redhat.com>, "Joseph S. Myers" <joseph@codesourcery.com> Subject: [PATCH] driver, cppdefault: Unbreak bootstrap on Debian/Ubuntu [PR107059] Message-ID: <YzVECKV7e5nDSA0S@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jakub Jelinek <jakub@redhat.com> Cc: Tobias Burnus <tobias@codesourcery.com>, gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1745286871922334234?= X-GMAIL-MSGID: =?utf-8?q?1745286871922334234?= |
Series |
driver, cppdefault: Unbreak bootstrap on Debian/Ubuntu [PR107059]
|
|
Commit Message
Jakub Jelinek
Sept. 29, 2022, 7:06 a.m. UTC
Hi! My recent change to enable _Float{16,32,64,128,32x,64x,128x} for C++ apparently broke bootstrap on some Debian/Ubuntu setups. Those multiarch targets put some headers into /usr/include/x86_64-linux-gnu/bits/ etc. subdirectory instead of /usr/include/bits/. This is handled by /* /usr/include comes dead last. */ { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 }, { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, in cppdefault.cc, where the 2 in the last element of the first initializer means the entry is ignored on non-multiarch and suffixed by the multiarch dir otherwise, so installed gcc has search path like: /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed /usr/local/include /usr/include/x86_64-linux-gnu /usr/include (when installed with DESTDIR=/home/jakub/gcc/obj01inst). Now, when fixincludes is run, it is processing the whole /usr/include dir and all its subdirectories, so floatn{,-common.h} actually go into .../include-fixed/x86_64-linux-gnu/bits/floatn{,-common.h} because that is where they appear in /usr/include too. In some setups, /usr/include also contains /usr/include/bits -> x86_64-linux-gnu/bits symlink and after the r13-2896 tweak it works. In other setups there is no /usr/include/bits symlink and when one #include <bits/floatn.h> given the above search path, it doesn't find the fixincluded header, as /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed/bits/floatn.h doesn't exist and /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed/x86_64-linux-gnu/bits/floatn.h isn't searched and so /usr/include/x86_64-linux-gnu/bits/floatn.h wins and we fail because of typedef whatever _Float128; and similar. The following patch ought to fix this. The first hunk by arranging that the installed search path actually looks like: /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed/x86_64-linux-gnu /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed /usr/local/include /usr/include/x86_64-linux-gnu /usr/include and thus for include-fixed it treats it the same as /usr/include. The second FIXED_INCLUDE_DIR entry there is: { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, /* A multilib suffix needs adding if different multilibs use different headers. */ #ifdef SYSROOT_HEADERS_SUFFIX_SPEC 1 #else 0 #endif }, where SYSROOT_HEADERS_SUFFIX_SPEC is defined only on vxworks or mips*-mti-linux and arranges for multilib path to be appended there. Neither of those systems is multiarch. This isn't enough, because when using the -B option, the driver adds -isystem .../include-fixed in another place, so the second hunk modifies that spot the same. /home/jakub/gcc/obj01/gcc/xgcc -B /home/jakub/gcc/obj01/gcc/ then has search path: /home/jakub/gcc/obj01/gcc/include /home/jakub/gcc/obj01/gcc/include-fixed/x86_64-linux-gnu /home/jakub/gcc/obj01/gcc/include-fixed /usr/local/include /usr/include/x86_64-linux-gnu /usr/include which again is what I think we want to achieve. Bootstrapped/regtested on x86_64-linux (Debian on GCCFarm, though with the /usr/include/bits -> x86_64-linux-gnu/bits symlink). Ok for trunk? 2022-09-29 Jakub Jelinek <jakub@redhat.com> PR bootstrap/107059 * cppdefault.cc (cpp_include_defaults): If SYSROOT_HEADERS_SUFFIX_SPEC isn't defined, add FIXED_INCLUDE_DIR entry with multilib flag 2 before FIXED_INCLUDE_DIR entry with multilib flag 0. * gcc.cc (do_spec_1): If multiarch_dir, add include-fixed/multiarch_dir paths before include-fixed paths. Jakub
Comments
On Thu, 29 Sep 2022, Jakub Jelinek wrote: > Hi! > > My recent change to enable _Float{16,32,64,128,32x,64x,128x} for C++ > apparently broke bootstrap on some Debian/Ubuntu setups. > Those multiarch targets put some headers into > /usr/include/x86_64-linux-gnu/bits/ etc. subdirectory instead of > /usr/include/bits/. > This is handled by > /* /usr/include comes dead last. */ > { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 }, > { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 }, > in cppdefault.cc, where the 2 in the last element of the first initializer > means the entry is ignored on non-multiarch and suffixed by the multiarch > dir otherwise, so installed gcc has search path like: > /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include > /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed > /usr/local/include > /usr/include/x86_64-linux-gnu > /usr/include > (when installed with DESTDIR=/home/jakub/gcc/obj01inst). > Now, when fixincludes is run, it is processing the whole /usr/include dir > and all its subdirectories, so floatn{,-common.h} actually go into > .../include-fixed/x86_64-linux-gnu/bits/floatn{,-common.h} > because that is where they appear in /usr/include too. > In some setups, /usr/include also contains /usr/include/bits -> x86_64-linux-gnu/bits > symlink and after the r13-2896 tweak it works. > In other setups there is no /usr/include/bits symlink and when one > #include <bits/floatn.h> > given the above search path, it doesn't find the fixincluded header, > as > /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed/bits/floatn.h > doesn't exist and > /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed/x86_64-linux-gnu/bits/floatn.h > isn't searched and so > /usr/include/x86_64-linux-gnu/bits/floatn.h > wins and we fail because of typedef whatever _Float128; and similar. > The following patch ought to fix this. The first hunk by arranging that > the installed search path actually looks like: > /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include > /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed/x86_64-linux-gnu > /home/jakub/gcc/obj01inst/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/include-fixed > /usr/local/include > /usr/include/x86_64-linux-gnu > /usr/include > and thus for include-fixed it treats it the same as /usr/include. > The second FIXED_INCLUDE_DIR entry there is: > { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, > /* A multilib suffix needs adding if different multilibs use > different headers. */ > #ifdef SYSROOT_HEADERS_SUFFIX_SPEC > 1 > #else > 0 > #endif > }, > where SYSROOT_HEADERS_SUFFIX_SPEC is defined only on vxworks or mips*-mti-linux > and arranges for multilib path to be appended there. Neither of those > systems is multiarch. > This isn't enough, because when using the -B option, the driver adds > -isystem .../include-fixed in another place, so the second hunk modifies > that spot the same. > /home/jakub/gcc/obj01/gcc/xgcc -B /home/jakub/gcc/obj01/gcc/ > then has search path: > /home/jakub/gcc/obj01/gcc/include > /home/jakub/gcc/obj01/gcc/include-fixed/x86_64-linux-gnu > /home/jakub/gcc/obj01/gcc/include-fixed > /usr/local/include > /usr/include/x86_64-linux-gnu > /usr/include > which again is what I think we want to achieve. > > Bootstrapped/regtested on x86_64-linux (Debian on GCCFarm, though with the > /usr/include/bits -> x86_64-linux-gnu/bits symlink). Ok for trunk? OK. Thanks, Richard. > 2022-09-29 Jakub Jelinek <jakub@redhat.com> > > PR bootstrap/107059 > * cppdefault.cc (cpp_include_defaults): If SYSROOT_HEADERS_SUFFIX_SPEC > isn't defined, add FIXED_INCLUDE_DIR entry with multilib flag 2 > before FIXED_INCLUDE_DIR entry with multilib flag 0. > * gcc.cc (do_spec_1): If multiarch_dir, add > include-fixed/multiarch_dir paths before include-fixed paths. > > --- gcc/cppdefault.cc.jj 2022-01-18 11:58:59.411984500 +0100 > +++ gcc/cppdefault.cc 2022-09-28 12:11:47.923603783 +0200 > @@ -74,6 +74,9 @@ const struct default_include cpp_include > #endif > #ifdef FIXED_INCLUDE_DIR > /* This is the dir for fixincludes. */ > +#ifndef SYSROOT_HEADERS_SUFFIX_SPEC > + { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 2 }, > +#endif > { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, > /* A multilib suffix needs adding if different multilibs use > different headers. */ > --- gcc/gcc.cc 2022-09-23 09:02:56.809314447 +0200 > +++ gcc/gcc.cc 2022-09-28 21:02:29.751933657 +0200 > @@ -6400,6 +6400,18 @@ do_spec_1 (const char *spec, int inswitc > if (*sysroot_hdrs_suffix_spec) > info.append = concat (info.append, dir_separator_str, > multilib_dir, NULL); > + else if (multiarch_dir) > + { > + /* For multiarch, search include-fixed/<multiarch-dir> > + before include-fixed. */ > + info.append = concat (info.append, dir_separator_str, > + multiarch_dir, NULL); > + info.append_len = strlen (info.append); > + for_each_path (&include_prefixes, false, info.append_len, > + spec_path, &info); > + > + info.append = "include-fixed"; > + } > info.append_len = strlen (info.append); > for_each_path (&include_prefixes, false, info.append_len, > spec_path, &info); > > Jakub > >
On 29.09.22 09:06, Jakub Jelinek wrote: My recent change to enable _Float{16,32,64,128,32x,64x,128x} for C++ apparently broke bootstrap on some Debian/Ubuntu setups. Those multiarch targets put some headers into /usr/include/x86_64-linux-gnu/bits/ etc. subdirectory instead of /usr/include/bits/. ... Bootstrapped/regtested on x86_64-linux (Debian on GCCFarm, though with the /usr/include/bits -> x86_64-linux-gnu/bits symlink). Ok for trunk? I have now bootstrapped on ppc64le with Ubuntu 18.04.3 LTS (bionic) with glibc 2.27-3ubuntu1 This glibc is too old for the '# if __LDBL_MANT_DIG__ == 113"' issue reported by Joseph as that line was added one version later in glibc 2.28. But it did have the bootstrap issue (only affecting the -B... / build, the installed one was okay - for reasons why, see PR). Thus, my boostrap only tested this patch - and not the __LDBL_MANT_DIG__ part. Result: Bootstrapping passed and I get for cd $BUILD echo '#include <complex.h>' > foo.c gcc/xgcc -B`pwd`/gcc -v -E -o foo.i foo.c grep floatn.h foo.i ... /tmp/gcc-build/gcc/cc1 ... \ -iprefix /tmp/tburnus-gcc-test/gcc/../lib/gcc/powerpc64le-unknown-linux-gnu/13.0.0/ \ -isystem /tmp/tburnus-gcc-test/gcc/include \ -isystem /tmp/tburnus-gcc-test/gcc/include-fixed/powerpc64le-linux-gnu \ -isystem /tmp/tburnus-gcc-test/gcc/include-fixed ... #include "..." search starts here: #include <...> search starts here: /tmp/gcc-build/gcc/include /tmp/gcc-build/gcc/include-fixed/powerpc64le-linux-gnu /tmp/gcc-build/gcc/include-fixed /usr/local/include /usr/include/powerpc64le-linux-gnu /usr/include End of search list. ... # 1 "/tmp/gcc-build/gcc/include-fixed/powerpc64le-linux-gnu/bits/floatn.h" 1 3 4 * * * And with the installed version: #include "..." search starts here: #include <...> search starts here: /tmp/gcc-inst/lib/gcc/powerpc64le-unknown-linux-gnu/13.0.0/include /usr/local/include /tmp/gcc-inst/include /tmp/gcc-inst/lib/gcc/powerpc64le-unknown-linux-gnu/13.0.0/include-fixed/powerpc64le-linux-gnu /tmp/gcc-inst/lib/gcc/powerpc64le-unknown-linux-gnu/13.0.0/include-fixed /usr/include/powerpc64le-linux-gnu /usr/include End of search list. ... # 1 "/tmp/gcc-inst/lib/gcc/powerpc64le-unknown-linux-gnu/13.0.0/include-fixed/powerpc64le-linux-gnu/bits/floatn.h" 1 3 4 ... Thanks for the fix! Tobias 2022-09-29 Jakub Jelinek <jakub@redhat.com><mailto:jakub@redhat.com> PR bootstrap/107059 * cppdefault.cc (cpp_include_defaults): If SYSROOT_HEADERS_SUFFIX_SPEC isn't defined, add FIXED_INCLUDE_DIR entry with multilib flag 2 before FIXED_INCLUDE_DIR entry with multilib flag 0. * gcc.cc (do_spec_1): If multiarch_dir, add include-fixed/multiarch_dir paths before include-fixed paths. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
--- gcc/cppdefault.cc.jj 2022-01-18 11:58:59.411984500 +0100 +++ gcc/cppdefault.cc 2022-09-28 12:11:47.923603783 +0200 @@ -74,6 +74,9 @@ const struct default_include cpp_include #endif #ifdef FIXED_INCLUDE_DIR /* This is the dir for fixincludes. */ +#ifndef SYSROOT_HEADERS_SUFFIX_SPEC + { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 2 }, +#endif { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, /* A multilib suffix needs adding if different multilibs use different headers. */ --- gcc/gcc.cc 2022-09-23 09:02:56.809314447 +0200 +++ gcc/gcc.cc 2022-09-28 21:02:29.751933657 +0200 @@ -6400,6 +6400,18 @@ do_spec_1 (const char *spec, int inswitc if (*sysroot_hdrs_suffix_spec) info.append = concat (info.append, dir_separator_str, multilib_dir, NULL); + else if (multiarch_dir) + { + /* For multiarch, search include-fixed/<multiarch-dir> + before include-fixed. */ + info.append = concat (info.append, dir_separator_str, + multiarch_dir, NULL); + info.append_len = strlen (info.append); + for_each_path (&include_prefixes, false, info.append_len, + spec_path, &info); + + info.append = "include-fixed"; + } info.append_len = strlen (info.append); for_each_path (&include_prefixes, false, info.append_len, spec_path, &info);