Commit graph

36192 commits

Author SHA1 Message Date
Matthew Lugg
330e295bc4
mailmap: add some addresses used by the Codeberg UI 2025-12-21 13:07:03 +00:00
Matthew Lugg
5611779f39
Sema: fix nested error union coercions
Previously, `E1!void` failed to coerce to `E2!E1!void` because it tried
to coerce the `E1` error to an `E2` if comptime-known and refused to
attempt any other coercion. This is a strange language rule with no
clear justification, and breaks real use cases (such as calling `getOne`
on an `Io.Queue(E!T)`). Instead, only error *sets* should try to coerce
to an "error" value of an error union type.
2025-12-21 13:07:03 +00:00
Matthew Lugg
3f08073f7d
x86_64: hack around more OPV bugs
I would just fix this in Sema if it were easy to do so, but this is more
like a (minor) AIR data design issue than a straightforward Sema bug.
2025-12-21 13:07:00 +00:00
Alex Rønne Petersen
b27bdd5af0 libc: add back freebsd bsm headers
Accidentally removed in #30135.
2025-12-21 03:54:17 +01:00
Prokop Randáček
442592855c change placeholder pattern in deduplicated type errors 2025-12-20 08:06:59 +01:00
Andrew Kelley
5fa7f13082 Merge pull request 'Windows: Avoid ever-expanding DeviceIoControl error set, handle NOT_A_REPARSE_POINT in ReadLink' (#30186) from squeek502/zig:win-deviceiocontrol into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30186
2025-12-19 18:50:27 +01:00
Alex Rønne Petersen
f9419c81cf
build: bump test-c-abi max_rss to 2_389_779_251 on x86_64-linux 2025-12-18 13:01:35 +01:00
Alex Rønne Petersen
a6c22c5edb
std.os.linux.test: disable fallocate on mips64*-linux-*abin32
https://codeberg.org/ziglang/zig/issues/30220
2025-12-18 12:56:28 +01:00
Alex Rønne Petersen
6b77bb3f91
build: bump test-compiler-rt max_rss to 978_463_129 on x86_64-linux 2025-12-18 11:42:42 +01:00
Alex Rønne Petersen
0437decca9
std.http.test: disable redirect to different connection on mips*-linux w/o libc
https://codeberg.org/ziglang/zig/issues/30216
2025-12-18 01:46:31 +01:00
Mick Sayson
fc78a61c4c Prevent register clobbering on x86_64 threadlocal access
On the x86_64 self hosted backend, thread locals are accessed through
__tls_get_addr on PIC. Usually this goes through a fast path which does
not lose any registers, however in some cases (notably any dlopened
library on my machine) this can take a slow path which calls out to C
ABI functions

Catch this case and backup registers as necessary

Fix a few other ones while we're here. Credit to mlugg

Fixes #30183
2025-12-17 15:33:10 +01:00
Alex Rønne Petersen
b9eefe17af
test: fix up c3ee8078b4
Oops, accidentally didn't run the tests for 32-bit powerpc.
2025-12-16 09:01:51 +01:00
Alex Rønne Petersen
00903d35b1
std.Target: openbsd's landisk port is only little endian 2025-12-16 06:27:25 +01:00
Alex Rønne Petersen
447d6a0dd3
test: remove some nonsensical openbsd targets from llvm_targets 2025-12-16 06:25:32 +01:00
Alex Rønne Petersen
b675223eb5
std: disable tests that depend on getFdPath on openbsd 2025-12-16 06:25:27 +01:00
Alex Rønne Petersen
215b250e6b
std.posix.test: fix sigset tests on openbsd (no rt signals) 2025-12-16 06:25:21 +01:00
Alex Rønne Petersen
da9733d441
compiler-rt: implement __clear_cache() for arm/mips64-openbsd 2025-12-16 06:25:15 +01:00
Alex Rønne Petersen
914005105e
std.fs: fix build error in selfExePath() on openbsd 2025-12-16 06:25:10 +01:00
Alex Rønne Petersen
707e389f38
std.Io.Threaded: apply netbsd todo hacks to openbsd
https://codeberg.org/ziglang/zig/issues/30063
2025-12-16 06:25:07 +01:00
Alex Rønne Petersen
18db762bb8
std.c: openbsd does not have SIGRTMIN/SIGRTMAX 2025-12-16 06:24:58 +01:00
Alex Rønne Petersen
56add8374c
std.c: remove comptime asserts of siginfo_t size
These serve no purpose other than to verify that the compiler is doing layout
correctly, and this is clearly not the place for that.
2025-12-16 06:24:54 +01:00
Alex Rønne Petersen
672ce9e919
compiler-rt: export __stack_chk_fail as __stack_smash_handler on openbsd 2025-12-16 06:24:49 +01:00
Alex Rønne Petersen
0564f83978
std.zig.target: remove two unused consts 2025-12-16 06:24:24 +01:00
Alex Rønne Petersen
00220a5ea1
build: add max_rss values observed on powerpc64le-linux 2025-12-16 06:23:20 +01:00
Alex Rønne Petersen
9f58931193
std.http: disable all tests on non-Debug powerpc64
https://github.com/llvm/llvm-project/issues/171879
2025-12-16 06:23:14 +01:00
Alex Rønne Petersen
647866dd63
std.math: disable hypot tests on non-Debug powerpc64
https://github.com/llvm/llvm-project/issues/171869
2025-12-16 06:23:11 +01:00
Alex Rønne Petersen
423d117251
test: skip bitcast nan float does not modify signaling bit on powerpc
This fails on a pwr10 machine.
2025-12-16 06:23:06 +01:00
Alex Rønne Petersen
c3ee8078b4
test: skip some C ABI vector tests on powerpc
These fail on a pwr10 machine.
2025-12-16 06:23:01 +01:00
Alex Rønne Petersen
eaae3f936b
test: limit invalid_tail_call to x86_64-linux
Targets that don't support tail calls will see:

    /home/ci/zig/.zig-cache/o/35dbe82c8e4d49ae5b7d630329568133/tmp.zig:5:5: error: unable to perform tail call: compiler backend 'stage2_llvm' does not support tail calls on target architecture 'powerpc64le' with the selected CPU feature flags

So just run this test on a known-good target.
2025-12-16 06:22:51 +01:00
Alex Rønne Petersen
f36949ead3
test: disable an error trace test on optimized powerpc64le 2025-12-16 06:22:46 +01:00
Alex Rønne Petersen
d5e3c8a2aa
compiler-rt: disable extenddftf2 test on powerpc
This fails on a pwr10 machine.
2025-12-16 06:22:40 +01:00
Alex Rønne Petersen
9373a963a1
langref: work around powerpc LLVM miscompilation in runtime_shrExact_overflow
https://github.com/ziglang/zig/issues/24304
2025-12-16 06:22:33 +01:00
Andrew Kelley
80b5917fad Merge pull request 'Bigint improvements' (#30100) from unplanned/zig:bigint-improvements into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30100
Reviewed-by: jedisct1 <jedisct1@noreply.codeberg.org>
2025-12-15 01:05:50 +01:00
Linus Groh
648c1c5d28 libc: Update macOS headers to SDK 26.2 2025-12-14 20:35:07 +00:00
Ryan Liptak
36cb5ea5f4 windows.ReadLink: handle NOT_A_REPARSE_POINT and add test 2025-12-14 07:12:38 -08:00
Ryan Liptak
ea7512084b Make windows.DeviceIoControl return NTSTATUS instead of a Zig error
The number of possible errors in the theoretical error set of this function is very large, while each individual call to the function is only concerned with a (potentially small) subset of those errors that are specific to the control code being used. This commit makes the callers determine which statuses they are interested in to avoid an ever-ballooning error set and ever-growing switch cases at each call site that throw away most of those errors.
2025-12-14 07:12:38 -08:00
Alex Rønne Petersen
2f2b097576 Merge pull request 'Linux: Nuke Stat bits in favour of Statx' (#30122) from The-King-of-Toasters/zig:statx into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30122
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2025-12-14 05:25:29 +01:00
Stephen Gregoratto
aec7bfb092 Linux: Dedupe generic decls
Commit #fc7a5f2 moved many of the `_t` types up a level, but didn't
remove them from arch_bits. Since `Stat` is gone, all but `time_t` can
be removed.
2025-12-14 01:41:47 +01:00
Stephen Gregoratto
6216922a9d Linux: Nuke Stat bits in favour of statx
Maintaining the POSIX `stat` bits for Zig is a pain. The order and
bit-length of members differ between all architectures, and int types
can be signed or unsigned. The libcs deal with this by introducing the
own version of `struct stat` and copying the kernel structure members to
it. In the case of glibc, they did it twice thanks to the largefile
transition!

In practice, the project needs to maintain three versions of `struct
stat`:
- What the kernel defines.
- What musl wants for `struct stat`.
- What glibc wants for `struct stat64`. Make sure to use `fstatat64`!

This isn't as simple as running `zig translate-c`. In #21440 I had to:
- Compile toolchains for each arch+glibc/musl combo.
- Create a test `fstat` program with/without `FILE_OFFSET_BITS=64`.
- Dump the value for `struct stat`.
- Stare at `std.os.linux`/`std.c` and cry.
- Add some missing padding.

The fact that so many target checks in the `linux` and `posix` tests
exist is most likely due to writing to padding bits and failing later.

The solution to this madness is `statx(2)`:
- It takes a single structure that is the same for all arches AND libcs.
- It uses a custom timestamp format, but it is 64-bit ready.
- It gives the same info as `fstatat(2)` and more!
- Unlike `fstatat(2)`, you can request a subset of the info required
  based on passing a mask.

It's so good that modern Linux arches (e.g. riscv) don't even implement
`stat`, with the libcs using a generic `struct stat` and copying from
`struct statx`.

Therefore, this commit rips out all the `stat` bits from `std.os.linux`
and `std.c`. `std.posix.Stat` is now `void`, and calling
`std.posix.*stat` is an compile-time error. A wrapper around `statx` has
been added to `std.os.linux`, and callers have been upgraded to use it.
Tests have also been updated to use `statx` where possible.

While I was here, I converted the mask and file attributes to be packed
struct bitfields. A nice side effect is checking that you actually
recieved the members you asked for via `Statx.mask`, which I have used
by adding `assert`s at specific callsites.
2025-12-14 01:41:47 +01:00
Stephen Gregoratto
ff3fd950a7 Linux: Update Statx structure
Also removes the blank lines between members, and a comptime sizeOf
check.
2025-12-14 01:41:47 +01:00
Jacob Young
c13857e504 windows: type safety improvements and more ntdll functions 2025-12-12 01:58:21 -05:00
Alex Rønne Petersen
27e5047a88
musl: add nop after b to __dlsym in powerpc64 ldso code
https://www.openwall.com/lists/musl/2025/12/12/1
2025-12-12 02:10:41 +01:00
Alex Rønne Petersen
1add36403a
musl: add nop after bl to start_c in powerpc64 crt code
https://www.openwall.com/lists/musl/2025/12/11/4
2025-12-12 00:52:07 +01:00
Alex Rønne Petersen
c1daad3d68
aro: define _CALL_ELF to 2 for powerpc64(le) 2025-12-12 00:52:00 +01:00
Alex Rønne Petersen
abc8ddcfa9
llvm: fix aliases not having linkage, visibility, etc set 2025-12-10 15:40:30 +01:00
Alex Rønne Petersen
2da956b84a
build: bump compiler max_rss to 6_664_025_702 on x86_64-linux 2025-12-10 00:07:25 +01:00
Andrew Kelley
1608e31ca1 std: disable flaky tests
tracked by https://codeberg.org/ziglang/zig/issues/30141
2025-12-09 10:58:55 -08:00
jedisct1
d27c804d9f Merge pull request 'crypto.mlkem: return J(z||c) on implicit rejection' (#30155) from jedisct1/zig:mlkemrej into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30155
2025-12-09 16:28:14 +01:00
jedisct1
60a9a7e085 Merge pull request 'crypto: add missing sha2 arm early clobber' (#30152) from sinon/zig:arm-sha2-clobber into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30152
2025-12-09 10:44:55 +01:00
Frank Denis
a0e9130b89 crypto.mlkem: return J(z||c) on implicit rejection
The ML-KEM decapsulation was returning z directly when implicit
rejection was triggered, but FIPS 203 specifies it should return
J(z || c) = SHAKE256(z || c).
2025-12-09 00:55:59 +01:00