aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cppdefault.cc3
-rw-r--r--gcc/gcc.cc12
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cppdefault.cc b/gcc/cppdefault.cc
index 7888300..7d8f9a5 100644
--- a/gcc/cppdefault.cc
+++ b/gcc/cppdefault.cc
@@ -74,6 +74,9 @@ const struct default_include cpp_include_defaults[]
#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. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 2ffbbc0..afb23cd 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -6415,6 +6415,18 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
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);