community icon indicating copy to clipboard operation
community copied to clipboard

emscripten - enable multithreading

Open SimplyLiz opened this issue 5 years ago • 1 comments

Could you please provide a way to build SDL2 for emscripten with --enable-thread / pthread and atomic?

right now, the configure script for SDL2 is always called with --disable-threads (and also atomic is disabled).

If there's a specific reason, you could add an option to enable / disable it to the package.

When crosscompiling my project for emscripten, linking fails with:

wasm atomics' feature is disallowed by SDL_spinlock.c.o, so --shared-memory must not be used

Looking at ~/.conan/data/sdl2/2.0.10/bincrafters/stable/source/source_subfolder/build-scripts/emscripten-buildbot.sh

i found --disable-threads in the emconfigure call.

Why is that disabled? I can't port my project to emscripten without multithreading. emscripten supports both -s USE_PTHREADS=1 and -pthread

Logs (Include/Attach if Applicable)

Click to expand log
Put your log output here

Edit: Maybe this helps: https://github.com/emscripten-core/emscripten/pull/8960

SimplyLiz avatar Feb 12 '20 12:02 SimplyLiz

Update. I found out that ALL libraries built with emscripten do have multithreading disabled. Luckily emscripten provides enough of the libraries (-S) i need to be able to compile / test a barebone application, but i still need some libraries from conan.

The libraries provided by emscripten are all multithreaded when using the flag, but i can't get conan to enable multithreading.

SimplyLiz avatar Feb 15 '20 08:02 SimplyLiz