Skip to content

Commit 5292add

Browse files
fix(compiler/rustc_target): set correct linker flags for wasm32v1-none
1 parent 425a9c0 commit 5292add

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_target/src/spec/targets/wasm32v1_none.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ pub(crate) fn target() -> Target {
2929
// For now this target just never has an entry symbol no matter the output
3030
// type, so unconditionally pass this.
3131
"--no-entry",
32+
// It is also necessary to explicitly set the features since some changes
33+
// were made to WebAssembly starting with LLVM 20.1.0:
34+
// https://releases.llvm.org/20.1.0/docs/ReleaseNotes.html#changes-to-the-webassembly-backend
35+
"--features=+mutable-globals",
36+
"--no-check-features",
3237
],
3338
);
3439
options.add_pre_link_args(
@@ -37,7 +42,7 @@ pub(crate) fn target() -> Target {
3742
// Make sure clang uses LLD as its linker and is configured appropriately
3843
// otherwise
3944
"--target=wasm32-unknown-unknown",
40-
"-Wl,--no-entry",
45+
"-Wl,--no-entry,--features=+mutable-globals,--no-check-features",
4146
],
4247
);
4348

0 commit comments

Comments
 (0)