Skip to content

Commit 727f8ee

Browse files
miss-islingtonyamt
andauthored
[3.12] gh-111046: for wasi-threads, export memory as well via the linker (GH-111099) (GH-111141)
gh-111046: for wasi-threads, export memory as well via the linker (GH-111099) (cherry picked from commit 5dfa717) Co-authored-by: YAMAMOTO Takashi <[email protected]>
1 parent 4a10260 commit 727f8ee

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
For wasi-threads, memory is now exported to fix compatibility issues with some wasm runtimes.

configure

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

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,10 +2326,15 @@ AS_CASE([$ac_sys_system],
23262326
# without this, configure fails to find pthread_create, sem_init,
23272327
# etc because they are only available in the sysroot for
23282328
# wasm32-wasi-threads.
2329+
# Note: wasi-threads requires --import-memory.
2330+
# Note: wasi requires --export-memory.
2331+
# Note: --export-memory is implicit unless --import-memory is given
2332+
# Note: this requires LLVM >= 16.
23292333
AS_VAR_APPEND([CFLAGS], [" -target wasm32-wasi-threads -pthread"])
23302334
AS_VAR_APPEND([CFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
23312335
AS_VAR_APPEND([LDFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
23322336
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--import-memory"])
2337+
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--export-memory"])
23332338
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--max-memory=10485760"])
23342339
])
23352340

0 commit comments

Comments
 (0)