Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonical ABI name mangling #309

Merged
merged 5 commits into from
Sep 12, 2022

Conversation

sunfishcode
Copy link
Member

This implements the Canonical ABI's function name-mangling scheme, as documented here.

It also renames expected to result and canonical_abi_realloc to cabi_realloc, to match the naming in the spec; those changes are in separate patches.

This follows the current Canonical ABI. This doesn't rename
`canonical_abi_free`, as that's expected to be removed when post-return
functions are implemented.
This follows the current Canonical ABI.
This implements the name-mangling scheme in the current canonical ABI,
with the modification proposed in WebAssembly/component-model#104,
though that can be easily removed if the proposal is declined.
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all seems reasonable enough to me, thanks! I opened an issue in the component model repository as I'm a bit worried about the size of the name mangling here, but that seems best discussed over there rather than here.

tests/runtime/invalid/wasm.rs Show resolved Hide resolved
@peterhuene
Copy link
Member

cc'ing @kulakowski-wasm as a heads up because I imagine he's been tackling the expected to result name change as part of his work to sync wit-bindgen to recent component model changes too.

@sunfishcode sunfishcode merged commit 9ef6717 into bytecodealliance:main Sep 12, 2022
@sunfishcode sunfishcode deleted the sunfishcode/mangling branch September 12, 2022 20:11
pchickey pushed a commit to pchickey/wit-bindgen that referenced this pull request Sep 30, 2022
this reverts a big chunk of the functionality introduced in bytecodealliance#309
alexcrichton pushed a commit that referenced this pull request Oct 3, 2022
* remove Canonical ABI name mangling

this reverts a big chunk of the functionality introduced in #309

* multi-return.wit: namespace these export functions

the tests already export functions named a,b,c in strings.wit. We can't
define more functions with that same name.

* remove mangled names from tests/runtime/invalid/wasm.rs
alexcrichton pushed a commit to alexcrichton/wasm-tools that referenced this pull request Nov 16, 2022
* remove Canonical ABI name mangling

this reverts a big chunk of the functionality introduced in bytecodealliance/wit-bindgen#309

* multi-return.wit: namespace these export functions

the tests already export functions named a,b,c in strings.wit. We can't
define more functions with that same name.

* remove mangled names from tests/runtime/invalid/wasm.rs
alexcrichton pushed a commit to alexcrichton/wasmtime-py that referenced this pull request Nov 16, 2022
* remove Canonical ABI name mangling

this reverts a big chunk of the functionality introduced in bytecodealliance/wit-bindgen#309

* multi-return.wit: namespace these export functions

the tests already export functions named a,b,c in strings.wit. We can't
define more functions with that same name.

* remove mangled names from tests/runtime/invalid/wasm.rs
guybedford pushed a commit to bytecodealliance/jco that referenced this pull request Dec 17, 2022
* remove Canonical ABI name mangling

this reverts a big chunk of the functionality introduced in bytecodealliance/wit-bindgen#309

* multi-return.wit: namespace these export functions

the tests already export functions named a,b,c in strings.wit. We can't
define more functions with that same name.

* remove mangled names from tests/runtime/invalid/wasm.rs
guybedford pushed a commit to bytecodealliance/jco that referenced this pull request Dec 17, 2022
* remove Canonical ABI name mangling

this reverts a big chunk of the functionality introduced in bytecodealliance/wit-bindgen#309

* multi-return.wit: namespace these export functions

the tests already export functions named a,b,c in strings.wit. We can't
define more functions with that same name.

* remove mangled names from tests/runtime/invalid/wasm.rs
guybedford pushed a commit to bytecodealliance/jco that referenced this pull request Dec 21, 2022
* remove Canonical ABI name mangling

this reverts a big chunk of the functionality introduced in bytecodealliance/wit-bindgen#309

* multi-return.wit: namespace these export functions

the tests already export functions named a,b,c in strings.wit. We can't
define more functions with that same name.

* remove mangled names from tests/runtime/invalid/wasm.rs
rvolosatovs pushed a commit to bytecodealliance/wrpc that referenced this pull request May 23, 2024
* remove Canonical ABI name mangling

this reverts a big chunk of the functionality introduced in bytecodealliance/wit-bindgen#309

* multi-return.wit: namespace these export functions

the tests already export functions named a,b,c in strings.wit. We can't
define more functions with that same name.

* remove mangled names from tests/runtime/invalid/wasm.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants