3 ms·
When I was working on it the accepted solution was to compile as linux and statically link musl into the wasm binary, leaving mostly __syscallN symbols unresolv
by wrmsr 9y ago
When I was working on it the accepted solution was to compile as linux and statically link musl into the wasm binary, leaving mostly __syscallN symbols unresolved. As such it's a matter of implementing those on an as-needed basis (in javascript for emscripten and in java here). I at least successfully got sqlite opening a database in a pure java transpile that way. While it's a possibly inelegant approach on the face of it linux does at least have an aggressive 'dont break userspace' attitude and there is longstanding prior art for this on freebsd.
see: https://github.com/kripken/emscripten/blob/6dc4ac5f9e4d8484e273e4dcc554f809738cedd6/src/library_syscall.js https://github.com/kripken/emscripten/blob/6dc4ac5f9e4d8484e...