Use wasi-sdk 20 pre-release for tests with threads (#2021)

`wasi-sdk-20` pre-release can be used to avoid building `wasi-libc` to enable threads.
It's not possible to use `wasi-sdk-20` pre-release on Ubuntu 20.04 because of
incompatibility with the glibc version:
```bash
/opt/wasi-sdk/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
(required by /opt/wasi-sdk/bin/clang)
```
This commit is contained in:
Enrico Loparco
2023-03-17 13:02:03 +01:00
committed by GitHub
parent 23e9a356e5
commit 83659fa42a
7 changed files with 50 additions and 58 deletions

View File

@ -1,21 +1,13 @@
# "WASI threads" sample introduction
Currently, since the `wasi-sdk` does not have thread support in the latest release, make sure to have [wasi-libc](https://github.com/WebAssembly/wasi-libc) installed. Build it with threads enabled, e.g.
```shell
make \
AR=/opt/wasi-sdk/bin/llvm-ar \
NM=/opt/wasi-sdk/bin/llvm-nm \
CC=/opt/wasi-sdk/bin/clang \
THREAD_MODEL=posix
```
To run the sample, `wasi-sdk` >= 20 is required.
## Build and run the samples
```shell
$ mkdir build
$ cd build
$ cmake -DWASI_SYSROOT=/path/to/wasi-libc/sysroot ..
$ cmake ..
$ make
...
$ ./iwasm wasm-apps/no_pthread.wasm