0006-COLLECT_GCC_OPTIONS.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 127716a32a11ca2a6b3aac068054bfc69c4dcfd8 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] COLLECT_GCC_OPTIONS
  5. This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
  6. invoke collect2.
  7. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  8. Upstream-Status: Pending
  9. ---
  10. gcc/gcc.c | 9 +++++++++
  11. 1 file changed, 9 insertions(+)
  12. diff --git a/gcc/gcc.c b/gcc/gcc.c
  13. index be7630ffd8c..1bc45285384 100644
  14. --- a/gcc/gcc.c
  15. +++ b/gcc/gcc.c
  16. @@ -5383,6 +5383,15 @@ set_collect_gcc_options (void)
  17. sizeof ("COLLECT_GCC_OPTIONS=") - 1);
  18. first_time = TRUE;
  19. +#ifdef HAVE_LD_SYSROOT
  20. + if (target_system_root_changed && target_system_root)
  21. + {
  22. + obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
  23. + obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
  24. + obstack_grow (&collect_obstack, "'", 1);
  25. + first_time = FALSE;
  26. + }
  27. +#endif
  28. for (i = 0; (int) i < n_switches; i++)
  29. {
  30. const char *const *args;