From cd626fec2bcfa6b78d34a1ae023943c8a15a6641 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Mon, 6 Dec 2021 14:09:24 -0800 Subject: Stabilize -Z print-link-args as --print link-args We have stable options for adding linker arguments; we should have a stable option to help debug linker arguments. --- compiler/rustc_session/src/config.rs | 5 ++++- compiler/rustc_session/src/options.rs | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_session/src') diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 87e8e576117..ec32201c263 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -534,6 +534,7 @@ pub enum PrintRequest { TargetSpec, NativeStaticLibs, StackProtectorStrategies, + LinkArgs, } #[derive(Copy, Clone)] @@ -1115,7 +1116,8 @@ pub fn rustc_short_optgroups() -> Vec { "Compiler information to print on stdout", "[crate-name|file-names|sysroot|target-libdir|cfg|target-list|\ target-cpus|target-features|relocation-models|code-models|\ - tls-models|target-spec-json|native-static-libs|stack-protector-strategies]", + tls-models|target-spec-json|native-static-libs|stack-protector-strategies\ + link-args]", ), opt::flagmulti_s("g", "", "Equivalent to -C debuginfo=2"), opt::flagmulti_s("O", "", "Equivalent to -C opt-level=2"), @@ -1547,6 +1549,7 @@ fn collect_print_requests( ); } } + "link-args" => PrintRequest::LinkArgs, req => early_error(error_format, &format!("unknown print request `{}`", req)), })); diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index bd7b1639613..7114b117031 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1294,8 +1294,6 @@ options! { See #77382 and #74551."), print_fuel: Option = (None, parse_opt_string, [TRACKED], "make rustc print the total optimization fuel used by a crate"), - print_link_args: bool = (false, parse_bool, [UNTRACKED], - "print the arguments passed to the linker (default: no)"), print_llvm_passes: bool = (false, parse_bool, [UNTRACKED], "print the LLVM optimization passes being run (default: no)"), print_mono_items: Option = (None, parse_opt_string, [UNTRACKED], -- cgit 1.4.1-3-g733a5