- Ensure clang is installed.
- Install LLVM.
- Install WABT.
- Run
npm install
.
npm install
npm run test
- I had to patch llvm-bindings in a few places. Not all of them have been released yet. E.g. see ApsarasX/llvm-bindings#23.
llvm-as x.ll
ls -l x.bc
llc x.ll -filetype=obj
gcc x.o
./a.out
opt -Oz -S -o x.Oz.ll x.ll
# --metarenamer - rename everything
llc -mtriple=wasm32-unknown-unknown -O3 -filetype=obj one.ll -o one.o
wasm-ld one.o -o one.wasm -allow-undefined --entry "main"
To see WAT (see wabt):
wasm2wat -o one.wat one.wasm