Skip to content

Commit

Permalink
Fix installation and usage instructions in README.md (#488)
Browse files Browse the repository at this point in the history
* Add missing architecture URL part to the installation script

* Remove unnecessary `export`s from installation instructions

* Fix missing $ sign in export

* Add `WASI_OS` as new parameter to use & install scripts in README

---------

Co-authored-by: Andrew Brown <[email protected]>
  • Loading branch information
seclerp and abrown authored Sep 18, 2024
1 parent 754aec3 commit adbbf2c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,20 @@ see [RELEASING.md](RELEASING.md).
A typical installation from the release binaries might look like the following:

```shell script
export WASI_VERSION=20
export WASI_VERSION_FULL=${WASI_VERSION}.0
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
tar xvf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
WASI_OS=linux
WASI_ARCH=x86_64
WASI_VERSION=24
WASI_VERSION_FULL=${WASI_VERSION}.0
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-${WASI_ARCH}-${WASI_OS}.tar.gz
tar xvf wasi-sdk-${WASI_VERSION_FULL}-${WASI_ARCH}-${WASI_OS}.tar.gz
```

## Use

Use the clang installed in the `wasi-sdk` directory:

```shell script
export WASI_SDK_PATH=`pwd`/wasi-sdk-${WASI_VERSION_FULL}
WASI_SDK_PATH=`pwd`/wasi-sdk-${WASI_VERSION_FULL}-${WASI_ARCH}-${WASI_OS}
CC="${WASI_SDK_PATH}/bin/clang --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot"
$CC foo.c -o foo.wasm
```
Expand Down

0 comments on commit adbbf2c

Please sign in to comment.