summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-04-19 02:24:10 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2012-04-19 09:49:25 +0200
commit643a5268eb934fc994a8fa88c181a63f2394eacd (patch)
treebe416031227239ba262d581979d722382c7ad994 /toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch
parentb519276f3f069447c059cdc2553735ce537fc822 (diff)
downloadmeta-openembedded-643a5268eb934fc994a8fa88c181a63f2394eacd.tar.gz
gcc-4.5: Backport cpp honor sysroot patch
This patch is well vetted on gcc-4.6 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch')
-rw-r--r--toolchain-layer/recipes-devtools/gcc/gcc-4.5/cpp-honour-sysroot.patch36
1 files changed, 36 insertions, 0 deletions
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 @@
1Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
2preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
3rather than the --sysroot option specified on the commandline. If access to that directory is
4permission denied (unreadable), gcc will error.
5
6This happens when ccache is in use due to the fact it uses preprocessed source files.
7
8The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
9-isystem, -isysroot happen and the correct sysroot is used.
10
11[YOCTO #2074]
12
13Upstream-Status: Pending
14
15RP 2012/04/13
16
17--- a/gcc/gcc.c
18+++ b/gcc/gcc.c
19@@ -1106,7 +1106,7 @@ static const struct compiler default_com
20 %W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0},
21 {".i", "@cpp-output", 0, 1, 0},
22 {"@cpp-output",
23- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
24+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
25 {".s", "@assembler", 0, 1, 0},
26 {"@assembler",
27 "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0},
28--- a/gcc/cp/lang-specs.h
29+++ b/gcc/cp/lang-specs.h
30@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3.
31 {".ii", "@c++-cpp-output", 0, 0, 0},
32 {"@c++-cpp-output",
33 "%{!M:%{!MM:%{!E:\
34- cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
35+ cc1plus -fpreprocessed %i %I %(cc1_options) %2 %{+e*}\
36 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},