From 643a5268eb934fc994a8fa88c181a63f2394eacd Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 Apr 2012 02:24:10 +0000 Subject: gcc-4.5: Backport cpp honor sysroot patch This patch is well vetted on gcc-4.6 Signed-off-by: Khem Raj Signed-off-by: Koen Kooi --- .../gcc/gcc-4.5/cpp-honour-sysroot.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch') diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch new file mode 100644 index 0000000000..cf4c77c262 --- /dev/null +++ b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch @@ -0,0 +1,36 @@ +Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile +preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location +rather than the --sysroot option specified on the commandline. If access to that directory is +permission denied (unreadable), gcc will error. + +This happens when ccache is in use due to the fact it uses preprocessed source files. + +The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix, +-isystem, -isysroot happen and the correct sysroot is used. + +[YOCTO #2074] + +Upstream-Status: Pending + +RP 2012/04/13 + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -1106,7 +1106,7 @@ static const struct compiler default_com + %W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0}, + {".i", "@cpp-output", 0, 1, 0}, + {"@cpp-output", +- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0}, ++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0}, + {".s", "@assembler", 0, 1, 0}, + {"@assembler", + "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0}, +--- a/gcc/cp/lang-specs.h ++++ b/gcc/cp/lang-specs.h +@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3. + {".ii", "@c++-cpp-output", 0, 0, 0}, + {"@c++-cpp-output", + "%{!M:%{!MM:%{!E:\ +- cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\ ++ cc1plus -fpreprocessed %i %I %(cc1_options) %2 %{+e*}\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -- cgit v1.2.3-54-g00ecf