From 0b6dce43096aff3eb8a3e0e43442441185129025 Mon Sep 17 00:00:00 2001 From: StackDoubleFlow Date: Mon, 7 Nov 2022 22:42:07 -0600 Subject: Issue error when `-C link-self-contained` option is used on unsupported platforms Document supported targets for `-C link-self-contained` Move `LinkSelfContainedDefault::True` from wasm_base to wasm32_wasi --- compiler/rustc_codegen_ssa/src/back/link.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_codegen_ssa/src/back') diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 4445e5f6c3a..2091730af22 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1588,6 +1588,9 @@ fn detect_self_contained_mingw(sess: &Session) -> bool { /// We only provide such support for a very limited number of targets. fn self_contained(sess: &Session, crate_type: CrateType) -> bool { if let Some(self_contained) = sess.opts.cg.link_self_contained { + if sess.target.link_self_contained == LinkSelfContainedDefault::False { + sess.emit_err(errors::UnsupportedLinkSelfContained); + } return self_contained; } -- cgit 1.4.1-3-g733a5