/usr/src/gcc-4.7/debian/patches/g++-multiarch-incdir.diff is in gcc-4.7-source 4.7.4-3ubuntu12.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | # DP: Use /usr/include/<multiarch>/c++/4.x as the include directory
# DP: for host dependent c++ header files.
Index: b/src/libstdc++-v3/include/Makefile.am
===================================================================
--- a/src/libstdc++-v3/include/Makefile.am
+++ b/src/libstdc++-v3/include/Makefile.am
@@ -823,7 +823,7 @@ endif
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
default_host_alias = @default_host_alias@
host_builddir = ./${default_host_alias}/bits
-host_installdir = ${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits
+host_installdir = $(if $(shell $(CC) -print-multiarch),/usr/include/$(shell $(filter-out -m%,$(CC)) -print-multiarch)/c++/$(notdir ${gxx_include_dir})$(MULTISUBDIR)/bits,${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits)
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
Index: b/src/libstdc++-v3/include/Makefile.in
===================================================================
--- a/src/libstdc++-v3/include/Makefile.in
+++ b/src/libstdc++-v3/include/Makefile.in
@@ -1068,7 +1068,7 @@ profile_impl_headers = \
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
default_host_alias = @default_host_alias@
host_builddir = ./${default_host_alias}/bits
-host_installdir = ${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits
+host_installdir = $(if $(shell $(CC) -print-multiarch),/usr/include/$(shell $(filter-out -m%,$(CC)) -print-multiarch)/c++/$(notdir ${gxx_include_dir})$(MULTISUBDIR)/bits,${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits)
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
Index: b/src/gcc/Makefile.in
===================================================================
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -1120,6 +1120,7 @@ FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"local_prefix=$(local_prefix)" \
"gxx_include_dir=$(gcc_gxx_include_dir)" \
+ "gxx_tool_include_dir=$(gcc_gxx_tool_include_dir)" \
"build_tooldir=$(build_tooldir)" \
"gcc_tooldir=$(gcc_tooldir)" \
"bindir=$(bindir)" \
@@ -1548,6 +1549,14 @@ ifneq ($(xmake_file),)
include $(xmake_file)
endif
+# Directory in which the compiler finds target-dependent g++ includes.
+ifneq ($(call if_multiarch,non-empty),)
+ gcc_gxx_tool_include_dir = /usr/include/$(MULTIARCH_DIRNAME)/c++/$(BASEVER_c)
+else
+ gcc_gxx_tool_include_dir = $(gcc_gxx_include_dir)/$(target_noncanonical)
+endif
+
+
# all-tree.def includes all the tree.def files.
all-tree.def: s-alltree; @true
s-alltree: Makefile
@@ -3989,7 +3998,7 @@ PREPROCESSOR_DEFINES = \
-DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
- -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
+ -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_tool_include_dir)\" \
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
Index: b/src/gcc/cppdefault.c
===================================================================
--- a/src/gcc/cppdefault.c
+++ b/src/gcc/cppdefault.c
@@ -51,6 +51,8 @@ const struct default_include cpp_include
/* Pick up GNU C++ target-dependent include files. */
{ GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 2 },
#endif
#ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
/* Pick up GNU C++ backward and deprecated include files. */
Index: b/src/gcc/incpath.c
===================================================================
--- a/src/gcc/incpath.c
+++ b/src/gcc/incpath.c
@@ -156,7 +156,16 @@ add_standard_paths (const char *sysroot,
{
if (!imultiarch)
continue;
- str = concat (str, dir_separator_str, imultiarch, NULL);
+ if (p->cplusplus)
+ {
+ char *suffix = strstr (str, "/c++/");
+ *suffix++ = '\0';
+ suffix = xstrdup (suffix);
+ str = concat (str, dir_separator_str, imultiarch,
+ dir_separator_str, suffix, NULL);
+ }
+ else
+ str = concat (str, dir_separator_str, imultiarch, NULL);
}
add_path (str, SYSTEM, p->cxx_aware, false);
}
@@ -215,7 +224,16 @@ add_standard_paths (const char *sysroot,
{
if (!imultiarch)
continue;
- str = concat (str, dir_separator_str, imultiarch, NULL);
+ if (p->cplusplus)
+ {
+ char *suffix = strstr (str, "/c++/");
+ *suffix++ = '\0';
+ suffix = xstrdup (suffix);
+ str = concat (str, dir_separator_str, imultiarch,
+ dir_separator_str, suffix, NULL);
+ }
+ else
+ str = concat (str, dir_separator_str, imultiarch, NULL);
}
add_path (str, SYSTEM, p->cxx_aware, false);
|