9 Commits

Author SHA1 Message Date
mlugg
d8ac37fcc8
stage1: fix wasi_snapshot_preview1_fd_seek on cache files
`wasm2c` uses an interesting mechanism to "fake" the existence of cache
directories. However, `wasi_snapshot_preview1_fd_seek` was not correctly
integrated with this system, so previously crashed when run on a file in
a cache directory due to trying to call `fseek` on a `FILE *` which was
`NULL`.
2025-04-02 05:57:50 +01:00
Alex Rønne Petersen
5cb45b6855
wasm2c: Add big endian support.
I took a slightly unconventional approach to detecting endianness here. We have
no compiler/platform-specific preprocessor checks in the stage1 C code today,
and I think that's a property worth maintaining.
2024-10-26 22:00:09 +02:00
Andrew Kelley
dff45c266e wasi.c: report no environment variables available
I moved part of the compiler that checks environment variables to the
standard library, so it doesn't have access to `build_options.only_c`
anymore, which means some environment variable checks are leaking into
the zig1.wasm build of zig. This logic still makes it return "no
environment variables found" though.
2024-02-27 22:55:00 -07:00
Jacob Young
8fa7635419 stage1: implement fd_fdstat_get
I thought this might be needed, so may as well keep the implementation.
2024-02-04 03:48:29 +01:00
Jacob Young
a67d378543 stage1: implement wasi seek shim 2023-11-09 20:12:47 -05:00
Jacob Young
e3cf9d1650 Module: rewrite zir caching logic
Multiple processes can sit waiting for the exclusive lock at the same
time, so we want to recheck whether it needs to be updated whenever
we get an exclusive lock.

This also fixes a race condition between one process truncating the
cache file and another process reading it without atomic locking.
2023-03-08 00:00:52 -05:00
Jacob Young
793db27805 wasi: add support for windows paths 2022-12-06 12:27:28 -07:00
Jacob Young
e000db2782 wasi: implement file truncation
The way this is implemented destroys the contents of the file, so
revisit if this causes issues in the future.
2022-12-06 12:15:04 -07:00
Jacob Young
1263346774 use zig-wasm2c for bootstrapping 2022-12-06 12:15:04 -07:00