zig/lib/libc
Alex Rønne Petersen 1f896c1bf8
Introduce libzigc for libc function implementations in Zig.
This lays the groundwork for #2879. This library will be built and linked when a
static libc is going to be linked into the compilation. Currently, that means
musl, wasi-libc, and MinGW-w64. As a demonstration, this commit removes the musl
C code for a few string functions and implements them in libzigc. This means
that those libzigc functions are now load-bearing for musl and wasi-libc.

Note that if a function has an implementation in compiler-rt already, libzigc
should not implement it. Instead, as we recently did for memcpy/memmove, we
should delete the libc copy and rely on the compiler-rt implementation.

I repurposed the existing "universal libc" code to do this. That code hadn't
seen development beyond basic string functions in years, and was only usable-ish
on freestanding. I think that if we want to seriously pursue the idea of Zig
providing a freestanding libc, we should do so only after defining clear goals
(and non-goals) for it. See also #22240 for a similar case.
2025-04-11 17:12:31 +02:00
..
darwin macos: vendored libc: bump to SDK 15.1 2024-12-13 03:55:54 +01:00
glibc Revert "glibc: Patch to work around missing features in LLVM's s390x assembler." 2025-04-04 06:08:10 +02:00
include glibc: Add missing stubs-lp64s.h for loongarch64-linux-gnusf. 2025-04-06 14:24:49 +02:00
mingw mingw: Update MinGW-w64 sources to 3839e21b08807479a31d5a9764666f82ae2f0356. 2025-02-24 12:01:07 +01:00
musl Introduce libzigc for libc function implementations in Zig. 2025-04-11 17:12:31 +02:00
wasi wasi-libc: Deduplicate sources and headers with regards to upstream musl. 2025-02-21 09:23:50 +01:00