Skip to content

Preparing for C ABI changes #310

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

Closed
tlively opened this issue Aug 17, 2020 · 2 comments
Closed

Preparing for C ABI changes #310

tlively opened this issue Aug 17, 2020 · 2 comments

Comments

@tlively
Copy link
Member

tlively commented Aug 17, 2020

I saw in #309 (comment) that the witx tooling the WASI ecosystem uses depends on the details of the WebAssembly C ABI. There are a couple changes we are discussing making in a new C ABI, so I wanted to check in and see if any of them present a compatibility risk with the WASI ecosystem. If so, we should discuss whether the changes are worth the cost and how to make any ABI transition as seamless as possible.

First, there is discussion about changing the alignment of long double from 16 bytes to 8 bytes. This could change the memory layout of any struct containing long doubles. Does the WASI ecosystem use long double at all?

Second, we are considering introducing a new calling convention when multivalue is enabled in LLVM. If we do enable that new calling convention by default whenever -mmultivalue is passed to clang (or multivalue is enabled in rustc), what kind of changes would be needed in the witx tooling?

@sunfishcode
Copy link
Member

No WASI APIs themselves use long double, so the question would be whether there are any users using long double. I don't think we have a reliable way to determine this.

Concerning -mmultivalue, no immediate changes to witx tooling are needed to keep things working, as the witx tooling currently lowers multiple return values into out paramters itself before clang sees anything, so it will work the same way with or without -mmultivalue. So from WASI's perspective, you can go ahead with this transition, and then we'll update the witx tooling to translate witx multivalue into wasm multievalue once the transition has settled.

@tlively
Copy link
Member Author

tlively commented Aug 26, 2020

Thanks, @sunfishcode! That's all I needed to know, so I'll go ahead and close the issue :)

@tlively tlively closed this as completed Aug 26, 2020
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

No branches or pull requests

2 participants