whitequark opened PR #1740 from x32-windows-traps
to master
:
This PR is a small incremental step towards a working Windows x32 backend. It implements what I believe is the correct approach to handling traps on x86_32 Windows, which is based on my understanding of x32 SEH: there is no global unwind registry at all, and instead SEH frames are pushed onto stack. Therefore no registration is needed. However I am by no means a Windows expert and my understanding might be incorrect.
There is no way to actually run code on Windows x32 yet because the fastcall ABI isn't implemented. I'll add that in a follow-up PR. I have a working prototype that can print
Hello, World
but it has some missing parts and requires major cleanup to be upstreamed.
alexcrichton submitted PR Review.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
I'm not entirely certain where this ends up being used elsewhere, but should this presumably return an error? We could then specifically ignore the error somewhere else or have some form of error handling?
(I'm not sure where errors here end up)
whitequark submitted PR Review.
whitequark created PR Review Comment:
The error would end up here: https://github.com/bytecodealliance/wasmtime/blob/68f0d2f6d0c84c090b590d3bda60369e7e45eac7/crates/jit/src/code_memory.rs#L210-L214
I think you're right and we should return an error here, since in that function
func.unwind_info == None
on x32 and this function would end up being never called at all.
whitequark updated PR #1740 from x32-windows-traps
to master
:
This PR is a small incremental step towards a working Windows x32 backend. It implements what I believe is the correct approach to handling traps on x86_32 Windows, which is based on my understanding of x32 SEH: there is no global unwind registry at all, and instead SEH frames are pushed onto stack. Therefore no registration is needed. However I am by no means a Windows expert and my understanding might be incorrect.
There is no way to actually run code on Windows x32 yet because the fastcall ABI isn't implemented. I'll add that in a follow-up PR. I have a working prototype that can print
Hello, World
but it has some missing parts and requires major cleanup to be upstreamed.
whitequark submitted PR Review.
whitequark created PR Review Comment:
Fixed
alexcrichton merged PR #1740.
Last updated: Dec 23 2024 at 13:07 UTC