diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-12-16 14:33:37 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-12-19 09:29:18 +0000 |
commit | af9c75c8f5249728877770e3040cbc46c0038f30 (patch) | |
tree | 7b10523cbab4fee270d9a94a6d72c51962e74fd0 /meta/recipes-devtools/gcc/gcc-4.6.inc | |
parent | 2480cc6a169f7d34d82d9e22c52f700e772ab45d (diff) | |
download | poky-af9c75c8f5249728877770e3040cbc46c0038f30.tar.gz |
gcc-4.6: Let G++ relocate gxx-include-dir when using --sysroot option
Currently we have a problem in our cross compiler since we use
/usr/include/c++ to be default gxx-include-dir and then expect
the patch we did to do the relocation w.r.t. sysroot however it
does not quite work so and we end up gxx-include-dirs not respecting
sysroot. A small test case would be
tst-unique4.cc
and it would fails like
tst-unique4.cc:1:18: fatal error: cstdio: No such file or directory
compilation terminated.
weather we use --sysroot or not it does not matter
arm-oe-linux-gnueabi-g++ -S tst-unique4.cc
--sysroot=/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm
failed in same way.
so we redo the GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch based on upstream
submitted patch which tries to relocate the gxx-include-dir and to
achieve the relocation it has to be specified w.r.t to --with-sysroot
directory. e.g.
--with-sysroot=${SYSROOT}
--with-gxx-include-dir=${SYSROOT}/usr/include/c++
if we configure gcc like above then it becomes relocatable when
we run the compiler and specify --sysroot=<blah> then g++ will search
for gxx-headers under <blah>/usr/include/c++
if sysroot is not defined then it will use the default sysroot
and gxx-include-dir will be w.r.t. default sysroot.
Tested on qemuarm
/arm-oe-linux-gnueabi-g++ -S tst-unique4.cc
--sysroot=/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm
-v
...
/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm/usr/include/c++
/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm/usr/include/c++/arm-oe-linux-gnueabi
/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm/usr/include/c++/backward
...
and if I now change --sysroot to something else
/arm-oe-linux-gnueabi-g++ -S tst-unique4.cc
--sysroot=/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm4
-v
...
ignoring nonexistent directory
"/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm4/usr/include/c++"
ignoring nonexistent directory
"/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm4/usr/include/c++/arm-oe-linux-gnueabi"
ignoring nonexistent directory
"/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/sysroots/qemuarm4/usr/include/c++/backward"
...
See now its looking for them in 'qemuarm4' sysroot
(From OE-Core rev: 28b772e42a20faebe1b4f415d28b42b7e0a424fb)
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/gcc-4.6.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.inc b/meta/recipes-devtools/gcc/gcc-4.6.inc index 18e05363f5..4bbb2d22dc 100644 --- a/meta/recipes-devtools/gcc/gcc-4.6.inc +++ b/meta/recipes-devtools/gcc/gcc-4.6.inc | |||
@@ -1,6 +1,6 @@ | |||
1 | require gcc-common.inc | 1 | require gcc-common.inc |
2 | 2 | ||
3 | PR = "r19" | 3 | PR = "r20" |
4 | 4 | ||
5 | # Third digit in PV should be incremented after a minor release | 5 | # Third digit in PV should be incremented after a minor release |
6 | # happens from this branch on gcc e.g. currently its 4.6.0 | 6 | # happens from this branch on gcc e.g. currently its 4.6.0 |
@@ -62,7 +62,6 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ | |||
62 | file://64bithack.patch \ | 62 | file://64bithack.patch \ |
63 | file://optional_libstdc.patch \ | 63 | file://optional_libstdc.patch \ |
64 | file://disable_relax_pic_calls_flag.patch \ | 64 | file://disable_relax_pic_calls_flag.patch \ |
65 | file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \ | ||
66 | file://COLLECT_GCC_OPTIONS.patch \ | 65 | file://COLLECT_GCC_OPTIONS.patch \ |
67 | file://volatile_access_backport.patch \ | 66 | file://volatile_access_backport.patch \ |
68 | file://use-defaults.h-and-t-oe-in-B.patch \ | 67 | file://use-defaults.h-and-t-oe-in-B.patch \ |
@@ -73,6 +72,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ | |||
73 | file://pr32219.patch \ | 72 | file://pr32219.patch \ |
74 | file://pr47551.patch \ | 73 | file://pr47551.patch \ |
75 | file://gcc-arm-set-cost.patch \ | 74 | file://gcc-arm-set-cost.patch \ |
75 | file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \ | ||
76 | " | 76 | " |
77 | 77 | ||
78 | SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch " | 78 | SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch " |