From cee61283e78ca533e99e32f70d34314df8d38d66 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 24 Mar 2020 11:12:28 -0700 Subject: [PATCH] Add beginner-level documentation for installation and use --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 53d8340a0..cef66161f 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,24 @@ One could also use a standard Clang installation, build a sysroot from the sources mentioned above, and compile with "--target=wasm32-wasi --sysroot=/path/to/sysroot". +## Install + +A typical installation from the release binaries might look like the following: +```shell script +wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-[VERSION]/wasi-sdk-[VERSION]-linux.tar.gz +tar xvf wasi-sdk-[VERSION]-linux.tar.gz +``` + +## Use + +Use the clang installed in the wasi-sdk directory: +```shell script +CC="[WASI_SDK_PATH]/bin/clang --sysroot=[WASI_SDK_PATH]/share/wasi-sysroot" +$CC foo.c -o foo.wasm +``` +Note: `[WASI_SDK_PATH]/share/wasi-sysroot` contains the WASI-specific includes/libraries/etc. The `--sysroot=...` option +is not necessary if `WASI_SDK_PATH` is `/opt/wasi-sdk`. + ## Notes for Autoconf Upstream autoconf now