sunfishcode / c-ward

An implementation of libc written in Rust
Other
187 stars 11 forks source link

Support setjmp/longjmp and sigsetjmp/siglongjmp #121

Closed bjorn3 closed 4 months ago

bjorn3 commented 6 months ago

Many C projects depend on this. For example lua and musl's dynamic linker. And (when __builtin_setjmp/__builtin_longjmp support is not detected) Wasmtime depends on it too.

sunfishcode commented 6 months ago

I don't know if it's possible to implement setjmp/longjmp in Rust. Wasmtime uses C code to call these functions.

bjorn3 commented 6 months ago

They can be implemented using global_asm!(), right? That is how musl implements it. Glibc either does that or a C function with inline asm mixed in depending on the architecture.

sunfishcode commented 4 months ago

setjmp/longjmp are now implemented in #125.

sunfishcode commented 4 months ago

sigsetjmp/siglongjmp are implemented in #126.