Skip to content

Commit 781797a

Browse files
committed
Fix wasm-ld error
wasm-ld: error: --shared-memory is disallowed by build/emulate.o because it was not compiled with 'atomics' or 'bulk-memory' features.
1 parent 949bc21 commit 781797a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mk/wasm.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ OBJS_EXT += syscall_sdl.o
3434
LDFLAGS += -pthread
3535
endif
3636

37+
# setjmp/longjmp needs -pthread
38+
ifeq ($(call has, SYSTEM), 1)
39+
ifeq ($(call has, ELF_LOADER), 0)
40+
$(OUT)/emulate.o: CFLAGS += -pthread
41+
$(OUT)/syscall.o: CFLAGS += -pthread
42+
endif
43+
endif
44+
3745
# Emscripten build flags
3846
CFLAGS_emcc += -sINITIAL_MEMORY=2GB \
3947
-sALLOW_MEMORY_GROWTH \

0 commit comments

Comments
 (0)