Repository navigation
Closed
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This issue is intended to be a tracking issue for the future-incompat warning being added in #138601. This lint is notifying users of an upcoming change to the C ABI used by the wasm32-unknown-unknown target, notably around passing aggregates-by-value in parameter position. An exampe of code that will change is:
#[repr(C)]
pub struct Pair {
x: u32,
y: u32,
}
#[unsafe(no_mangle)]
pub extern "C" fn pair_add(pair: Pair) -> u32 {
pair.x + pair.y
}where today this generates:
(func $pair_add (param i32 i32) (result i32)
local.get 1
local.get 0
i32.add
)but in the future this will generate:
(func (param i32) (result i32)
local.get 0
i32.load offset=4
local.get 0
i32.load
i32.add
)More details about this change and its history can be found in the blog post associated with this change. In short though users need to do one of the following to resolve the warnings:
- Pin to a stable compiler and don't update until the default has changed.
- Update to nightly, pass
-Zwasm-c-abi=spec, and then use that until the default changes. This means signatures will change immediately and work will be necessary to port external JS for example. - Update to nightly, pass
-Zwasm-c-abi=legacy. This will silence the warnings but be warned that code will still break in the future when the ABI changes. - Update function signatures to not pass aggregates-by-value, but instead pass them by reference. This works both today and with the future ABI.
The current plan is to change the default ABI mid-summer 2025. This'll get updated with exact timelines as things happen. More background can be found in #122532
Implementation history
Reacted by Kane York
Reacted by Mingwei Samuel
Metadata
Metadata
Assignees
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
[-]Tracking issue for wasm32-unknown-unknown's future-incompat warning[/-][+]Tracking issue for wasm32-unknown-unknown's future-incompat warning for C ABI changes[/+]Rollup merge of rust-lang#138601 - RalfJung:wasm-abi-fcw, r=alexcrichton
Rollup merge of rust-lang#138601 - RalfJung:wasm-abi-fcw, r=alexcrichton
Auto merge of rust-lang#138601 - RalfJung:wasm-abi-fcw, r=<try>
Auto merge of rust-lang#138601 - RalfJung:wasm-abi-fcw, r=<try>
Auto merge of rust-lang#138601 - RalfJung:wasm-abi-fcw, r=<try>
Auto merge of rust-lang#138601 - RalfJung:wasm-abi-fcw, r=alexcrichton
Auto merge of #138601 - RalfJung:wasm-abi-fcw, r=alexcrichton
16 remaining items
Rollup merge of rust-lang#139809 - alexcrichton:wasm-simd-safe, r=Ral…
Rollup merge of rust-lang#139809 - alexcrichton:wasm-simd-safe, r=Ral…
Unrolled build for rust-lang#139809
Ignore zero-sized types in wasm future-compat warning
Don't warn about `v128` in wasm ABI transition
Rollup merge of #139809 - alexcrichton:wasm-simd-safe, r=RalfJung
Rollup merge of rust-lang#133952 - bjorn3:remove_wasm_legacy_abi, r=a…
Rollup merge of rust-lang#133952 - bjorn3:remove_wasm_legacy_abi, r=a…
Rollup merge of rust-lang#133952 - bjorn3:remove_wasm_legacy_abi, r=a…
Rollup merge of rust-lang#133952 - bjorn3:remove_wasm_legacy_abi, r=a…
Rollup merge of rust-lang#133952 - bjorn3:remove_wasm_legacy_abi, r=a…
Unrolled build for #133952
Rollup merge of rust-lang#133952 - bjorn3:remove_wasm_legacy_abi, r=a…
Rollup merge of #133952 - bjorn3:remove_wasm_legacy_abi, r=alexcrichton