summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/COLLECT_GCC_OPTIONS.patch
blob: 8b53b839cf1dafbd6693446ac25959c0ea47a7d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#This patck added --sysroot into COLLECT_GCC_OPTIONS which is used to
#invoke collect2.

Index: gcc-4.6.0/gcc/gcc.c
===================================================================
--- gcc-4.6.0.orig/gcc/gcc.c
+++ gcc-4.6.0/gcc/gcc.c
@@ -3948,6 +3948,15 @@ set_collect_gcc_options (void)
 		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;
OpenPOWER on IntegriCloud