Skip to content

Commit 48f676e

Browse files
fix: add -mcpu=mvp and -mmutable-globals for wasm32v1-none (#1524)
fix: add `-mcpu=mvp` and `-mmutable-globals` for `wasm32v1-none`
1 parent a928923 commit 48f676e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,6 +2531,13 @@ impl Build {
25312531
}
25322532
}
25332533

2534+
if raw_target == "wasm32v1-none" {
2535+
// `wasm32v1-none` target only exists in `rustc`, so we need to change the compilation flags:
2536+
// https://doc.rust-lang.org/rustc/platform-support/wasm32v1-none.html
2537+
cmd.push_cc_arg("-mcpu=mvp".into());
2538+
cmd.push_cc_arg("-mmutable-globals".into());
2539+
}
2540+
25342541
if target.os == "solaris" || target.os == "illumos" {
25352542
// On Solaris and illumos, multi-threaded C programs must be built with `_REENTRANT`
25362543
// defined. This configures headers to define APIs appropriately for multi-threaded

0 commit comments

Comments
 (0)