aboutsummaryrefslogtreecommitdiff
path: root/src/wasi_libc.zig
AgeCommit message (Collapse)Author
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: stage 1 and 2 buildingLee Cannon
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-07-11wasi-libc: remove crt1.o as it's not WASI ABI compatibleTakeshi Yoneda
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-30Add support for WASI reactor in pure Zig-exe. (#9178)Takeshi Yoneda
* Add command line help for "-mexec-model" * Define WasmExecModel enum in std.builtin. * Drop the support for the old crt1.o in favor of crt1-command.o Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-09cc,wasi: use wasi_libc.CRTFile directly instead of WasiExecModelJakub Konka
2021-06-09cc,wasi: store CRTFile enum in wasi_emulated_libsJakub Konka
* then, in `link/Wasm.zig` map `CRTFile` to full emulated libs name * move logic for removing any mention of WASI snapshot `wasi_snapshot_preview1` from `Compilation.zig` into `link/Wasm.zig`
2021-06-09cc,wasi: build referenced-only emulated componentsJakub Konka
Move parsing of system libs into `main.zig` next to where we decide if we should link libC, and, if targeting WASI, if the specified libname equals one of the emulated components, save it on the side and remove it from the system libs. Then, build *only* those parts of WASI libc that were preserved in the previous step. This also fixes building of different crt1 bits needed to support reactors and commands.
2021-06-09cc,wasi: package emulations as static archivesJakub Konka
This replicates the expected behavior when using `clang` with upstream `wasi-libc` sysroot: linking emulated subcomponents such as process clocks or signals requires an explicit link flag in the compiler invocation, for example: ``` zig cc -target wasm32-wasi -lwasi-emulated-process-clocks main.c -o main.wasm ```
2021-06-09zig,cc,wasi: include emulated libs in WASI libcJakub Konka
This commit includes emulated libc sublibs that were not included in the compilation and caching of WASI libc that ships with Zig. The libs include (emulated): process clocks, getpid, mman, and signal. With this change, it is now possible to successfully cross-compile `wasm3` engine to WASI with `zig cc`. For the future though, it might be worth considering splitting WASI libc into libc-proper and modularised emulated libs as it is done in upstream, and then have them included only if the user specifically requests emulation/parts of it.
2021-05-23stage2: fix reference to musl arch nameAndrew Kelley
Also rename musl.archMuslName to musl.archName. Fixes a merge conflict from #8730 and #8837
2021-05-22cc,wasi: force isysroot to /Jakub Konka
2021-05-20cc,wasi: do not add stack protectorJakub Konka
2021-05-20wasm: link dynamically by default when targeting wasmJakub Konka
This matches the behaviour of other languages and leaves us the ability to create actual static Wasm archives with ``` zig build-lib -static some.zig ``` which can then be combined with other Wasm object files and linked into either a Wasm lib or executable using `wasm-ld`. Update langref to reflect the fact we now ship WASI libc.
2021-05-20cc,wasi: link compiled WASI libc with wasm-ldJakub Konka
2021-05-20cc,wasi: compile all WASI libc objectsJakub Konka
2021-05-20cc,wasi: add source file paths to wasi_libc.zigJakub Konka
2021-05-20wasi,cc: fix naming and add stubs for buildingJakub Konka
Rename include dir to match the convention: from `wasm32-wasi` to `wasm-wasi-musl` Add building stubs which will be used to build and cache WASI libc sysroot.