WASC is a WebAssembly AOT compiler. The main purpose is to translate the WebAssembly code into machine(x86 and RISC-V) code.
How it works: ./doc/overview_en.md
Ubuntu 18.04
$ apt install llvm-9
$ git clone https://github.com/mohanson/wasc
$ cd wasc
$ ./build.sh
$ ./build_test.sh
An example is the best way to show how it works:
$ ./build/wasc example/echo.wasm
$ ./example/echo Hello World!
# Hello World!
You can find more useful examples in the ./example
and ./res/wasi
.
- The project mainly inspired by xuejie's article, and got a lot of help from him.
src/platform/wasi.h
derived from wasi-sysroot/libc-bottom-half/headers/public/wasi/core.h.src/platform/*_runtime.S
derived from WAVM/Lib/Platform/POSIX/POSIX-X86_64.S.src/platform/posix_x86_64_wasi.h
's sectioninit_wasi()
derived from wac/wasi.csrc/platform/posix_x86_64_wasi.h
's sectioncopy_iov_to_host()
derived from wac/wasi.c
MIT