Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.3k
gh-101538: Add experimental wasi-threads build#101537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
0ef8b66
gh-101538: Add experimental wasi-threads build
yamtc4543e1
Regen configure
yamt0980549
revert unnecessary config override
yamta1959a3
add a comment
yamtce7d5c2
configure.ac: add a comment
yamtbb26aa2
Regen configure
yamt1393295
Merge branch 'main' into wasi-threads
brettcannondd60e0a
Style: use AS_VAR_APPEND throughout the PR
erlend-aaslandbd6231f
Pull in main
erlend-aaslandFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
NextNext commit
gh-101538: Add experimental wasi-threads build
eg.```autoconfexport WASI_SDK_PATH=/opt/wasi-sdk-19.5g0236e959edbc./Tools/wasm/wasm_build.py wasi-threads build~/git/toywasm/b.thread/toywasm --wasi --wasi-dir . --wasi-dir ~/git/garbage/py/th2 -- builddir/wasi-threads/python.wasm ~/git/garbage/py/th2/thread.py```* I used an unreleased version of wasi-sdk* I used toywasm to test because wasmtime doesn't have necessary functionality yet.
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit0ef8b6609cfb399343a897cb12e9dbc51889b4fc
There are no files selected for viewing
1 change: 1 addition & 0 deletionsMisc/NEWS.d/next/Build/2023-02-03-21-36-42.gh-issue-101538.sF5F6S.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add experimental wasi-threads support. Patch by Takashi Yamamoto. |
7 changes: 7 additions & 0 deletionsPython/thread_pthread.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionsTools/wasm/config.site-wasm32-wasi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletionTools/wasm/wasm_build.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1053,7 +1053,11 @@ cat > conftest.c <<EOF | ||
# if defined(__EMSCRIPTEN__) | ||
wasm32-emscripten | ||
# elif defined(__wasi__) | ||
# if defined(_REENTRANT) | ||
wasm32-wasi-threads | ||
# else | ||
wasm32-wasi | ||
# endif | ||
# else | ||
# error unknown wasm32 platform | ||
# endif | ||
@@ -1245,7 +1249,7 @@ AC_ARG_ENABLE([wasm-pthreads], | ||
[ | ||
AS_CASE([$ac_sys_system], | ||
[Emscripten], [], | ||
[WASI], [], | ||
[AC_MSG_ERROR([--enable-wasm-pthreads only applies to Emscripten and WASI])] | ||
) | ||
], [ | ||
@@ -2199,6 +2203,15 @@ AS_CASE([$ac_sys_system], | ||
LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks" | ||
echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h | ||
AS_VAR_IF([enable_wasm_pthreads], [yes], [ | ||
# Note: update CFLAGS because ac_compile/ac_link needs this too | ||
CFLAGS="$CFLAGS -target wasm32-wasi-threads -pthread" | ||
erlend-aasland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
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,--max-memory=10485760"]) | ||
]) | ||
dnl increase initial memory and stack size, move stack first | ||
dnl https://github.com/WebAssembly/wasi-libc/issues/233 | ||
AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=524288 -Wl,--stack-first -Wl,--initial-memory=10485760"]) | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.