about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-01-07 18:03:07 +0800
committerBenjamin Lamowski <benjamin.lamowski@kernkonzept.com>2022-01-21 16:51:10 +0100
commit29d623528d4c9385c2762fb826b48e4d19470e89 (patch)
tree44bc06d41dd0dbf063fb103591937d967917aba1
parent660d993c642a2f88b84d5e1f0d8602b8136b9b4e (diff)
downloadrust-29d623528d4c9385c2762fb826b48e4d19470e89.tar.gz
rust-29d623528d4c9385c2762fb826b48e4d19470e89.zip
Gate `l4-bender` linker flavor
-rw-r--r--compiler/rustc_session/src/config.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 92ad0723f48..a756de4c0fc 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -12,7 +12,7 @@ use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::impl_stable_hash_via_hash;
 
 use rustc_target::abi::{Align, TargetDataLayout};
-use rustc_target::spec::{SplitDebuginfo, Target, TargetTriple, TargetWarnings};
+use rustc_target::spec::{LinkerFlavor, SplitDebuginfo, Target, TargetTriple, TargetWarnings};
 
 use rustc_serialize::json;
 
@@ -2237,6 +2237,16 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
         }
     }
 
+    if cg.linker_flavor == Some(LinkerFlavor::L4Bender)
+        && !nightly_options::is_unstable_enabled(matches)
+    {
+        early_error(
+            error_format,
+            "`l4-bender` linker flavor is unstable, `-Z unstable-options` \
+             flag must also be passed to explicitly use it",
+        );
+    }
+
     let prints = collect_print_requests(&mut cg, &mut debugging_opts, matches, error_format);
 
     let cg = cg;