- LLVM - at least version 8
- WABT
- cmake - to build WABT, at least version 3.16
Tested on Ubuntu 18.04.1 LTS
Install dependencies, see below.
Clone this repo and build:
$ git clone https://github.com/DeShrike/c-wasm.git
$ cd c-wasm
$ ./build.sh
Start a local webserver:
$ python3 -m http.server 8000
Point your browser to https://localhost:8000/index.html
Tested with v16.20.1
$ node node-app.js
$ sudo apt-get install llvm-8 clang-8 lld-8
$ mkdir ~/temp
$ cd ~/temp
$ wget https://cmake.org/files/v3.16/cmake-3.16.0.tar.gz
$ tar -xzvf cmake-3.16.0.tar.gz
$ cd cmake-3.16.0/
$ ./bootstrap
$ make -j$(nproc)
$ sudo make install
$ cmake --version
$ git clone --recursive https://github.com/WebAssembly/wabt
$ cd wabt
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build
$ sudo make install
$ wasm-objdump -x main.o
$ wasm2wat main.wasm