Skip to content

Commit 5dfa717

Browse files
authored
gh-111046: for wasi-threads, export memory as well via the linker (GH-111099)
1 parent 0937b11 commit 5dfa717

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
@@ -2162,10 +2162,15 @@ AS_CASE([$ac_sys_system],
21622162
# without this, configure fails to find pthread_create, sem_init,
21632163
# etc because they are only available in the sysroot for
21642164
# wasm32-wasi-threads.
2165+
# Note: wasi-threads requires --import-memory.
2166+
# Note: wasi requires --export-memory.
2167+
# Note: --export-memory is implicit unless --import-memory is given
2168+
# Note: this requires LLVM >= 16.
21652169
AS_VAR_APPEND([CFLAGS], [" -target wasm32-wasi-threads -pthread"])
21662170
AS_VAR_APPEND([CFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
21672171
AS_VAR_APPEND([LDFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
21682172
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--import-memory"])
2173+
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--export-memory"])
21692174
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--max-memory=10485760"])
21702175
])
21712176

0 commit comments

Comments
 (0)