blob: 265ca0e2187b2a00f9fc15350ce1fab56da19ae6 [file] [log] [blame]
From 127716a32a11ca2a6b3aac068054bfc69c4dcfd8 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] 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 be7630ffd8c..1bc45285384 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -5383,6 +5383,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;