From db14d81098a9eb4d46880fa905f71a204b994942 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Thu, 9 Jun 2022 12:52:03 -0700 Subject: [PATCH 1/3] Remove -sASSERTIONS=1 from wasm32_unknown_emscripten default link args This is a debug setting. We should only make debug builds if user requests a debug build. Currently this is inserted in release builds. Furthermore, it would be better to insert these settings in --pre-link-args because then it would be possible to override them if appropriate. Because these are inserted at the end, it is necessary to patch emscripten to remove them. --- compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs index b34cac41d78ca..f02db4b0f3578 100644 --- a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs +++ b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs @@ -20,8 +20,6 @@ pub fn target() -> Target { "-s".into(), "ERROR_ON_UNDEFINED_SYMBOLS=1".into(), "-s".into(), - "ASSERTIONS=1".into(), - "-s".into(), "ABORTING_MALLOC=0".into(), "-Wl,--fatal-warnings".into(), ], From 9f305d3fa5a99661172de54dbf3300634e0e5dfc Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Thu, 9 Jun 2022 13:37:38 -0700 Subject: [PATCH 2/3] Remove ERROR_ON_UNDEFINED_SYMBOLS according to sbc100's comments --- compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs index f02db4b0f3578..57a8dc1460751 100644 --- a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs +++ b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs @@ -17,8 +17,6 @@ pub fn target() -> Target { post_link_args.insert( LinkerFlavor::Em, vec![ - "-s".into(), - "ERROR_ON_UNDEFINED_SYMBOLS=1".into(), "-s".into(), "ABORTING_MALLOC=0".into(), "-Wl,--fatal-warnings".into(), From b32238ae6f788bf14b24c46e1e9224c21dd59846 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Thu, 9 Jun 2022 14:07:08 -0700 Subject: [PATCH 3/3] Clean up --- compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs index 57a8dc1460751..975051100b039 100644 --- a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs +++ b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs @@ -16,11 +16,7 @@ pub fn target() -> Target { let mut post_link_args = LinkArgs::new(); post_link_args.insert( LinkerFlavor::Em, - vec![ - "-s".into(), - "ABORTING_MALLOC=0".into(), - "-Wl,--fatal-warnings".into(), - ], + vec!["-sABORTING_MALLOC=0".into(), "-Wl,--fatal-warnings".into()], ); let opts = TargetOptions {