diff options
| author | WANG Rui <wangrui@loongson.cn> | 2023-12-14 22:07:53 +0800 |
|---|---|---|
| committer | WANG Rui <wangrui@loongson.cn> | 2024-01-16 19:15:06 +0800 |
| commit | 06a41687b160cbb4cbf8fce0b3ad3a2e352e8338 (patch) | |
| tree | bdc2ea95832dbff1c740b08d7510048df8536fb8 /compiler/rustc_session/src | |
| parent | 94807670a6a3834cc9b71b0b803d49d307c9ba5d (diff) | |
| download | rust-06a41687b160cbb4cbf8fce0b3ad3a2e352e8338.tar.gz rust-06a41687b160cbb4cbf8fce0b3ad3a2e352e8338.zip | |
Add unstable `-Z direct-access-external-data` cmdline flag for `rustc`
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/707
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index c97b18ebd66..ff8c5f4b356 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1553,6 +1553,8 @@ options! { dep_info_omit_d_target: bool = (false, parse_bool, [TRACKED], "in dep-info output, omit targets for tracking dependencies of the dep-info files \ themselves (default: no)"), + direct_access_external_data: Option<bool> = (None, parse_opt_bool, [TRACKED], + "Direct or use GOT indirect to reference external data symbols"), dual_proc_macros: bool = (false, parse_bool, [TRACKED], "load proc macros for both target and host, but only link to the target (default: no)"), dump_dep_graph: bool = (false, parse_bool, [UNTRACKED], diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 720599f6095..392485e2238 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -793,6 +793,13 @@ impl Session { self.opts.unstable_opts.tls_model.unwrap_or(self.target.tls_model) } + pub fn direct_access_external_data(&self) -> Option<bool> { + self.opts + .unstable_opts + .direct_access_external_data + .or(self.target.direct_access_external_data) + } + pub fn split_debuginfo(&self) -> SplitDebuginfo { self.opts.cg.split_debuginfo.unwrap_or(self.target.split_debuginfo) } |
