Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASI SDK actually needed? #560

Open
hendursaga opened this issue Sep 9, 2022 · 5 comments
Open

WASI SDK actually needed? #560

hendursaga opened this issue Sep 9, 2022 · 5 comments

Comments

@hendursaga
Copy link

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?

@aduros
Copy link
Owner

aduros commented Sep 9, 2022

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.

@JerwuQu
Copy link
Contributor

JerwuQu commented Oct 12, 2022

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.

@hendursaga
Copy link
Author

Any update on this? There seems to be a number of systems that have wasi-libc in their official repositories.

@aduros
Copy link
Owner

aduros commented Nov 15, 2023

Hi, no updates. Unfortunately we need to support Windows which makes things more complicated.

I've thought about using Zig in place of the WASI SDK. I think it provides wasi-libc and a drop-in C cross compiler.

@aduros
Copy link
Owner

aduros commented Nov 15, 2023

btw nothing stops you from changing your project's Makefile or build script to use a system wasi-libc. We just recommend the WASI SDK because it's easiest for most users to set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants