Skip to content

Commit 2106434

Browse files
committed
bootstrap: Pass correct linker-flavor flag for wasm targets
1 parent a4166da commit 2106434

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bootstrap/src/utils/helpers.rs

+8
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,14 @@ pub fn linker_flags(
473473
// cfg(bootstrap) - remove after updating bootstrap compiler (#137498)
474474
if stage == 0 && target.is_windows() {
475475
args.push("-Clink-arg=-fuse-ld=lld".to_string());
476+
} else if target.starts_with("wasm") {
477+
if target.ends_with("unknown") || target.ends_with("none") {
478+
args.push("-Clinker-flavor=wasm-lld".to_string());
479+
} else if target.ends_with("emscripten") {
480+
args.push("-Clinker-flavor=em-cc".to_string());
481+
} else {
482+
args.push("-Clinker-flavor=wasm-lld-cc".to_string());
483+
}
476484
} else {
477485
args.push("-Clinker-flavor=gnu-lld-cc".to_string());
478486
}

0 commit comments

Comments
 (0)