public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/107059] [13 regression] bootstrap failure after r13-2887-gb04208895fed34
Date: Wed, 28 Sep 2022 19:04:13 +0000	[thread overview]
Message-ID: <bug-107059-4-ml1jHoiH6e@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107059-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107059

--- Comment #26 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #23)
> Regarding the $BUILD/gcc/include-fixed and xgcc -B $BUILD/gcc:
> 
> In gcc.cc's driver_handle_option:
> 
>         add_prefix (&include_prefixes, arg, NULL,
>                     PREFIX_PRIORITY_B_OPT, 0, 0);
> Adds "$BUILD/gcc/" to the prefix list in include_prefix.plist (priority =
> PREFIX_PRIORITY_B_OPT, require_machine_suffix = os_multilib = 0)
> the include_prefixes.name is "include".
> 
> This is later processed in do_spec_1 as:
>               info.option = "-isystem";
>               info.append = "include";
> ...
>               for_each_path (&include_prefixes, false, info.append_len,
>                              spec_path, &info);
> ...
>               info.append = "include-fixed";
>               for_each_path (&include_prefixes, false, info.append_len,
>                              spec_path, &info);
> which in turn runs with (<prefix> = "$BUILD/gcc/"):
>   
>   <prefix>/x86_64-pc-linux-gnu/13.0.0/
>   <prefix>/x86_64-linux-gnu/
>   <prefix>
> 
> It also sets -iprefix $BUILD/gcc/../lib/gcc/x86_64-pc-linux-gnu/13.0.0/
>              -isystem $BUILD/gcc/{include,include-fixed}

Well, the upper directories to include/include-fixed should stay as they are,
that is how to find the include-fixed directory.
But for multi-arch we need to search both include-fixed/<multiarch_dir>
and include-fixed, so I think we need in addition to the comment 14 patch
also (completely untested):
--- 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);
It is roughly what the comment 14 patch does, just in a different spot.

  parent reply	other threads:[~2022-09-28 19:04 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 16:46 [Bug bootstrap/107059] New: " seurer at gcc dot gnu.org
2022-09-27 17:10 ` [Bug bootstrap/107059] " jakub at gcc dot gnu.org
2022-09-27 17:28 ` marxin at gcc dot gnu.org
2022-09-27 17:37 ` jakub at gcc dot gnu.org
2022-09-27 18:40 ` seurer at gcc dot gnu.org
2022-09-27 18:50 ` jakub at gcc dot gnu.org
2022-09-27 18:52 ` seurer at gcc dot gnu.org
2022-09-27 19:13 ` jakub at gcc dot gnu.org
2022-09-27 19:20 ` seurer at gcc dot gnu.org
2022-09-27 19:26 ` jakub at gcc dot gnu.org
2022-09-27 19:59 ` seurer at gcc dot gnu.org
2022-09-27 20:22 ` jakub at gcc dot gnu.org
2022-09-28  9:45 ` tnfchris at gcc dot gnu.org
2022-09-28  9:46 ` jakub at gcc dot gnu.org
2022-09-28 10:12 ` jakub at gcc dot gnu.org
2022-09-28 10:59 ` burnus at gcc dot gnu.org
2022-09-28 11:18 ` burnus at gcc dot gnu.org
2022-09-28 11:26 ` burnus at gcc dot gnu.org
2022-09-28 11:37 ` jakub at gcc dot gnu.org
2022-09-28 12:58 ` burnus at gcc dot gnu.org
2022-09-28 13:10 ` burnus at gcc dot gnu.org
2022-09-28 13:12 ` jakub at gcc dot gnu.org
2022-09-28 17:16 ` joseph at codesourcery dot com
2022-09-28 18:40 ` burnus at gcc dot gnu.org
2022-09-28 18:47 ` jakub at gcc dot gnu.org
2022-09-28 18:57 ` burnus at gcc dot gnu.org
2022-09-28 19:04 ` jakub at gcc dot gnu.org [this message]
2022-09-28 19:20 ` manuel.lauss at googlemail dot com
2022-09-29  8:07 ` rguenth at gcc dot gnu.org
2022-09-29 10:06 ` cvs-commit at gcc dot gnu.org
2022-09-29 10:14 ` jakub at gcc dot gnu.org
2022-10-03 15:29 ` seurer at gcc dot gnu.org
2022-10-03 15:33 ` jakub at gcc dot gnu.org
2022-10-07  7:00 ` cvs-commit at gcc dot gnu.org
2022-10-07  7:00 ` cvs-commit at gcc dot gnu.org
2022-10-07  7:01 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107059-4-ml1jHoiH6e@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).