aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch
blob: 3e3dec7d39f4852750540b94a9ff6457455d4459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;