wasix-org / wasix-libc

wasix libc implementation for WebAssembly
https://wasi.dev
Other
114 stars 19 forks source link

Workaround for calling __wasm_signal when compiled by rustc #14

Closed Arshia001 closed 1 year ago

Arshia001 commented 1 year ago

This is a workaround for #13. default_handlers is reworked so that unless sigaction is called, no fprintf calls will be compiled into the final binary, and the rust libc calls sigaction_external_default, avoiding that.

ptitSeb commented 1 year ago

That seems rather complex to avoid linking with libclang_rt.builtins-wasm32.a that has the missing symbols of #14. It looks fine, but signals are always tricky to play with. Most internal funciton should be declared static to avoid exporting them.

Arshia001 commented 1 year ago

@ptitSeb Aside from the missing symbols, this change has the added benefit that it doesn't bloat all wasix binaries with the printf code (which is non-trivial in size). The changes you requested are in, please take another look.

ptitSeb commented 1 year ago

Looks good, merging.