mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-16 06:30:16 +00:00
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>
This commit is contained in:
@@ -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},
|
||||
Reference in New Issue
Block a user