Open JavaDerg opened 2 years ago
I get a similar error, but with unistd.h
instead. I believe this is due to this crate being bindings and not a native rust crate.
If anyone has figured this out, I would love to know what the workaround is. Seems like as mimalloc supports WASM already, this should be very feasible.
Seems this won't be happening any time soon for wasm32-unknown-unknown
😢 https://github.com/rustwasm/team/issues/291 but emscripten maybe will work? Mimalloc would have to be ported completely to rust for it to be able to compile on wasm32-unknown-unknown
https://github.com/rustwasm/team/issues/291#issuecomment-645482430:
The only way to mix Rust and C code when targeting WebAssembly is to use the wasm32-unknown-emscripten target. You cannot use wasm-bindgen when you do that because wasm-bindgen is fundamentally incompatible with C. Using WASI will not work. There is no workaround. There are long term plans to make wasm32-unknown-unknown and wasm32-wasi compatible with C, but there is no ETA for that.
Seems this won't be happening any time soon for
wasm32-unknown-unknown
cry rustwasm/team#291 but emscripten maybe will work? Mimalloc would have to be ported completely to rust for it to be able to compile onwasm32-unknown-unknown
The only way to mix Rust and C code when targeting WebAssembly is to use the wasm32-unknown-emscripten target. You cannot use wasm-bindgen when you do that because wasm-bindgen is fundamentally incompatible with C. Using WASI will not work. There is no workaround. There are long term plans to make wasm32-unknown-unknown and wasm32-wasi compatible with C, but there is no ETA for that.
That sucks :/ Thanks for looking into it
@post-rex yea, np.
I'm trying to use mimalloc as allocator in a wasm project of mine; as far as I know mimalloc supports wasm as target, but it failes to build. I'm not sure what dependency or similar it requires to build successfully.