]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc/collect2: Added --sysroot support into collect2 in gcc.
authorLianhao Lu <lianhao.lu@intel.com>
Thu, 10 Mar 2011 01:37:04 +0000 (09:37 +0800)
committerSaul Wold <sgw@linux.intel.com>
Fri, 11 Mar 2011 01:10:51 +0000 (17:10 -0800)
[YOCTO #815] Added --sysroot into COLLECT_GCC_OPTIONS to allow the
collect2 support user specifed sysroot.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
meta/recipes-devtools/gcc/gcc-4.5.1.inc
meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch [new file with mode: 0644]
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_4.5.1.bb

index 6c600c1896edb465f717944830e56f21985f73be..3c4902e9e7c6fd07183fe9e8e7176174ceb93a09 100644 (file)
@@ -56,6 +56,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
           file://disable_relax_pic_calls_flag.patch \
           file://gcc-poison-parameters.patch \
           file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \
+          file://COLLECT_GCC_OPTIONS.patch \
          "
        
 SRC_URI_append_sh3  = " file://sh3-installfix-fixheaders.patch;patch=1 "
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch b/meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch
new file mode 100644 (file)
index 0000000..3e3dec7
--- /dev/null
@@ -0,0 +1,22 @@
+#This patck added --sysroot into COLLECT_GCC_OPTIONS which is used to
+#invoke collect2.
+
+diff -ruN gcc-4.5.1.orig/gcc/gcc.c gcc-4.5.1/gcc/gcc.c
+--- gcc-4.5.1.orig/gcc/gcc.c   2011-03-09 16:43:39.127752586 +0800
++++ gcc-4.5.1/gcc/gcc.c        2011-03-09 16:47:15.894929459 +0800
+@@ -4667,6 +4667,15 @@
+               sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+   first_time = TRUE;
++#ifdef HAVE_LD_SYSROOT
++  if (target_system_root_changed && target_system_root)
++    {
++      obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
++      obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
++      obstack_grow (&collect_obstack, "'", 1);
++      first_time = FALSE;
++    }
++#endif
+   for (i = 0; (int) i < n_switches; i++)
+     {
+       const char *const *args;
index 3eea4bcafede92b9382266010de75b307c338d2c..92708d44e7db04525066dc29b0ca84a81011e9bd 100644 (file)
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
 require gcc-configure-sdk.inc
 require gcc-package-sdk.inc
 
-PR = "r3"
+PR = "r4"
 
 DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
 RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
index 38e0964fedc8b8c50ad63849863e8ff216edea44..081b7d60fb5946d582bc1423e1e549b731972787 100644 (file)
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r3"
+PR = "r4"
 
index 9a30cb51195a5376bff61bc8390e0978aaa36b3c..a8473b0ebe7b7b3ea493f632ae1a4f0876095631 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r4"
+PR = "r5"
 
index 78bb05a4745fc1dba1885d898d86188ab7b07342..af6daf41bdc6f1ff532ac592a7778aff26f1e179 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r3"
+PR = "r4"
 
 require gcc-${PV}.inc
 require gcc-cross4.inc
index fec53b931cd0145fe1540d36fc2951a49d56ae65..970824805fcf196ab312bb41663eea8b01a25db8 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
 
-PR = "r3"
+PR = "r4"
index 161d870e639958f91e930ca9ddce11f69733a147..d23596959139503c9115e70b81ef1649eeae1bb7 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
 
-PR = "r3"
+PR = "r4"
index 70690881aa57a17eb5e9b91f3fe3349baf0ec62c..bae238970a6a365598961a98016946407bd58ed1 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-crosssdk.inc
 
-PR = "r3"
+PR = "r4"
index 25e455c05ae750168ca272e3f64673bfe7a8d238..a193b385592dcd31458679c87d2598618629becd 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r3"
+PR = "r4"
 require gcc-${PV}.inc
 require gcc-configure-target.inc
 require gcc-package-target.inc