Skip to content

Commit 52ff470

Browse files
committed
gh-160873: Use -m64 and -pthread for Emscripten
1 parent f8e63bd commit 52ff470

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎Platforms/emscripten/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ await createEmscriptenModule({
138138

139139
- Threading is disabled by default. The ``configure`` option
140140
``--enable-wasm-pthreads`` adds compiler flag ``-pthread`` and
141-
linker flags ``-sUSE_PTHREADS -sPROXY_TO_PTHREAD``.
141+
linker flags ``-pthread -sPROXY_TO_PTHREAD``.
142142
- pthread support requires WASM threads and SharedArrayBuffer (bulk memory).
143143
The Node.JS runtime keeps a pool of web workers around. Each web worker
144144
uses several file descriptors (eventfd, epoll, pipe).

‎configure‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,12 +1153,12 @@ if test -z "$CFLAGS"; then
11531153
fi
11541154

11551155
dnl Emscripten SDK and WASI SDK default to wasm32.
1156-
dnl On Emscripten use MEMORY64 setting to build target wasm64-emscripten.
1156+
dnl On Emscripten use -m64 to build target wasm64-emscripten.
11571157
dnl for wasm64.
11581158
AS_CASE([$host],
11591159
[wasm64-*-emscripten], [
1160-
AS_VAR_APPEND([CFLAGS], [" -sMEMORY64=1"])
1161-
AS_VAR_APPEND([LDFLAGS], [" -sMEMORY64=1"])
1160+
AS_VAR_APPEND([CFLAGS], [" -m64"])
1161+
AS_VAR_APPEND([LDFLAGS], [" -m64"])
11621162
],
11631163
)
11641164

@@ -2659,7 +2659,7 @@ AS_CASE([$ac_sys_system],
26592659
26602660
AS_VAR_IF([enable_wasm_pthreads], [yes], [
26612661
AS_VAR_APPEND([CFLAGS_NODIST], [" -pthread"])
2662-
AS_VAR_APPEND([LDFLAGS_NODIST], [" -sUSE_PTHREADS"])
2662+
AS_VAR_APPEND([LDFLAGS_NODIST], [" -pthread"])
26632663
AS_VAR_APPEND([LINKFORSHARED], [" -sPROXY_TO_PTHREAD"])
26642664
])
26652665
dnl not completely sure whether or not we want -sEXIT_RUNTIME, keeping it for now.

0 commit comments

Comments
 (0)