Ok, there are a few things happening here due to our incomplete implementation of pthreads+llvm backend in emscripten. Here's how you can hack around them.
wasm-ld: error: 'atomics' feature is used, so --shared-memory must be used
What's happening here is that Emscripten should be passing --shared-memory
to the linker because multithreaded applications require a wasm shared memory, but it's not. You can pass this flag manually to the linker with -Wl,--shared-memory
.
wasm-ld: error: Target feature 'atomics' is disallowed. Use --no-check-features to suppress.
You're getting this error because emscripten is trying to link your code against a libc (or other library) that contained atomic operations in its source but was compiled for MVP, which caused those atomic operations to be lowered to non-atomic operations. Linking your multithreaded code with these libraries is