]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc-4.5.1: make c++ include path relative to "--sysroot"
authorKevin Tian <kevin.tian@intel.com>
Thu, 30 Dec 2010 04:36:50 +0000 (12:36 +0800)
committerSaul Wold <sgw@linux.intel.com>
Sun, 2 Jan 2011 09:25:40 +0000 (01:25 -0800)
So far c++ include path is not relative to "--sysroot", which brings
trouble if we want to use the toolchain in a new environment where
the original build directory generating that toolchain is not
available. It's firstly exposed in multiple SDK sysroots support, and
then in the case when sstate packages are used, where c++ standard
headers are missing because gcc tries to search original build dir.

This patch makes c++ include path now relative to "--sysroot", and
then once "--sysroot" is assigned correctly in new environment, c++
include paths can be searched as expected.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
13 files changed:
meta/recipes-devtools/gcc/gcc-4.5.1.inc
meta/recipes-devtools/gcc/gcc-4.5.1/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch [new file with mode: 0644]
meta/recipes-devtools/gcc/gcc-configure-cross.inc
meta/recipes-devtools/gcc/gcc-configure-sdk.inc
meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.1.bb
meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb
meta/recipes-devtools/gcc/gcc-cross_4.5.1.bb
meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb
meta/recipes-devtools/gcc/gcc-crosssdk_4.5.1.bb
meta/recipes-devtools/gcc/gcc-runtime_4.5.1.bb
meta/recipes-devtools/gcc/gcc_4.5.1.bb

index 3edc4d43dcffd6bbdbd71d87ada78385f3c2bc71..1786d8a8e1bfe16c2555b3448cb9642556233f48 100644 (file)
@@ -54,6 +54,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
           file://optional_libstdc.patch \
           file://disable_relax_pic_calls_flag.patch \
           file://gcc-poison-parameters.patch \
+          file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \
          "
        
 SRC_URI_append_sh3  = " file://sh3-installfix-fixheaders.patch;patch=1 "
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.1/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.5.1/GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch
new file mode 100644 (file)
index 0000000..9ae01c3
--- /dev/null
@@ -0,0 +1,33 @@
+# by default c++ include directories are not relative to "--sysroot"
+# which brings one trouble when using the toolchain in an environment
+# where the build directory generating that toolchain doesn't exist,
+# e.g. in sstate, machine specific sysroot and relocatable SDK
+# toolchain. This patch now enables c++ include paths under sysroot.
+# This way it's enough as long as "--sysroot" is correctly enabled
+# in the new environment.
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-12-30
+
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index 5024f48..9b47d1c 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -48,15 +48,15 @@ const struct default_include cpp_include_defaults[]
+ = {
+ #ifdef GPLUSPLUS_INCLUDE_DIR
+     /* Pick up GNU C++ generic include files.  */
+-    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
++    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
+ #endif
+ #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
+     /* Pick up GNU C++ target-dependent include files.  */
+-    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 },
++    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1, 1 },
+ #endif
+ #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+     /* Pick up GNU C++ backward and deprecated include files.  */
+-    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
++    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+     /* /usr/local/include comes before the fixincluded header files.  */
index 3da92e24a1e80a16eb1ac805ce3929edabdfd8cd..04a86853584a5489d55a61d3fe895fd29d5bfc56 100644 (file)
@@ -5,7 +5,7 @@ USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}'
 EXTRA_OECONF += " --enable-poison-system-directories "
 
 EXTRA_OECONF_PATHS = "--with-local-prefix=${STAGING_DIR_TARGET}${target_exec_prefix} \
-                     --with-gxx-include-dir=${STAGING_DIR_TARGET}/${target_includedir}/c++ \
+                     --with-gxx-include-dir=${target_includedir}/c++ \
                       --with-sysroot=${STAGING_DIR_TARGET} \
                       --with-build-sysroot=${STAGING_DIR_TARGET}"
 
index 0eb33adda8421146f847d69b021f1960e6be7f35..756e74e48dd39eb9ee339a4b855f56e7b36f2819 100644 (file)
@@ -5,7 +5,7 @@ USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}'
 USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibcgnueabi", "no", "", d )}'
 
 EXTRA_OECONF_PATHS = "--with-local-prefix=${SDKPATH}/sysroots/${TARGET_SYS}${target_exec_prefix} \
-                      --with-gxx-include-dir=${SDKPATH}/sysroots/${TARGET_SYS}${target_includedir}/c++ \
+                      --with-gxx-include-dir=${target_includedir}/c++ \
                       --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
                       --with-sysroot=${SDKPATH}/sysroots/${TARGET_SYS} \
                       --with-build-sysroot=${STAGING_DIR_TARGET}"
index 98e239d92c3f29917108e9fd6dc351685e3ccdc9..37c64fb4eee5d3c34498f39b3e3bc74308a44428 100644 (file)
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
 require gcc-configure-sdk.inc
 require gcc-package-sdk.inc
 
-PR = "r1"
+PR = "r2"
 
 DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
 RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
index e3aea8b3568b4be3feecf5a111acb07e0cacabc4..a121782233966259840b0d1e1bb1f1abf87af982 100644 (file)
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r0"
+PR = "r1"
 
index 4cabe0eb4be5f56113e033b69e1fec55377cfbe5..7aaa5b051285ba196e02a7044fee2096c4da6fc6 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r0"
+PR = "r1"
 
index 445869d1f57674655219bcf4e55eab7796e1dca5..b7e43285b204da8e13d752c125c48388fece46a4 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r0"
+PR = "r1"
 
 require gcc-${PV}.inc
 require gcc-cross4.inc
index 22cb4904b73225f27f6fe516851cd1af72f0c9b2..0fc5faab3e8e0be8fb56b09ea301acb4edc177f3 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
 
-PR = "r0"
+PR = "r1"
index ba42ca0e5c5f15b3dad516094fab2bf2dbc0dcae..4260c358adff68838fb9ac48ea78d2e1e842d3f0 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
 
-PR = "r0"
+PR = "r1"
index 6f0a5406d00df2236c8e26c39ef53081fd77bd28..a23a66258aa75a6537966bdc82ce919aa2a2fb9f 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-crosssdk.inc
 
-PR = "r0"
+PR = "r1"
index 4d2302d35baf20712f967bec1eae6a619c948441..ca22e8be38db1b0b380ab418ce17591212cf83ca 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r0"
+PR = "r1"
 
 require gcc-${PV}.inc
 require gcc-configure-runtime.inc
index 81c1fa9c2dec34fcb6b436c093290db634c1b0e7..a21772ff5d49a8bd8fe5b83e8ab256b2108ed17d 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r0"
+PR = "r1"
 require gcc-${PV}.inc
 require gcc-configure-target.inc
 require gcc-package-target.inc