Skip to content

Commit cc45ad5

Browse files
Rollup merge of #98355 - hoodmane:emscripten-no-default, r=petrochenkov
Update no_default_libraries handling for emscripten target ```@sbc100``` says: > `-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]` is almost certainly wrong/out-of-date. This setting defaults to the empty list anyway these days so its redundant. Also we now support `-nodefaultlibs` so you can use that, as with other toolchains. #98303 (comment)
2 parents 21085e9 + b96ae9b commit cc45ad5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/rustc_codegen_ssa/src/back/linker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ impl<'a> Linker for EmLinker<'a> {
11401140
fn no_crt_objects(&mut self) {}
11411141

11421142
fn no_default_libraries(&mut self) {
1143-
self.cmd.args(&["-s", "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]"]);
1143+
self.cmd.arg("-nodefaultlibs");
11441144
}
11451145

11461146
fn export_symbols(&mut self, _tmpdir: &Path, _crate_type: CrateType, symbols: &[String]) {

compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub fn target() -> Target {
2828
linker: None,
2929
is_like_emscripten: true,
3030
panic_strategy: PanicStrategy::Unwind,
31+
no_default_libraries: false,
3132
post_link_args,
3233
families: cvs!["unix", "wasm"],
3334
..options

0 commit comments

Comments
 (0)