summaryrefslogtreecommitdiff
path: root/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-6.2/0016-COLLECT_GCC_OPTIONS.patch
blob: c1548647c7edd99de63ad92ee8a8e7a306cf6a68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 1033bc2d4efc5c301bb822b607a673f5b10cc69f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 09:16:28 +0400
Subject: [PATCH 16/46] COLLECT_GCC_OPTIONS

This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
invoke collect2.

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Upstream-Status: Pending
---
 gcc/gcc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/gcc.c b/gcc/gcc.c
index da0b482..7ca129f 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4591,6 +4591,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;
-- 
2.8.2