From 70cd64a9c633db4cc7ebece5a6932d64b3f16950 Mon Sep 17 00:00:00 2001 From: Lianhao Lu Date: Thu, 10 Mar 2011 09:37:04 +0800 Subject: gcc/collect2: Added --sysroot support into collect2 in gcc. [YOCTO #815] Added --sysroot into COLLECT_GCC_OPTIONS to allow the collect2 support user specifed sysroot. (From OE-Core rev: 868f8d3dd04e3c6dbbce154742cf877fda460a3e) Signed-off-by: Lianhao Lu Signed-off-by: Richard Purdie --- .../gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch (limited to 'meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch') 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 index 0000000000..3e3dec7d39 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch @@ -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; -- cgit v1.2.3-54-g00ecf