Commit graph

150 commits

Author SHA1 Message Date
Alex Rønne Petersen
df1909900c libc: update Linux headers to 6.17 2025-09-29 22:53:06 +02:00
Kyle Schwarz
6260d2772f glibc: guard inet-fortified.h 2025-09-24 02:55:50 +02:00
Linus Groh
93218eacaa libc: Update macOS headers to SDK 26.0 2025-09-16 21:15:13 +01:00
Alex Rønne Petersen
07cc32b004 wasi-libc: update to c89896107d7b57aef69dcadede47409ee4f702ee 2025-08-20 19:18:11 +02:00
Alex Rønne Petersen
234630bb8d
netbsd: add some missing system headers
The Lua headers are needed because, yes, NetBSD has a kernel module for Lua
support. soundcard.h is technically a system header but is installed by
libossaudio and so was missed previously.

This also removes some riscv headers that shouldn't have been added because
NetBSD does not yet officially support the riscv32/riscv64 ports.

Closes #24737.
2025-08-14 08:25:08 +02:00
Alex Rønne Petersen
1804251dfb
glibc: update headers to 2.42 2025-07-31 22:02:37 +02:00
DubbleClick
c7bcdb4802 fix glibc version for single_threaded.h (2.32 instead of 2.35) 2025-07-16 19:18:15 +02:00
Marc
75d6d4c3f2
add glibc versioning for a number of headers (#24237)
* getrandom was added in glibc 2.25
https://sourceware.org/bugzilla/show_bug.cgi?id=17252

* copy_file_range was added in glibc 2.27
https://sourceware.org/git/?p=glibc.git;a=commit;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f

* threads.h should not exist for glibc < 2.28

* single_threaded.h should not exist for glibc < 2.35

* Apply suggestions from code review

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>

* 2.35 instead of 35

* before 2.35 instead of 2.34 and before

---------

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-06-24 16:14:00 +00:00
Alex Rønne Petersen
0979e56bd2
mingw: Update MinGW-w64 headers to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e. 2025-06-11 15:28:36 +02:00
Alex Rønne Petersen
3b2bef8a95
Merge pull request #24025 from alexrp/glibc-deduplication
`libc`: Merge header directories for glibc and NetBSD libc where applicable
2025-06-04 05:14:21 +02:00
Andrew Kelley
826e1c30ba
Merge pull request #24013 from alexrp/test-matrix
More target coverage in the module test matrix
2025-06-03 17:05:15 -04:00
Linus Groh
c907866d55 libc: update macOS headers to SDK 15.5 2025-05-31 22:40:38 +02:00
Alex Rønne Petersen
63a9048baf
libc: Merge header directories for glibc and NetBSD libc where applicable.
Manual patches:

* lib/libc/include/csky-linux-gnu/gnu/{lib-names,stubs}.h
* lib/libc/include/powerpc-linux-gnu/bits/long-double.h

Takes lib/libc/include from 115.5 MB to 113.4 MB.

Closes #21258.
2025-05-30 00:15:39 +02:00
Alex Rønne Petersen
cbf9d3c570
libc: Remove riscv32-netbsd-none and riscv64-netbsd-none headers.
These were not intended to be included as NetBSD's RISC-V port has not had an
official release yet.
2025-05-29 16:48:28 +02:00
Alex Rønne Petersen
553cb3ed46
libc: Add NetBSD system and libc headers from 10.1.
sys/param.h was manually adjusted to not define __NetBSD_Version__ since it will
be defined by the compiler.
2025-05-17 04:41:27 +02:00
Linus Groh
abbead1fb8 libc: update macOS headers to SDK 15.2 2025-05-12 16:50:17 +02:00
Alex Rønne Petersen
6e64bc845f
libc: Add FreeBSD system and libc headers from 14.2.0.
osreldate.h and sys/param.h were manually adjusted to not __FreeBSD_version
since it will be defined by the compiler.
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
7f20b9f9db
musl: Add hexagon-linux-musl headers. 2025-04-11 02:28:35 +02:00
Alex Rønne Petersen
c2f5515fb0 glibc: Add missing stubs-lp64s.h for loongarch64-linux-gnusf.
https://sourceware.org/bugzilla/show_bug.cgi?id=32776
2025-04-06 14:24:49 +02:00
TCROC
d590b87b6f
glibc: fix uninitialized memory in __pthread_cond_s for <=2.40
* https://sourceware.org/bugzilla/show_bug.cgi?id=32786
* https://inbox.sourceware.org/libc-alpha/87zfhpfqsm.fsf@oldenburg.str.redhat.com
2025-03-13 20:23:27 +00:00
Alex Rønne Petersen
bedf806672
Merge pull request #22999 from alexrp/mingw-update 2025-02-25 12:54:55 +01:00
Alex Rønne Petersen
37706cc1d9 libc: Update Linux headers to 6.13.4. 2025-02-25 11:24:18 +01:00
Alex Rønne Petersen
ed10a5db58
mingw: Update MinGW-w64 headers to 3839e21b08807479a31d5a9764666f82ae2f0356. 2025-02-24 11:59:10 +01: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
Hugo Beauzée-Luyssen
462d26171b glibc: don't redirect fts to fts64 before glibc 2.23 2025-02-14 02:11:26 +01:00
Andrew Kelley
1d8857bbe3
Merge pull request #22695 from alexrp/glibc-2-41
glibc 2.41
2025-02-10 17:32:55 -08:00
Hugo Beauzée-Luyssen
a06a7108c8 generic glibc: guard memfd_create & mlock2 declarations
They were introduced in glibc 2.27
2025-02-08 01:02:28 +01:00
Hugo Beauzée-Luyssen
edee702a7f
generic glibc: guard pidfd_spawn(p) declarations 2025-02-06 18:00:45 +01:00
Hugo Beauzée-Luyssen
9d85c79f2f
generic glibc: guard pidfd function declarations
They were introduced in 2.36 & 2.39
2025-02-06 18:00:44 +01:00
Hugo Beauzée-Luyssen
e716d13555
generic glibc: guard definitions of functions introduced in 2.36 2025-02-06 18:00:43 +01:00
Hugo Beauzée-Luyssen
5d2584e53e
generic glibc: guard statx declaration
It was added in glibc 2.28
2025-02-06 10:08:12 +01:00
Hugo Beauzée-Luyssen
fdef5c564d
generic glibc: guard close_range declaration
It is only available starting from glibc 2.34
2025-02-06 10:08:12 +01:00
Alex Rønne Petersen
2ba137b02b
glibc: Update header files to 2.41. 2025-01-31 14:30:32 +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
Alex Rønne Petersen
6066e7bfd1
std.zig.target: Remove wasm32-freestanding-musl.
This is, at least today, a very broken target: It doesn't actually build either
musl or wasi-libc even if you use -lc. It does give you musl headers, but that's
it. Those headers are not terribly useful, however, without any implementation
code. You can sort of call some math functions because they just so happen to
have implementations in compiler-rt. But that's only true for a small subset,
and I don't think users should be relying on the ABI surface of a library that
is an implementation detail of the compiler.

Clearly, a freestanding-capable libc of sorts is a useful thing as evidenced by
newlib, picolibc, etc existing. However, calling it "musl" is misleading when it
isn't actually musl-compatible, nor can it ever be because the musl API surface
is inextricably tied to the Linux kernel. In the discussion on #20690, there was
agreement that once we split up the API and ABI components in the target string,
the API component should be about compatibility, not whether you literally get a
particular implementation of it. Also, we decided that Linux musl and wasi-libc
musl shouldn't use the same API tag precisely because they're not actually
compatible.

(And besides, how would any syscall even be implemented in freestanding? Who or
what would we be calling?)

So I think we should remove this triple for now. If we decide to reintroduce
something like this, especially once #2879 gets going, we should come up with a
bespoke name for it rather than using "musl".
2024-12-15 12:25:12 +01:00
Alex Rønne Petersen
87083e8e7e
mingw: Update headers to dcd7fefc703fb4b12187235386900d34cc13fdc5. 2024-12-14 07:02:12 +01:00
Michael Dusan
a68119f8f1 macos: vendored libc: bump to SDK 15.1 2024-12-13 03:55:54 +01:00
Alex Rønne Petersen
3ec27ae648
musl: Update headers from musl 1.2.5.
Adds mips64-linux-muslabin32 and x86_64-linux-muslx32 headers.
2024-11-02 10:42:53 +01:00
Alex Rønne Petersen
6635d02143
glibc: Add loongarch64-linux-gnusf headers. 2024-10-03 04:39:39 +02:00
Federico Di Pierro
b7a98d0d59 lib: guard definition of strl{cat,cpy} against glibc version when _FORTIFY_SOURCE is enabled.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2024-09-01 00:34:15 -07:00
Andrew Kelley
71a27ebd84
Merge pull request #21004 from alexrp/linux-6.10
Linux 6.10 headers/syscalls
2024-08-09 13:08:39 -07:00
Alex Rønne Petersen
c62a2ad2ec
Update Linux kernel headers to 6.10. 2024-08-08 23:39:00 +02:00
Alex Rønne Petersen
0b76be3a01
Update glibc headers to 2.40. 2024-08-08 04:41:04 +02:00
Tristan Ross
3ebb880663
glibc: Replace ilp32/lp64 headers with ilp32d/lp64d.
The former are soft float; the latter are hard float. We primarily care about
hard float here.

Signed-off-by: Alex Rønne Petersen <alex@alexrp.com>
2024-08-02 09:54:08 +02:00
Alex Rønne Petersen
635a3d87de
glibc: Change riscv32-linux-gnuilp32 target triple to riscv32-linux-gnu.
This target triple was weird on multiple levels:

* The `ilp32` ABI is the soft float ABI. This is not the main ABI we want to
  support on RISC-V; rather, we want `ilp32d`.
* `gnuilp32` is a bespoke tag that was introduced in Zig. The rest of the world
  just uses `gnu` for RISC-V target triples.
* `gnu_ilp32` is already the name of an ILP32 ABI used on AArch64. `gnuilp32` is
  too easy to confuse with this.
* We don't use this convention for `riscv64-linux-gnu`.
* Supporting all RISC-V ABIs with this convention will result in combinatorial
  explosion; see #20690.
2024-08-02 09:54:08 +02:00
Pat Tullmann
a31fe8aa3e glibc headers: arc4random* functions added in glibc 2.36
Here's the glibc v2.36 announcment noting the addition of arc4random,
arc4random_buf and arc4random_uniform:

  https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=8420a65cd06874ee09518366b8fba746a557212a;hb=6f4e0fcfa2d2b0915816a3a3a1d48b4763a7dee2

Tested with the testcase from the bug.  I get a compile-time error when
building against older glibc (instead of a linker error), and no errors
(as before) when compiling against v2.36 or later.  And the glibc_compat
regression tests pass.

Fix #20426
2024-07-03 02:57:24 -04:00
Markus F.X.J. Oberhumer
4c2e57d406 glibc: use __GLIBC_USE_DEPRECATED_SCANF for glibc versions < 2.7 2024-06-05 22:43:53 -07:00
Markus F.X.J. Oberhumer
a8db261ebb glibc: move __GLIBC__ version defines to the top of the file 2024-06-05 22:43:53 -07:00