From 5d14b24af0be37dbfaf2542256bf18260efda3bd Mon Sep 17 00:00:00 2001 From: DongHyun Kim Date: Fri, 27 Oct 2023 01:52:53 +0900 Subject: [PATCH 1/2] Match wasm32-unknown-unknown ABI with clang --- .../rustc_target/src/spec/wasm32_unknown_unknown.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs b/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs index 06529c2e4039d..664a232f368c8 100644 --- a/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs +++ b/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs @@ -17,16 +17,6 @@ pub fn target() -> Target { let mut options = wasm_base::options(); options.os = "unknown".into(); - // This is a default for backwards-compatibility with the original - // definition of this target oh-so-long-ago. Once the "wasm" ABI is - // stable and the wasm-bindgen project has switched to using it then there's - // no need for this and it can be removed. - // - // Currently this is the reason that this target's ABI is mismatched with - // clang's ABI. This means that, in the limit, you can't merge C and Rust - // code on this target due to this ABI mismatch. - options.default_adjusted_cabi = Some(Abi::Wasm); - options.add_pre_link_args( LinkerFlavor::WasmLld(Cc::No), &[ From c19b6a113b29f2d6219a27ffac745801c8e3e299 Mon Sep 17 00:00:00 2001 From: DongHyun Kim Date: Fri, 27 Oct 2023 02:07:26 +0900 Subject: [PATCH 2/2] Remove an unused import --- compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs b/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs index 664a232f368c8..fc1c66b908a9f 100644 --- a/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs +++ b/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs @@ -11,7 +11,6 @@ //! Group nowadays at . use super::{wasm_base, Cc, LinkerFlavor, Target}; -use crate::spec::abi::Abi; pub fn target() -> Target { let mut options = wasm_base::options();