Alex Rønne Petersen
2abfbd952a
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-05 12:20:05 +01:00
Alex Rønne Petersen
fc62e6d7ef
compiler-rt: export __stack_chk_fail as __stack_smash_handler on openbsd
2025-12-05 12:20:05 +01:00
Alex Rønne Petersen
abb9ec3840
std.zig.target: add openbsd libc support
2025-12-05 12:20:05 +01:00
Alex Rønne Petersen
bfe6117b1b
compiler: support building openbsd crt0 and stub shared libraries
...
closes #2878
2025-12-05 12:20:05 +01:00
Alex Rønne Petersen
7ce50db17d
compiler: don't error on explicit link_libc=false on requiresLibC() targets
...
There are various reasons why one might want to still create libc-less
compilations on these targets. Case in point: Compiling our bundled crt0 for
OpenBSD.
We will still default to linking libc on these targets, though.
2025-12-05 12:20:05 +01:00
Alex Rønne Petersen
e4f3eedb8a
update_openbsd_libc: add tool for updating openbsd libc startup code
2025-12-05 12:20:05 +01:00
Alex Rønne Petersen
bb7d949100
libc: add openbsd libc startup code for 7.8
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
9a9cc9c96d
compiler: define ___OpenBSD and OpenBSDX_Y when targeting openbsd libc
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
df147734a3
std.zig.target: handle openbsd libc names
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
c3b9f49ac2
std.zig.target: remove two unused consts
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
0ea6bd08d8
std.zig.LibCDirs: add openbsd support
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
6c9cc3450f
std.Target: bump baseline openbsd version from 7.7 to 7.8
...
Since this is the first version we support cross-compiling for.
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
ac86650bf4
std.Target: factor arch/abi into openbsd minimum version logic
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
6921ae8925
std.Target: openbsd's landisk port is only little endian
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
9e3c240fda
std.Target: add isOpenBSDLibC()
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
5f77dde83a
libc: add openbsd 7.8 abilists
2025-12-05 12:20:04 +01:00
Alex Rønne Petersen
1311e997d4
libc: add openbsd 7.8 headers
...
This excludes all headers in /usr/include/dev because that directory is bonkers
huge (18M). We can add these on an as-needed basis.
2025-12-05 12:19:07 +01:00
Alex Rønne Petersen
154ad83ea4
process_headers: add openbsd support
2025-12-05 12:07:04 +01:00
Alex Rønne Petersen
c166bb36f6
ci: reduce x86_64-linux timeouts
...
These excessive timeouts should no longer be necessary with the recent tuning of
job capacity and maxrss on these machines.
2025-12-04 20:52:34 +01:00
Alex Rønne Petersen
78cba86928
ci: set maxrss from $ZSF_MAX_RSS if provided by the runner
...
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / loongarch64-linux-debug (push) Waiting to run
ci / loongarch64-linux-release (push) Waiting to run
ci / riscv64-linux-debug (push) Waiting to run
ci / riscv64-linux-release (push) Waiting to run
ci / s390x-linux-debug (push) Waiting to run
ci / s390x-linux-release (push) Waiting to run
ci / x86_64-freebsd-debug (push) Waiting to run
ci / x86_64-freebsd-release (push) Waiting to run
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-debug-llvm (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
All of our runners now define this. When running a CI script locally, this will
not be set, so we default to 0, aka "all available system memory".
2025-12-04 20:06:48 +01:00
Alex Rønne Petersen
2728eb5d5e
build: adjust max_rss on a per-CI-host basis
...
This avoids pessimizing concurrency on all machines due to e.g. the macOS
machine having high memory usage across the board due to 16K page size.
This also adds max_rss to test-unit and test-c-abi since those tend to eat a
decent chunk of memory too.
2025-12-04 20:06:12 +01:00
Alex Rønne Petersen
44543800a5
std.process.Child: enable rusage collection for dragonfly, netbsd, openbsd
2025-12-04 03:46:36 +01:00
Alex Rønne Petersen
2659fadb95
std.c: add rusage for dragonfly, netbsd, openbsd
2025-12-04 03:46:36 +01:00
Alex Rønne Petersen
9eed87f93e
std.process.Child: enable rusage collection for freebsd, illumos, serenity
2025-12-04 03:46:36 +01:00
Alex Rønne Petersen
e270c97ed1
ci: don't skip release mode tests on x86_64-windows-debug
...
pulsar is much faster than george so we don't need to do this anymore.
2025-12-04 03:46:36 +01:00
Alex Rønne Petersen
c21ce53494
ci: skip spirv and wasm tests on x86_64-freebsd
...
These are already built and run on x86_64-linux.
2025-12-04 03:46:36 +01:00
Alex Rønne Petersen
e2a9e568b4
build: add -Dskip-spirv and -Dskip-wasm options
2025-12-04 03:46:35 +01:00
Alex Rønne Petersen
ad9a5187ac
build: add some missing darwin tags
2025-12-04 03:46:35 +01:00
jedisct1
d73fbcc3ae
Merge pull request 'Argon2: use the std.Io interface' ( #30084 ) from jedisct1/zig:argon2 into master
...
ci / aarch64-linux-debug (push) Has been cancelled
ci / aarch64-linux-release (push) Has been cancelled
ci / aarch64-macos-debug (push) Has been cancelled
ci / aarch64-macos-release (push) Has been cancelled
ci / loongarch64-linux-debug (push) Has been cancelled
ci / loongarch64-linux-release (push) Has been cancelled
ci / riscv64-linux-debug (push) Has been cancelled
ci / riscv64-linux-release (push) Has been cancelled
ci / s390x-linux-debug (push) Has been cancelled
ci / s390x-linux-release (push) Has been cancelled
ci / x86_64-freebsd-debug (push) Has been cancelled
ci / x86_64-freebsd-release (push) Has been cancelled
ci / x86_64-linux-debug (push) Has been cancelled
ci / x86_64-linux-debug-llvm (push) Has been cancelled
ci / x86_64-linux-release (push) Has been cancelled
ci / x86_64-windows-debug (push) Has been cancelled
ci / x86_64-windows-release (push) Has been cancelled
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30084
2025-12-03 12:18:09 +01:00
Zihad
cb115cf73a
std.process.ArgIteratorWasi: fix no-args deinit
2025-12-03 08:35:24 +01:00
Alex Rønne Petersen
be9649f4ea
ci: set a sensible maxrss in x86_64-windows scripts
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / loongarch64-linux-debug (push) Waiting to run
ci / loongarch64-linux-release (push) Waiting to run
ci / riscv64-linux-debug (push) Waiting to run
ci / riscv64-linux-release (push) Waiting to run
ci / s390x-linux-debug (push) Waiting to run
ci / s390x-linux-release (push) Waiting to run
ci / x86_64-freebsd-debug (push) Waiting to run
ci / x86_64-freebsd-release (push) Waiting to run
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-debug-llvm (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
2025-12-03 00:24:58 +01:00
Frank Denis
6fe95c28cf
Argon2: use the std.Io interface
...
Also reduce the memory required by tests.
4GB for every test is way too much and doesn't provide much benefits
in testing the algorithms.
2025-12-02 23:03:52 +01:00
Andrew Kelley
52ad126bb4
Merge pull request 'std.Io.Threaded: rework cancellation' ( #30033 ) from cancellation into master
...
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / loongarch64-linux-debug (push) Waiting to run
ci / loongarch64-linux-release (push) Waiting to run
ci / riscv64-linux-debug (push) Waiting to run
ci / riscv64-linux-release (push) Waiting to run
ci / s390x-linux-debug (push) Waiting to run
ci / s390x-linux-release (push) Waiting to run
ci / x86_64-freebsd-debug (push) Waiting to run
ci / x86_64-freebsd-release (push) Waiting to run
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-debug-llvm (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30033
2025-12-02 17:58:29 +01:00
Andrew Kelley
bb3f56d5d5
std.Io.Threaded: separate out ECANCELED handling again
...
If ECANCELED occurs, it's from pthread_cancel which will *permanently*
set that thread to be in a "canceling" state, which means the cancel
cannot be ignored. That means it cannot be retried, like EINTR. It must
be acknowledged.
2025-12-01 19:17:52 -08:00
Andrew Kelley
cf82064ebc
std.Io.Threaded: don't use pthread_cancel with musl
...
It doesn't support setting the "canceled" status to false, so once a
thread has been canceled, all operations on the thread start permanently
failing.
2025-12-01 19:17:52 -08:00
Andrew Kelley
bf0ffc45b9
std.Io.Threaded: musl: handle ECANCELED same as EINTR
...
Otherwise the pthread_cancel can affect unrelated tasks.
2025-12-01 19:17:52 -08:00
Andrew Kelley
54a84964f8
std.os.linux: SIG enum is non-exhaustive
2025-12-01 19:17:52 -08:00
Andrew Kelley
57f5de5b77
std.Io.Threaded: use the correct mmsghdr struct
2025-12-01 19:17:52 -08:00
Andrew Kelley
103467fa6c
std.Io.Threaded: make is_musl linux-only
2025-12-01 19:17:52 -08:00
David Rubin
85053a6a36
link.Elf: implement aarch64 relocation
2025-12-01 19:17:52 -08:00
Andrew Kelley
c4f5dda135
std.Io.Threaded: re-introduce retry logic behind config
2025-12-01 19:17:52 -08:00
Andrew Kelley
de87bad4c3
std.Io.Threaded: don't solve the cancel race after all
...
Unfortunately, trying again until the cancellation request is
acknowledged has been observed to incur a large amount of overhead,
and usually strong cancellation guarantees are not needed, so the
race condition is not handled here. Users who want to avoid this
have this menu of options instead:
* Use no libc, in which case Zig std lib can avoid the race (tracking
issue: https://codeberg.org/ziglang/zig/issues/30049 )
* Use musl libc
* Use `std.Io.Evented`. But this is not implemented yet. Tracked by
- https://codeberg.org/ziglang/zig/issues/30050
- https://codeberg.org/ziglang/zig/issues/30051
glibc + threaded is the only problematic combination.
2025-12-01 19:17:52 -08:00
Andrew Kelley
144206856e
std.Io.Threaded: fix compilation for riscv32-linux
2025-12-01 19:17:52 -08:00
Andrew Kelley
9e981c3ae5
std.os.linux: delete unnecessary @compileError
...
Without this, it already fails to compile with a sufficiently helpful
error message.
2025-12-01 19:17:52 -08:00
Andrew Kelley
39ac40209b
std.Io.Threaded: use musl's beautiful pthread_cancel semantics
2025-12-01 19:17:52 -08:00
Andrew Kelley
d60760d61e
std.Io.Threaded: tune requestCancel
...
On a heavily loaded Linux 6.17.5, I observed a maximum of 20 attempts
not acknowledged before the timeout (including exponential backoff) was
sufficient, despite the heavy load.
The time wasted here sleeping is mitigated by the fact that, later on,
the system will likely wait for the canceled task, causing it to
indefinitely yield until the canceled task finishes, and the task must
acknowledge the cancel before it proceeds to that point.
2025-12-01 19:17:52 -08:00
Andrew Kelley
29e418cbfb
std.Io.Threaded: fix the cancellation race
...
Now, before a syscall is entered, beginSyscall is called, which may
return error.Canceled. After syscall returns, whether error or success,
endSyscall is called. If the syscall returns EINTR then checkCancel is
called.
`cancelRequested` is removed from the std.Io VTable for now, with plans
to replace it with a more powerful API that allows protection against
cancellation requests.
closes #25751
2025-12-01 19:17:52 -08:00
rpkak
95f93a0b28
std.zig.Ast: count addrspace tokens correctly
...
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / loongarch64-linux-debug (push) Waiting to run
ci / loongarch64-linux-release (push) Waiting to run
ci / riscv64-linux-debug (push) Waiting to run
ci / riscv64-linux-release (push) Waiting to run
ci / s390x-linux-debug (push) Waiting to run
ci / s390x-linux-release (push) Waiting to run
ci / x86_64-freebsd-debug (push) Waiting to run
ci / x86_64-freebsd-release (push) Waiting to run
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-debug-llvm (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
Before this PR this
```zig
const namespace = struct {
extern const num: u8 addrspace(.generic);
};
// comment
```
got formatted to this
```zig
const namespace = struct {
extern const num: u8 addrspace(.generic);
(
```
Co-authored-by: rpkak <rpkak@noreply.codeberg.org>
Co-committed-by: rpkak <rpkak@noreply.codeberg.org>
2025-12-01 12:56:11 +01:00
jedisct1
1d1e2b7780
Merge pull request 'std.crypto.aes: expose the inverse MixColumns operation' ( #30052 ) from jedisct1/zig:invmixcolumns into master
...
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / loongarch64-linux-debug (push) Waiting to run
ci / loongarch64-linux-release (push) Waiting to run
ci / riscv64-linux-debug (push) Waiting to run
ci / riscv64-linux-release (push) Waiting to run
ci / s390x-linux-debug (push) Waiting to run
ci / s390x-linux-release (push) Waiting to run
ci / x86_64-freebsd-debug (push) Waiting to run
ci / x86_64-freebsd-release (push) Waiting to run
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-debug-llvm (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30052
2025-12-01 11:16:26 +01:00
fn ⌃ ⌥
bfe3317059
Return a usize from @abs if given an isize
...
Also:
- `c_ushort` for `c_short`
- `c_uint` for `c_int`
- `c_ulong` for `c_long`
- `c_ulonglong` for `c_longlong`
2025-11-29 21:09:08 +01:00