Commit graph

108 commits

Author SHA1 Message Date
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
Pat Tullmann
95a9053363 glibc: strlcpy and strlcat arrived in glibc 2.38
So only expose these in generic-glibc/string.h if Zig is building
a v2.38 (or later) glibc stub.

Announcement of 2.38 that notes strlcpy and strlcat:
https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html
2024-06-05 22:43:53 -07:00
Pat Tullmann
8a82496520 glibc headers: reallocarray added to glibc in v2.26
Here's the glibc commit that adds reallocarray to glibc:
https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da

The reallocarray symbol is declared in both stdlib.h and malloc.h.

Fix #17607
2024-06-05 22:43:53 -07:00
Xavier Bouchoux
9f9fa2df93 glibc patch: add backwards compatibility for strtol-family functions
following suit from b40943e253,
add a version guard in addition to the ISOC2X check.
2024-06-05 22:43:53 -07:00
Motiejus Jakštys
7c4bf07060 glibc patch: add a few dn_* functions
This is necessary to build glib.
2024-06-05 22:43:53 -07:00
Motiejus Jakštys
5af14711a8 glibc patch: add backwards compatibility for some symbols
- `fcntl` was renamed to `fcntl64` in glibc 2.28 (see #9485)
- `res_{,n}{search,query,querydomain}` became "their own" symbols since
  glibc 2.34: they were prefixed with `__` before.

This PR makes it possible to use `fcntl` with glibc 2.27 or older and
the `res_*` functions with glibc 2.33 or older.

These patches will become redundant with universal-headers and can be
dropped. But we have to do with what we have now.
2024-06-05 22:43:53 -07:00
Andrew Kelley
a4a88e441f glibc patch: version-gate _DYNAMIC_STACK_SIZE_SOURCE
This is a patch to glibc features.h which makes
_DYNAMIC_STACK_SIZE_SOURCE undefined unless the version is >= 2.34.

This feature was introduced with glibc 2.34 and without this patch, code
built against these headers but then run on an older glibc will end up
making a call to sysconf() that returns -1 for the value of SIGSTKSZ
and MINSIGSTKSZ.
2024-06-05 22:43:53 -07:00
Andrew Kelley
cbe9923c22 glibc patch: don't hardcode __GLIBC_MINOR__
Instead Zig passes it based on the target.
2024-06-05 22:43:53 -07:00
Andrew Kelley
8a4f583bb5 update glibc headers to 2.39 2024-06-05 22:43:53 -07:00
Andrew Kelley
85a46ee520 update musl headers to v1.2.5
adds loongarch64 and riscv32
2024-06-04 16:54:11 -07:00
Markus F.X.J. Oberhumer
fc72630d0f glibc: use __GLIBC_USE_DEPRECATED_SCANF for glibc versions < 2.7 2024-01-25 15:29:36 +01:00
Markus F.X.J. Oberhumer
c63216441c glibc: move __GLIBC__ version defines to the top of the file 2024-01-25 15:29:36 +01:00
Andrew Kelley
9346cd38e8 update mingw-w64 headers to latest git commit
Upstream commit dddccbc3ef50ac52bf00723fd2f68d98140aab80

Martin Storsjö suggested synchronizing with git snapshots rather than
waiting for tagged releases. Let's try this for a few releases of Zig
and see how we like it.

These headers were configured with `--with-default-msvcrt=ucrt`.

See related issue #18477.
2024-01-08 11:52:37 -07:00
Pat Tullmann
4a5d73a34d glibc: strlcpy and strlcat arrived in glibc 2.38
So only expose these in generic-glibc/string.h if Zig is building
a v2.38 (or later) glibc stub.

Announcement of 2.38 that notes strlcpy and strlcat:
https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html
2024-01-04 17:12:07 -07:00
Pat Tullmann
1631dc923d glibc headers: reallocarray added to glibc in v2.26
Here's the glibc commit that adds reallocarray to glibc:
https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da

The reallocarray symbol is declared in both stdlib.h and malloc.h.

Fix #17607
2023-10-20 06:45:24 -04:00
Xavier Bouchoux
0afead5651 glibc patch: add backwards compatibility for strtol-family functions
following suit from b40943e253,
add a version guard in addition to the ISOC2X check.
2023-10-16 22:43:28 +02:00
Motiejus Jakštys
b7e5a31d79 glibc patch: add a few dn_* functions
This is necessary to build glib.
2023-10-13 17:44:27 -07:00
Motiejus Jakštys
b40943e253 glibc patch: add backwards compatibility for some symbols
- `fcntl` was renamed to `fcntl64` in glibc 2.28 (see #9485)
- `res_{,n}{search,query,querydomain}` became "their own" symbols since
  glibc 2.34: they were prefixed with `__` before.

This PR makes it possible to use `fcntl` with glibc 2.27 or older and
the `res_*` functions with glibc 2.33 or older.

These patches will become redundant with universal-headers and can be
dropped. But we have to do with what we have now.
2023-10-13 17:44:27 -07:00
Andrew Kelley
f9c9ae84c6 glibc patch: version-gate _DYNAMIC_STACK_SIZE_SOURCE
This is a patch to glibc features.h which makes
_DYNAMIC_STACK_SIZE_SOURCE undefined unless the version is >= 2.34.

This feature was introduced with glibc 2.34 and without this patch, code
built against these headers but then run on an older glibc will end up
making a call to sysconf() that returns -1 for the value of SIGSTKSZ
and MINSIGSTKSZ.
2023-10-13 17:44:27 -07:00
Andrew Kelley
4bfa18b07f glibc patch: don't hardcode __GLIBC_MINOR__
Instead Zig passes it based on the target.
2023-10-13 17:44:27 -07:00
Andrew Kelley
8d3892b755 update glibc headers to 2.38 2023-10-13 17:44:27 -07:00
Michael Dusan
52e8354926
macos: vendored libc: combine headers: part 1
- combine *-macos-* → any-macos-any
- SDK headers as a single tree support targeting multiple arch/versions
- bump to SDK 14.0 (release candidate)
2023-09-25 15:53:05 -04:00
Jakub Konka
ddf5859c22 macos: add <paths.h> header to Zig shipped libc 2023-08-19 14:23:00 +02:00
Andrew Kelley
928c4c9bd3 musl: update headers to v1.2.4 2023-06-20 12:55:38 -04:00
Andrew Kelley
6bd93ef4eb update linux kernel headers to 6.3.8 2023-06-15 12:04:36 -07:00
Jakub Konka
7e0a02ee25 macos+libc: add zlib.h,sys/paths.h,netinet/{ip.h,udp.h} 2023-06-04 16:37:53 +02:00
Motiejus Jakštys
3eaca9bbc6 glibc hacks: also add a few dn_* functions 2023-05-04 10:36:05 +03:00
Jakub Konka
35f9c84449 macos: add missing getopt.h header 2023-04-13 00:19:33 +02:00
Andrew Kelley
13aa7871b2
Merge pull request #15101 from motiejus/glibc_compat
glibc: add backwards compatibility for some symbols
2023-04-06 17:15:58 -04:00
Jakub Konka
26c88e4f45 libc: update macOS libc headers to latest SDK 13.3 2023-03-31 21:20:47 +02:00
Motiejus Jakštys
7e6aeead85 glibc: add backwards compatibility for some symbols
- `fcntl` was renamed to `fcntl64` in glibc 2.28 (see #9485)
- `res_{,n}{search,query,querydomain}` became "their own" symbols since
  glibc 2.34: they were prefixed with `__` before.

This PR makes it possible to use `fcntl` with glibc 2.27 or older and
the `res_*` functions with glibc 2.33 or older.

These patches will become redundant with universal-headers and can be
dropped. But we have to do with what we have now.

Closes #9485
2023-03-28 20:35:08 +03:00
Jakub Konka
1b97881e38 libc: update macOS libc headers 2023-03-25 21:27:47 +01: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
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
Veikka Tuominen
986b7ce5b2 rename i386-linux-gnu to x86-linux-gnu 2022-11-04 16:41:23 +02:00
Jakub Konka
304eb54169 darwin: update macOS libc headers
Add aarch64-macos.13 and x86_64-macos.13 libc headers, and remove
x86_64-macos.10 headers.
2022-10-25 20:37:26 +02:00
Andrew Kelley
e52931e50f update mingw-w64 headers to v10.0.0 2022-10-11 01:05:42 -07:00
Andrew Kelley
e3274067f8 update macOS libc headers
notably this adds copyfile.h

fetch-them-macos-headers rev 900567517197df46e98006c53023fa10cb986004
2022-07-04 12:14:48 -07:00
Jakub Konka
5b813f1a2a Set macOS/iPhoneOS/tvOS/watchOS ABI to none (unspecified) by default
Prior to this change we would assume the ABI for Apple targets to
be GNU which could result in subtle errors in LLVM emitting calls
to non-existent system libc provided functions such as `_sincosf`
which is a GNU extension and as such is not provided by macOS for example.
This would result in linker errors where the linker would not be
able to find the said symbol in `libSystem.tbd`.

With this change, we now correctly identify macOS (and other Apple
platforms) as having ABI `unknown` which translates to unspecified
in LLVM under-the-hood:

```
// main.ll
target triple = "aarch64-unknown-macos-unknown"
```

Note however that we never suffix the target OS with target version
such as `macos11` or `macos12` which means we fail to instruct LLVM
of potential optimisations provided by the OS such as the availability
of function `___sincosf_stret`. I suggest we investigate that in a
follow-up commit.
2022-05-22 17:45:02 +02:00
Isaac Freund
f4131cf8a6
musl: update to 1.2.3
This was a bit trickier than it should be due to symbol conflicts with
zig's compiler-rt implementation. We attempt to use weak linkage in
our compiler-rt, but this does not seem to be working in all cases. I
manually disabled export of the problematic compiler-rt math functions
in order to cross compile musl's libc.so for all targets as input to
`tools/gen_stubs.zig`.

Other than that, this update went fairly smoothly. Quite a few
additional symbols were added to the blacklist in `tools/gen_stubs.zig`
due to recent reorganization of zig's compiler-rt.
2022-05-04 01:00:57 +02:00
Andrew Kelley
39083c31a5 glibc: version-gate _DYNAMIC_STACK_SIZE_SOURCE
This is a patch to glibc features.h which makes
_DYNAMIC_STACK_SIZE_SOURCE undefined unless the version is >= 2.34.

This feature was introduced with glibc 2.34 and without this patch, code
built against these headers but then run on an older glibc will end up
making a call to sysconf() that returns -1 for the value of SIGSTKSZ
and MINSIGSTKSZ.

Closes #10713
2022-01-28 18:36:23 -07:00
Motiejus Jakštys
7107a0fc40 [linux headers] rename arm64 to aarch64
Zig calls it aarch64. Linux calls it arm64. Currently lib/libc/include
has both arm64 and aarch64, which is quite confusing.

tools/update-linux-headers.zig was executed against the latest stable
linux patch version, therefore some other minor header updates. I will
update the wiki on how to do it once this PR is accepted.
2022-01-26 07:57:34 +02:00
Daniel Saier
4a401b20e4 glibc: fix passing of __GNU_MINOR__
This was originally introduced in 4d48948b52
but broken immediately afterwards in c8af00c66e.
2022-01-19 17:56:58 -05:00