summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-04-12 21:33:22 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-30 11:37:27 +0100
commit9f328535440abe241fd679aa1d211e6b4e71f885 (patch)
tree1c8fe42f3c36d3520794dffb14757ba13fcc4271 /meta/recipes-devtools/gcc
parent8e6a74222061e763953e4913a5f08d57ba74c540 (diff)
downloadpoky-9f328535440abe241fd679aa1d211e6b4e71f885.tar.gz
gcc-4.7: Let cpp specs honor include searches in relocated install tree
Fix from Yocto Bug 2074 (From OE-Core rev: fe32e09ccbef3a9896955e8d4c3113c53f95de48) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7.inc6
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/cpp-honor-sysroot.patch40
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7.inc b/meta/recipes-devtools/gcc/gcc-4.7.inc
index 7cfc388b78..784a3be328 100644
--- a/meta/recipes-devtools/gcc/gcc-4.7.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.7.inc
@@ -63,6 +63,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \
63 file://pr32219.patch \ 63 file://pr32219.patch \
64 file://fortran-cross-compile-hack.patch \ 64 file://fortran-cross-compile-hack.patch \
65 file://libgcc-sjlj-check.patch \ 65 file://libgcc-sjlj-check.patch \
66 file://cpp-honor-sysroot.patch \
66 " 67 "
67 68
68S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${BRANCH}" 69S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${BRANCH}"
@@ -103,6 +104,11 @@ EXTRA_OECONF_INTERMEDIATE = "--disable-libmudflap \
103 104
104EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float " 105EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
105 106
107EXTRA_OECONF_PATHS = " \
108 --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
109 --with-sysroot=${STAGING_DIR_TARGET} \
110 --with-build-sysroot=${STAGING_DIR_TARGET}"
111
106do_configure_prepend () { 112do_configure_prepend () {
107 # teach gcc to find correct target includedir when checking libc ssp support 113 # teach gcc to find correct target includedir when checking libc ssp support
108 mkdir -p ${B}/gcc 114 mkdir -p ${B}/gcc
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.7/cpp-honor-sysroot.patch
new file mode 100644
index 0000000000..731067741d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/cpp-honor-sysroot.patch
@@ -0,0 +1,40 @@
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
17Index: gcc-4_6-branch/gcc/gcc.c
18===================================================================
19--- gcc-4_6-branch.orig/gcc/gcc.c 2012-04-13 12:24:37.939671140 +0000
20+++ gcc-4_6-branch/gcc/gcc.c 2012-04-13 12:24:54.439670688 +0000
21@@ -953,7 +953,7 @@
22 %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
23 {".i", "@cpp-output", 0, 0, 0},
24 {"@cpp-output",
25- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
26+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
27 {".s", "@assembler", 0, 0, 0},
28 {"@assembler",
29 "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
30Index: gcc-4_6-branch/gcc/cp/lang-specs.h
31===================================================================
32--- gcc-4_6-branch.orig/gcc/cp/lang-specs.h 2012-04-13 12:25:01.019670594 +0000
33+++ gcc-4_6-branch/gcc/cp/lang-specs.h 2012-04-13 12:25:07.567670180 +0000
34@@ -64,5 +64,5 @@
35 {".ii", "@c++-cpp-output", 0, 0, 0},
36 {"@c++-cpp-output",
37 "%{!M:%{!MM:%{!E:\
38- cc1plus -fpreprocessed %i %(cc1_options) %2\
39+ cc1plus -fpreprocessed %i %I %(cc1_options) %2\
40 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},