Stream: cranelift

Topic: VarArgs


view this post on Zulip Drew Ridley (Feb 07 2024 at 16:25):

Hi all,
I created this topic to discuss the issue: https://github.com/bytecodealliance/wasmtime/issues/1030.
I wasn't really sure about the status of varargs in cranelift, or if they are something that should be implemented in the frontend. If there is consensus that this is something we want, I would be happy to work towards contributing a meaningful PR on this front.

In order to compile C code that calls printf in libc, we need to implement the caller side of varargs. And in order to compile printf itself, we need to implement the callee side.

view this post on Zulip bjorn3 (Feb 07 2024 at 16:40):

This can't be implemented in the frontend. on arm64 macOS varargs are treated quite differently from regular args with respect to the abi in a way that the frontend can't emulate. On x86_64 you need to set a register with the amount of float args, which the frontend can't do anyway.

view this post on Zulip bjorn3 (Feb 07 2024 at 16:40):

I need vararg support for cg_clif.

view this post on Zulip Notification Bot (Feb 07 2024 at 17:10):

This topic was moved here from #general > VarArgs by fitzgen (he/him).


Last updated: Nov 22 2024 at 16:03 UTC