gh-111046: for wasi-threads, export memory as well via the linker (GH-111099)

This commit is contained in:
YAMAMOTO Takashi 2023-10-21 06:54:03 +09:00 committed by GitHub
parent 0937b11b89
commit 5dfa71769f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -2162,10 +2162,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"])
])