From 94bf59ea34a1592ca8797e03ac4511e344139cdf Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sat, 12 Dec 2020 22:31:35 -0600 Subject: [PATCH] Use correct ABI for wasm32 by default Introduces `RUSTC_USE_WASM32_BINDGEN_COMPAT_ABI` env var to use the compat ABI if need. --- compiler/rustc_target/src/abi/call/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index 5de9a8dfa7ac1..73c1296a68643 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -605,7 +605,12 @@ impl<'a, Ty> FnAbi<'a, Ty> { "nvptx64" => nvptx64::compute_abi_info(self), "hexagon" => hexagon::compute_abi_info(self), "riscv32" | "riscv64" => riscv::compute_abi_info(cx, self), - "wasm32" if cx.target_spec().os != "emscripten" => { + "wasm32" + if cx.target_spec().os != "emscripten" + && std::env::var("RUSTC_USE_WASM32_BINDGEN_COMPAT_ABI") + .map(|x| &x != "0") + .unwrap_or(false) => + { wasm32_bindgen_compat::compute_abi_info(self) } "wasm32" | "asmjs" => wasm32::compute_abi_info(cx, self),