Installation
git clone https://github.com/bytecodealliance/wasm-micro-runtime
git checkout WAMR-08-10-2021
cd product-mini/platforms/linux-sgx/
mkdir build
cd build
cmake ..
make
cd ../enclave-sample
make
cd <path-to-wasi>
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
tar xvf wasi-sdk-12.0-linux.tar.gz
Toy Example
#include <stdio.h>
int main(int argc, char const *argv[])
{
printf("POC");
return 0;
}
~/wasi-sdk-12.0/bin/clang-11 --sysroot=/<user-home>/wasi-sdk-12.0/share/wasi-sysroot main.c -o main
./iwasm test/main
···