emscripten-core / emscripten-core/emscripten

SDL2 prevents compilation with WASM_Workers or PTHREADS.

Open
#19,667 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Adding either `-sWASM_WORKERS` in my Makefile here: https://github.com/FrostKiwi/frostorama/blob/751cb0bdf99de609db57cb4134991d8b09135652/Makefile#L43 or `-pthread` in the c flags here
https://github.com/FrostKiwi/frostorama/blob/751cb0bdf99de609db57cb4134991d8b09135652/Makefile#L11 causes `wasm-ld: error: --shared-memory is disallowed by SDL_atomic.c.o because it was not compiled with 'atomics' or 'bulk-memory' features.` and breaks compilation. With `-s SDL2_IMAGE_FORMATS='["jpg", "png", "heic"]'` enabled, the error message becomes:
`wasm-ld: error: --shared-memory is disallowed by IMG_jpg.c.o because it was not compiled with 'atomics' or 'bulk-memory' features.`

I assume https://github.com/emscripten-core/emscripten/pull/18379 has to be used instead of master to get this working.
Version of emscripten/emsdk

```console
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.38 (9eff02bc816c50ab0e3b70a3bd5b72a8dc2893a2)
clang version 17.0.0 (https://github.com/llvm/llvm-project 004bf170c6cbaa049601bcf92f86a9459aec2dc2)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:\\min\home\artsimow\build\emsdk\upstream\bin
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.