From 3425553dc644cc462e77fd1342dd676ea7b01a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Van=20der=20Auwermeulen=20Gr=C3=A9goire?= Date: Mon, 3 Jun 2019 21:51:23 +0200 Subject: [PATCH] Update WASI-tutorial.md Update README based on feedback --- docs/WASI-tutorial.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/WASI-tutorial.md b/docs/WASI-tutorial.md index cd0dc3477f..170d976d44 100644 --- a/docs/WASI-tutorial.md +++ b/docs/WASI-tutorial.md @@ -73,14 +73,20 @@ int main(int argc, char **argv) { We'll put this source in a file called `demo.c`. The [wasi-sdk](https://github.com/CraneStation/wasi-sdk/releases) provides a clang -which is configured to target WASI and use the WASI sysroot by default, so we can +which is configured to target WASI and use the WASI sysroot by default if you put the extracted tree into `/`, so we can compile our program like so: +``` +$ clang demo.c -o demo.wasm +``` + +If you would want to extract it elsewhere, you can specify the directory like so + ``` $ clang demo.c --sysroot -o demo.wasm ``` -The sysroot is folder is located in `opt/wasi-sdk/share/sysroot/`. +If you're using the wasi-sdk, the sysroot folder is located in `opt/wasi-sdk/share/sysroot/` on Linux and mac. A few things to note here. First, this is just regular clang, configured to use a WebAssembly target and sysroot. Second, the output name specified with the "-o"