summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-07-27 18:28:06 (GMT)
committerGitHub <noreply@github.com>2022-07-27 18:28:06 (GMT)
commit0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae (patch)
treea6222de1305545869eed745741bbf1f1b3e5f728 /Tools
parent226d02bb109d08601fbccd645e9d67aee2e5bcdc (diff)
downloadcpython-0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae.zip
cpython-0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae.tar.gz
cpython-0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae.tar.bz2
gh-95174: Add pthread stubs for WASI (GH-95234)
Co-authored-by: Brett Cannon <brett@python.org>
Diffstat (limited to 'Tools')
-rw-r--r--Tools/wasm/README.md17
-rw-r--r--Tools/wasm/config.site-wasm32-wasi8
-rwxr-xr-xTools/wasm/wasi-env7
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