mirror of
https://github.com/fluencelabs/musl
synced 2025-05-25 21:51:31 +00:00
Code quotes
This commit is contained in:
parent
e2ce69a6fd
commit
2809b1ff41
16
README.md
16
README.md
@ -18,23 +18,23 @@ You can build everything yourself using the waterfall's
|
|||||||
[build.py](https://github.com/WebAssembly/waterfall/tree/master/src/build.py).
|
[build.py](https://github.com/WebAssembly/waterfall/tree/master/src/build.py).
|
||||||
|
|
||||||
Compile your program using LLVM:
|
Compile your program using LLVM:
|
||||||
|
```
|
||||||
clang -S foo.c
|
clang -S foo.c
|
||||||
|
```
|
||||||
Creates a `.s` assembly file. Link it:
|
Creates a `.s` assembly file. Link it:
|
||||||
|
```
|
||||||
s2wasm foo.s -o foo.wast
|
s2wasm foo.s -o foo.wast
|
||||||
|
```
|
||||||
Creates a `.wast` WebAssembly s-expression. Assemble it:
|
Creates a `.wast` WebAssembly s-expression. Assemble it:
|
||||||
|
```
|
||||||
sexpr-wasm foo.wast -o foo.wasm
|
sexpr-wasm foo.wast -o foo.wasm
|
||||||
|
```
|
||||||
You now have a WebAssembly binary file.
|
You now have a WebAssembly binary file.
|
||||||
|
|
||||||
Run `.wasm` files which import libc functions:
|
Run `.wasm` files which import libc functions:
|
||||||
|
```
|
||||||
d8 --expose-wasm musl/arch/wasm32/wasm.js -- foo.wasm musl-out/musl.wasm
|
d8 --expose-wasm musl/arch/wasm32/wasm.js -- foo.wasm musl-out/musl.wasm
|
||||||
|
```
|
||||||
This may work... or not. File bugs on what's broken, or send patches!
|
This may work... or not. File bugs on what's broken, or send patches!
|
||||||
|
|
||||||
## libc + dynamic linking: how does it work?
|
## libc + dynamic linking: how does it work?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user