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

Ship libc for WASI #8489

Closed
DagAgren opened this issue Apr 10, 2021 · 3 comments · Fixed by #8837
Closed

Ship libc for WASI #8489

DagAgren opened this issue Apr 10, 2021 · 3 comments · Fixed by #8837
Labels
arch-wasm 32-bit and 64-bit WebAssembly contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-wasi standard library This issue involves writing Zig code for the standard library. zig cc Zig as a drop-in C compiler feature
Milestone

Comments

@DagAgren
Copy link

Currently, wasm32-wasi can not build C code that uses libc, leaving it fairly useless for C.

There is a libc for WASI based partly on musl: https://github.com/WebAssembly/wasi-libc

(Vaguely related: WASI has the separate concepts of "commands" and "reactors", where commands use main() and run once, while reactors just export a number of functions, and have an _initialize entry point instead of _start that is used to initialise libc internals in C code. Related issue here: #6757)

@kubkon
Copy link
Member

kubkon commented Apr 19, 2021

Pinging @fengb as I believe he’s done some work on this back in the day, and also @jedisct1 as this might be of interest to you too.

As far as the issue is concerned, this is an excellent good first issue for anyone wanting to contribute to Zig. Of course, I’d be more than happy to mentor!

@kubkon kubkon added arch-wasm 32-bit and 64-bit WebAssembly backend-c The C backend (CBE) outputs C source code. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-wasi standard library This issue involves writing Zig code for the standard library. zig cc Zig as a drop-in C compiler feature and removed backend-c The C backend (CBE) outputs C source code. labels Apr 19, 2021
@kubkon kubkon added this to the 0.8.0 milestone Apr 19, 2021
@kubkon
Copy link
Member

kubkon commented May 19, 2021

@DagAgren just an FYI that it's happening! #8837

@DagAgren
Copy link
Author

Yesssss nice one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm 32-bit and 64-bit WebAssembly contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-wasi standard library This issue involves writing Zig code for the standard library. zig cc Zig as a drop-in C compiler feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants