wasm4 icon indicating copy to clipboard operation
wasm4 copied to clipboard

WASI SDK actually needed?

Open hendursaga opened this issue 1 year ago • 5 comments

WASI SDK's README notes that "all that's done here is to provide builds configured to set the default target and sysroot for convenience." Should instructions be included on how to use upstream Clang / LLVM instead of this SDK?

hendursaga avatar Sep 09 '22 01:09 hendursaga

The only reason we suggest the WASI SDK is that it comes with libc. Most distributions of clang can build for wasm out of the box, but they don't include a wasm-ready libc, which limits things quite a lot.

aduros avatar Sep 09 '22 19:09 aduros

Perhaps it could fall back to system clang if WASI_SDK is not set.

I personally don't use any libc functions because they tend to increase binary size quite a bit, and I think a lot of users would be OK without them too. memset is the only one I needed for my own games, but that can be implemented as either a 3 line function or a single inline asm directive.

JerwuQu avatar Oct 12 '22 09:10 JerwuQu