Commit graph

17 commits

Author SHA1 Message Date
Alex Rønne Petersen
2174014349
wasi-libc: Remove pointless alltypes.h.in file. 2025-04-11 02:28:35 +02:00
Alex Rønne Petersen
05d8b565ad wasi-libc: Deduplicate sources and headers with regards to upstream musl.
Unfortunately some duplicate files must remain in lib/libc/wasi/libc-top-half
because they include internal headers *in the same directory* which have edits
relative to upstream musl. Because C is an amazing language, there is no way to
make it so that e.g. upstream musl's src/stdio/fputc.c includes wasi-libc's
src/stdio/putc.h instead of the upstream putc.h. The preprocessor always
searches the current directory first for quote includes.

Anyway, this still takes us from 2.9M to 1.4M for the combination of
lib/libc/wasi and lib/libc/include/wasm-wasi-musl, so I still call it a win.
2025-02-21 09:23:50 +01:00
Frank Denis
e60072635e
Add libdl shims from wasi-libc 2025-01-29 12:48:56 +01:00
Frank Denis
8a8da49b52
Re-add lazy preopen changes 2025-01-29 11:54:08 +01:00
Frank Denis
3f4c43b0aa
Update wasi-libc to d03829489904d38c624f6de9983190f1e5e7c9c5 2025-01-29 11:54:02 +01:00
Andrew Kelley
b07958e6b7 delete asm files from wasi libc
why the hell are there asm files in wasi libc to begin with?
2025-01-17 12:34:15 -08:00
Andrew Kelley
e6dc85f1b4 remove memcpy and memmove from bundled libcs
These are provided instead by compiler_rt.

Part of #2879
2025-01-17 12:34:15 -08:00
Frank Denis
dcc1b4fd15
Update wasi-libc to 3189cd1ceec8771e8f27faab58ad05d4d6c369ef (#15817)
Also remove all the wasi-libc files we used to ship, but never compile.

The latest wasi-libc HEAD has an extra commit (a6f871343313220b76009827ed0153586361c0d5), which makes preopen initialization lazy.

Unfortunately, that breaks quite a lot of things on our end. Applications now need to explicitly call __wasilibc_populate_preopens() everywhere when the libc is linked. That can wait after 0.11.
2023-05-23 22:12:53 +02:00
Frank Denis
cbbf8c8a2d
wasi-libc: use __heap_end if available (#14273)
The symbol was introduced in LLD 15.0.7, as a way to know how
much memory can be allocated:

1095870e8c
https://github.com/WebAssembly/wasi-libc/pull/377
2023-01-12 13:48:14 +00:00
Frank Denis
24d8d12caf Update wasi-libc to a1c7c2c7a4b2813c6f67bd2ef6e0f430d31cebad
Some notable changes:
- `ENOENT` is returned instead of `ENOTCAPABLE` when a path has not
be pre-opened (https://github.com/WebAssembly/wasi-libc/pull/370)
- `fd_readdir()`: some implementations may not set the inode number,
so an additional call to `fstatat()` is now done in order to get it
when that happens.
2023-01-10 17:14:27 -05:00
Frank Denis
817cf6a82e
Update wasi-libc to 8b7148f69ae241a2749b3defe4606da8143b72e0 (#13793) 2022-12-06 22:48:35 +00:00
Frank Denis
da9c530d99
Update wasi-libc to a00bf321eeeca836ee2a0d2d25aeb8524107b8cc (#13626)
* Update wasi-libc to a00bf321eeeca836ee2a0d2d25aeb8524107b8cc

It includes a port of emscripten's allocator that performs
performs much better than the old one.

Most importantly, it includes the prerequisites to later add
support for POSIX threads.
2022-11-28 19:58:03 +01:00
Frank Denis
8c63037695 Update the WASI libc
Update our copy of wasi-libc up to the commit
30094b6ed05f19cee102115215863d185f2db4f0 from the upstream repository.
2022-06-14 23:20:39 +02:00
Takeshi Yoneda
b9e896d7b0 wasi-libc: remove crt1.o as it's not WASI ABI compatible
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-07-11 00:06:47 +02:00
Jakub Konka
f291b8b9bc cc,wasi: remove unused headers and sources 2021-05-20 16:54:00 +02:00
Jakub Konka
60d8779eae cc,wasi: add source file paths to wasi_libc.zig 2021-05-20 16:54:00 +02:00
Jakub Konka
782cfedaf6 cc,wasi: add wasi-libc source 2021-05-20 16:54:00 +02:00