509 B
509 B
wasi-libc
Standard C library implementation for WebAssembly System Interface.
Quick How-to
$ clang --target=wasm32-wasi --sysroot=/usr/wasm32-wasi -nodefaultlibs -lc -o hello hello.c
Important flags:
--target=wasm32-wasispecifies the compilation architecture (WASM System Interface).--sysroot=/usr/wasm32-wasitells clang where the library files are.-nodefaultlibsdisables linking of libc and libcompiler-rt (the latter is not available).-lcre-enables linking of libc.