MCP661: Move wasm32-wasi-preview1-threads to Tier2

This commit is contained in:
Georgii Rylov 2023-08-23 14:49:35 +01:00
parent 3475fa74e1
commit ac76882bf3
4 changed files with 24 additions and 15 deletions

View File

@ -10,7 +10,7 @@ bin="$PWD/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04/bin"
git clone https://github.com/WebAssembly/wasi-libc git clone https://github.com/WebAssembly/wasi-libc
cd wasi-libc cd wasi-libc
git reset --hard 7018e24d8fe248596819d2e884761676f3542a04 git reset --hard ec4566beae84e54952637f0bf61bee4b4cacc087
make -j$(nproc) \ make -j$(nproc) \
CC="$bin/clang" \ CC="$bin/clang" \
NM="$bin/llvm-nm" \ NM="$bin/llvm-nm" \

View File

@ -10,7 +10,7 @@ bin="$PWD/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04/bin"
git clone https://github.com/WebAssembly/wasi-libc git clone https://github.com/WebAssembly/wasi-libc
cd wasi-libc cd wasi-libc
git reset --hard 7018e24d8fe248596819d2e884761676f3542a04 git reset --hard ec4566beae84e54952637f0bf61bee4b4cacc087
make -j$(nproc) \ make -j$(nproc) \
CC="$bin/clang" \ CC="$bin/clang" \
NM="$bin/llvm-nm" \ NM="$bin/llvm-nm" \

View File

@ -179,6 +179,7 @@ target | std | notes
`wasm32-unknown-emscripten` | ✓ | WebAssembly via Emscripten `wasm32-unknown-emscripten` | ✓ | WebAssembly via Emscripten
`wasm32-unknown-unknown` | ✓ | WebAssembly `wasm32-unknown-unknown` | ✓ | WebAssembly
`wasm32-wasi` | ✓ | WebAssembly with WASI `wasm32-wasi` | ✓ | WebAssembly with WASI
[`wasm32-wasi-preview1-threads`](platform-support/wasm32-wasi-preview1-threads.md) | ✓ | | WebAssembly with WASI Preview 1 and threads
`x86_64-apple-ios` | ✓ | 64-bit x86 iOS `x86_64-apple-ios` | ✓ | 64-bit x86 iOS
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX [`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
`x86_64-fuchsia` | ✓ | Alias for `x86_64-unknown-fuchsia` `x86_64-fuchsia` | ✓ | Alias for `x86_64-unknown-fuchsia`
@ -321,7 +322,6 @@ target | std | host | notes
`thumbv7a-pc-windows-msvc` | ? | | `thumbv7a-pc-windows-msvc` | ? | |
`thumbv7a-uwp-windows-msvc` | ✓ | | `thumbv7a-uwp-windows-msvc` | ✓ | |
`thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode ARMv7-A Linux with NEON, MUSL `thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode ARMv7-A Linux with NEON, MUSL
[`wasm32-wasi-preview1-threads`](platform-support/wasm32-wasi-preview1-threads.md) | ✓ | | WebAssembly with WASI Preview 1 and threads
[`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly [`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly
`x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64 `x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64
[`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ? | | x86 64-bit tvOS [`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ? | | x86 64-bit tvOS

View File

@ -1,6 +1,6 @@
# `wasm32-wasi-preview1-threads` # `wasm32-wasi-preview1-threads`
**Tier: 3** **Tier: 2**
The `wasm32-wasi-preview1-threads` target is a new and still (as of July 2023) an The `wasm32-wasi-preview1-threads` target is a new and still (as of July 2023) an
experimental target. This target is an extension to `wasm32-wasi-preview1` target, experimental target. This target is an extension to `wasm32-wasi-preview1` target,
@ -70,12 +70,6 @@ compile `wasm32-wasi-preview1-threads` binaries straight out of the box. You can
reliably interoperate with C code in this mode (yet). reliably interoperate with C code in this mode (yet).
This target is not a stable target. This means that there are not many engines
which implement the `wasi-threads` feature and if they do they're likely behind a
flag, for example:
* Wasmtime - `--wasm-features=threads --wasi-modules=experimental-wasi-threads`
Also note that at this time the `wasm32-wasi-preview1-threads` target assumes the Also note that at this time the `wasm32-wasi-preview1-threads` target assumes the
presence of other merged wasm proposals such as (with their LLVM feature flags): presence of other merged wasm proposals such as (with their LLVM feature flags):
@ -94,6 +88,17 @@ The target intends to match the corresponding Clang target for its `"C"` ABI.
> found it's recommended to open an issue either with rust-lang/rust or ideally > found it's recommended to open an issue either with rust-lang/rust or ideally
> with LLVM itself. > with LLVM itself.
## Platform requirements
The runtime should support the same set of APIs as any other supported wasi target for interacting with the host environment through the WASI standard. The runtime also should have implemetation of [wasi-threads proposal](https://github.com/WebAssembly/wasi-threads).
This target is not a stable target. This means that there are a few engines
which implement the `wasi-threads` feature and if they do they're likely behind a
flag, for example:
* Wasmtime - `--wasm-features=threads --wasi-modules=experimental-wasi-threads`
* [WAMR](https://github.com/bytecodealliance/wasm-micro-runtime) - needs to be built with WAMR_BUILD_LIB_WASI_THREADS=1
## Building the target ## Building the target
Users need to install or built wasi-sdk since release 20.0 Users need to install or built wasi-sdk since release 20.0
@ -110,12 +115,16 @@ After that users can build this by adding it to the `target` list in
## Building Rust programs ## Building Rust programs
Since it is Tier 3, rust doesn't ship pre-compiled artifacts for this target. From Rust Nightly 1.71.1 (2023-08-03) on the artifacts are shipped pre-compiled:
Specify `wasi-root` as explained in the previous section and then use the `build-std` ```text
nightly cargo feature to build the standard library: rustup target add wasm32-wasi-preview1-threads --toolchain nightly
```shell ```
cargo +nightly build --target=wasm32-wasi-preview1-threads -Zbuild-std
Rust programs can be built for that target:
```text
rustc --target wasm32-wasi-preview1-threads your-code.rs
``` ```
## Cross-compilation ## Cross-compilation