Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-fink committed Nov 23, 2023
1 parent cc55c29 commit 2a3c6ae
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```shell
for i in ../demo/demo*.c; do
./build/bin/clang --target=wasm64-unknown-wasi -mmem-safety --sysroot /scratch/martin/src/wasm/wasi-libc/sysroot -g -fsanitize=wasm-memsafety -Os -rtlib=compiler-rt wasm_memsafety_rtlib.c "$i" -o "${i%.c}.wasm"
./build/bin/clang --target=wasm64-unknown-wasi -mmem-safety --sysroot ../wasi-sdk/build/wasi-sdk-20.32gb3d5dd44687d/share/wasi-sysroot -g -fsanitize=wasm-memsafety -Os -g "$i" -o "${i%.c}.wasm"
done
```

Expand All @@ -15,27 +15,23 @@ Wasmtime can be cross-compiled for aarch64 with the provided `Dockerfile` in thi
### `demo.c`

```shell
./wasmtime compile demo.wasm --cranelift-enable use_mte --wasm-features=memory64,mem-safety
./wasmtime run --allow-precompiled --wasm-features=memory64,mem-safety -- demo.cwasm [index] [value]
./wasmtime run -W memory64=y -W mem-safet=y -C mte=y -- demo.wasm [index] [value]
```

### `demo-heap.c`

```shell
./wasmtime compile demo-heap.wasm --cranelift-enable use_mte --wasm-features=memory64,mem-safety
./wasmtime run --allow-precompiled --wasm-features=memory64,mem-safety -- demo-heap.cwasm [heap_size] [index] [value]
./wasmtime run -W memory64=y -W mem-safet=y -C mte=y -- demo-heap.wasm [heap_size] [index] [value]
```

### `demo-use-after-free.c`

```shell
./wasmtime compile demo-use-after-free.wasm --cranelift-enable use_mte --wasm-features=memory64,mem-safety
./wasmtime run --allow-precompiled --wasm-features=memory64,mem-safety -- demo-use-after-free.cwasm [heap_size] [index] [value] [early_free]
./wasmtime run -W memory64=y -W mem-safet=y -C mte=y -- demo-use-after-free.wasm [heap_size] [index] [value] [early_free]
```

### `demo-scanf.c`

```shell
./wasmtime compile demo-scanf.wasm --cranelift-enable use_mte --wasm-features=memory64,mem-safety
./wasmtime run --allow-precompiled --wasm-features=memory64,mem-safety -- demo-scanf.cwasm
./wasmtime run -W memory64=y -W mem-safet=y -C mte=y -- demo-scanf.cwasm
```

0 comments on commit 2a3c6ae

Please sign in to comment.