Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From 2b22ee2e44688f8a72b9af76a0431d86bac00d47 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 29 Mar 2013 09:16:28 +0400 |
| 4 | Subject: [PATCH 16/35] COLLECT_GCC_OPTIONS |
| 5 | |
| 6 | This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to |
| 7 | invoke collect2. |
| 8 | |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | |
| 11 | Upstream-Status: Pending |
| 12 | --- |
| 13 | gcc/gcc.c | 9 +++++++++ |
| 14 | 1 file changed, 9 insertions(+) |
| 15 | |
| 16 | diff --git a/gcc/gcc.c b/gcc/gcc.c |
| 17 | index a37ec8b..87b47c5 100644 |
| 18 | --- a/gcc/gcc.c |
| 19 | +++ b/gcc/gcc.c |
| 20 | @@ -4352,6 +4352,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 | -- |
| 37 | 2.1.4 |
| 38 | |