From 8e09f42042b5644aff05931b08112154c0575d5d Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Tue, 21 Jun 2022 13:19:44 -0700 Subject: [PATCH 1/2] Update Emscripten's no_default_libraries handling --- compiler/rustc_codegen_ssa/src/back/linker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index 8ac5f094cf6ee..b5b63942e2c6e 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -1140,7 +1140,7 @@ impl<'a> Linker for EmLinker<'a> { fn no_crt_objects(&mut self) {} fn no_default_libraries(&mut self) { - self.cmd.args(&["-s", "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]"]); + self.cmd.arg("-nodefaultlibs"); } fn export_symbols(&mut self, _tmpdir: &Path, _crate_type: CrateType, symbols: &[String]) { From b96ae9b20442b59c471baec6c4d612e3434d893c Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Wed, 22 Jun 2022 17:43:10 -0700 Subject: [PATCH 2/2] Set no_default_libraries: false in wasm32_emscripten target --- compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs index 975051100b039..6a1a5e7a1d712 100644 --- a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs +++ b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs @@ -28,6 +28,7 @@ pub fn target() -> Target { linker: None, is_like_emscripten: true, panic_strategy: PanicStrategy::Unwind, + no_default_libraries: false, post_link_args, families: cvs!["unix", "wasm"], ..options