blob: 9f7e603f8c83af9574b1cbc3cc1eea3d6ff106cd [file] [log] [blame]
Brad Bishopc68388fc2019-08-26 01:33:31 -04001From b9260cd3ac26b0302824ed466a548464c864d95f Mon Sep 17 00:00:00 2001
Brad Bishopc342db32019-05-15 21:57:59 -04002From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:16:28 +0400
Brad Bishopc68388fc2019-08-26 01:33:31 -04004Subject: [PATCH 06/36] COLLECT_GCC_OPTIONS
Brad Bishopc342db32019-05-15 21:57:59 -04005
6This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
7invoke collect2.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Pending
12---
13 gcc/gcc.c | 9 +++++++++
14 1 file changed, 9 insertions(+)
15
16diff --git a/gcc/gcc.c b/gcc/gcc.c
Brad Bishopc68388fc2019-08-26 01:33:31 -040017index cd6c6fc95db..7da9c5d457b 100644
Brad Bishopc342db32019-05-15 21:57:59 -040018--- a/gcc/gcc.c
19+++ b/gcc/gcc.c
20@@ -4804,6 +4804,15 @@ set_collect_gcc_options (void)
21 sizeof ("COLLECT_GCC_OPTIONS=") - 1);
22
23 first_time = TRUE;
24+#ifdef HAVE_LD_SYSROOT
25+ if (target_system_root_changed && target_system_root)
26+ {
27+ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
28+ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
29+ obstack_grow (&collect_obstack, "'", 1);
30+ first_time = FALSE;
31+ }
32+#endif
33 for (i = 0; (int) i < n_switches; i++)
34 {
35 const char *const *args;
36--
Brad Bishopc68388fc2019-08-26 01:33:31 -0400372.22.1
Brad Bishopc342db32019-05-15 21:57:59 -040038