gcc/0041-Backport-Register-sysroot-in-the-driver-switches-tab.patch
benniaobufeijiushiji 1080ba4291 [Sync] Sync patch from openeuler/gcc
Sync patch from openeuler/gcc - 20220808

(cherry picked from commit 3d663928609a23db4fc8b4ba1039a53a943ac1ed)
2022-09-13 10:18:57 +08:00

41 lines
1.2 KiB
Diff

From beeb0fb50c7e40ee3d79044abc6408f760d6584a Mon Sep 17 00:00:00 2001
From: zhaowenyu <804544223@qq.com>
Date: Thu, 23 Jun 2022 10:40:46 +0800
Subject: [PATCH 07/12] [Backport] Register --sysroot in the driver switches
table
Reference: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=48e2d9b7b88dabed336cd098cd212d0e53c5125f
This change adjusts the processing of --sysroot to save the option in the internal "switches"
array, which lets self-specs test for it and provide a default value possibly dependent on
environment variables, as in
--with-specs=%{!-sysroot*:--sysroot=%:getenv("WIND_BASE" /target)}
2021-12-20 Olivier Hainque <hainque@adacore.com>
gcc/
* gcc.c (driver_handle_option): do_save --sysroot.
---
gcc/gcc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index b55075b14..655beffcc 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4190,7 +4190,9 @@ driver_handle_option (struct gcc_options *opts,
case OPT__sysroot_:
target_system_root = arg;
target_system_root_changed = 1;
- do_save = false;
+ /* Saving this option is useful to let self-specs decide to
+ provide a default one. */
+ do_save = true;
break;
case OPT_time_:
--
2.27.0.windows.1