Skip to content

Commit

Permalink
Update wasmCompile.md
Browse files Browse the repository at this point in the history
  • Loading branch information
robinyuan1002 authored Jul 24, 2024
1 parent d4dc924 commit 1d8744b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/wasmCompile.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- `--sysroot` specifying the stand library path

## Modify stubs.h
Modify the file `stubs.h` located in `lind-wasm/glibc/target/include/gnu` to
Modify the file `stubs.h` located in `/home/lind-wasm/glibc/target/include/gnu` to

```
/* This file is automatically generated.
Expand All @@ -24,6 +24,19 @@ Modify the file `stubs.h` located in `lind-wasm/glibc/target/include/gnu` to
#endif
```

After modifying `stubs.h` remember to run `gen_sysroot.sh` again

```
cd /home/lind-wasm/glibc
./gen_sysroot.sh
```

Then we cd to lind-wasm-tests for testing

```
cd /home/lind-wasm/lind-wasm-tests
```

## Compile C to wasm
If you don't need to use glibc, modify `add.c` to the c file you want to compile and `add.wasm` is the wasm file you get(you can modify add to the name you want). Modify `/home/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04/bin/clang` to you compiler's path

Expand Down

0 comments on commit 1d8744b

Please sign in to comment.