diff options
author | Christian Heimes <christian@python.org> | 2022-08-01 14:37:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 14:37:45 (GMT) |
commit | e62a0dfab2bbc29324ca1879e287fff7fa8f21e0 (patch) | |
tree | 024357a512b6fa49ce42c8c331de3d2e56851bc2 /Tools/wasm | |
parent | 9af9ea28e756a8a1961b065856c697fc1262ca82 (diff) | |
download | cpython-e62a0dfab2bbc29324ca1879e287fff7fa8f21e0.zip cpython-e62a0dfab2bbc29324ca1879e287fff7fa8f21e0.tar.gz cpython-e62a0dfab2bbc29324ca1879e287fff7fa8f21e0.tar.bz2 |
[3.11] gh-95174: Add pthread stubs for WASI (GH-95234) (#95503)
Co-authored-by: Brett Cannon <brett@python.org>.
(cherry picked from commit 0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae)
Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Tools/wasm')
-rw-r--r-- | Tools/wasm/README.md | 17 | ||||
-rw-r--r-- | Tools/wasm/config.site-wasm32-wasi | 8 | ||||
-rwxr-xr-x | Tools/wasm/wasi-env | 7 |
3 files changed, 4 insertions, 28 deletions
diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index d08e807..6496a29 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -226,16 +226,13 @@ AddType application/wasm wasm # WASI (wasm32-wasi) -WASI builds require [WASI SDK](https://github.com/WebAssembly/wasi-sdk) 15.0+ -and currently [wasix](https://github.com/singlestore-labs/wasix) for POSIX -compatibility stubs. +WASI builds require [WASI SDK](https://github.com/WebAssembly/wasi-sdk) 16.0+. ## Cross-compile to wasm32-wasi The script ``wasi-env`` sets necessary compiler and linker flags as well as ``pkg-config`` overrides. The script assumes that WASI-SDK is installed in -``/opt/wasi-sdk`` or ``$WASI_SDK_PATH`` and WASIX is installed in -``/opt/wasix`` or ``$WASIX_PATH``. +``/opt/wasi-sdk`` or ``$WASI_SDK_PATH``. ```shell mkdir -p builddir/wasi @@ -434,21 +431,15 @@ rm -f wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz ### Install [wasmtime](https://github.com/bytecodealliance/wasmtime) WASI runtime -**NOTE**: wasmtime 0.37 has a bug. Newer versions should be fine again. +wasmtime 0.38 or newer is required. ```shell curl -sSf -L -o ~/install-wasmtime.sh https://wasmtime.dev/install.sh chmod +x ~/install-wasmtime.sh -~/install-wasmtime.sh --version v0.36.0 +~/install-wasmtime.sh --version v0.38.0 ln -srf -t /usr/local/bin/ ~/.wasmtime/bin/wasmtime ``` -### Install [WASIX](https://github.com/singlestore-labs/wasix) - -```shell -git clone https://github.com/singlestore-labs/wasix.git ~/wasix -make install -C ~/wasix -``` ### WASI debugging diff --git a/Tools/wasm/config.site-wasm32-wasi b/Tools/wasm/config.site-wasm32-wasi index 237fa8b..893a0d1 100644 --- a/Tools/wasm/config.site-wasm32-wasi +++ b/Tools/wasm/config.site-wasm32-wasi @@ -32,14 +32,6 @@ ac_cv_func_makedev=no # OSError: [Errno 28] Invalid argument: '.' ac_cv_func_fdopendir=no -# WASIX stubs we don't want to use. -ac_cv_func_kill=no - -# WASI SDK 15.0 does not have chmod. -# Ignore WASIX stubs for now. -ac_cv_func_chmod=no -ac_cv_func_fchmod=no - # WASI sockets are limited to operations on given socket fd and inet sockets. # Disable AF_UNIX and AF_PACKET support, see socketmodule.h. ac_cv_header_sys_un_h=no diff --git a/Tools/wasm/wasi-env b/Tools/wasm/wasi-env index 06c54e6..6c2d56e 100755 --- a/Tools/wasm/wasi-env +++ b/Tools/wasm/wasi-env @@ -31,7 +31,6 @@ fi WASI_SDK_PATH="${WASI_SDK_PATH:-/opt/wasi-sdk}" WASI_SYSROOT="${WASI_SDK_PATH}/share/wasi-sysroot" -WASIX_PATH="${WASIX_PATH:-/opt/wasix}" if ! test -x "${WASI_SDK_PATH}/bin/clang"; then echo "Error: ${WASI_SDK_PATH}/bin/clang does not exist." >&2 @@ -65,12 +64,6 @@ PKG_CONFIG_PATH="" PKG_CONFIG_LIBDIR="${WASI_SYSROOT}/lib/pkgconfig:${WASI_SYSROOT}/share/pkgconfig" PKG_CONFIG_SYSROOT_DIR="${WASI_SYSROOT}" -# add WASIX (POSIX stubs for WASI) if WASIX is installed -if test -f "${WASIX_PATH}/lib/libwasix.a"; then - CFLAGS="${CFLAGS} -isystem ${WASIX_PATH}/include" - LDFLAGS="${LDFLAGS} -L${WASIX_PATH}/lib -lwasix" -fi - PATH="${WASI_SDK_PATH}/bin:${PATH}" export WASI_SDK_PATH WASI_SYSROOT |