Skip to content

Commit

Permalink
[3.12] pythongh-111046: for wasi-threads, export memory as well via t…
Browse files Browse the repository at this point in the history
…he linker (pythonGH-111099) (pythonGH-111141)

pythongh-111046: for wasi-threads, export memory as well via the linker (pythonGH-111099)
(cherry picked from commit 5dfa717)

Co-authored-by: YAMAMOTO Takashi <[email protected]>
  • Loading branch information
miss-islington and yamt authored Oct 20, 2023
1 parent 4a10260 commit 727f8ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For wasi-threads, memory is now exported to fix compatibility issues with some wasm runtimes.
5 changes: 5 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2326,10 +2326,15 @@ AS_CASE([$ac_sys_system],
# without this, configure fails to find pthread_create, sem_init,
# etc because they are only available in the sysroot for
# wasm32-wasi-threads.
# Note: wasi-threads requires --import-memory.
# Note: wasi requires --export-memory.
# Note: --export-memory is implicit unless --import-memory is given
# Note: this requires LLVM >= 16.
AS_VAR_APPEND([CFLAGS], [" -target wasm32-wasi-threads -pthread"])
AS_VAR_APPEND([CFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
AS_VAR_APPEND([LDFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--import-memory"])
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--export-memory"])
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--max-memory=10485760"])
])
Expand Down

0 comments on commit 727f8ee

Please sign in to comment.