wasm32-unknown-unknown - The C ABI Changes That You Need to Know About | HackerNoon
Briefly

The wasm32-unknown-unknown target's extern "C" ABI has been using a non-standard definition since its inception. This outdated ABI leaks internal compiler details and does not align with the official C ABI of WebAssembly. Originally defined with little care in 2017, it became more problematic as it failed to meet standard conventions for inter-tool communication. While other targets like WASI adopted improved ABIs, wasm32-unknown-unknown continued with its flawed approach. The upcoming change in future Rust compiler versions aims to rectify this issue by implementing the correct ABI, resulting in altered WebAssembly binaries.
The current non-standard extern "C" ABI for the wasm32-unknown-unknown target will be replaced by the official C ABI in a future Rust compiler version.
Historically, the ABI definition for wasm32-unknown-unknown has conflicted with the official WebAssembly tool-conventions, causing various issues that necessitated correction.
The importance of maintaining a correct ABI is reflected in the 2021 shift to correct definitions for WASI targets, indicating a broader awareness and demand within the Rust and WebAssembly communities.
The transition to the official WebAssembly C ABI means WebAssembly binaries for the wasm32-unknown-unknown target will change, warranting attention from developers and users of the Rust compiler.
Read at Hackernoon
[
|
]