Commit Graph

36877 Commits

Author SHA1 Message Date
Alex Rønne Petersen ff8dbd010f libc: update glibc crt0 code to 2.43 2026-01-26 05:56:54 +01:00
Alex Rønne Petersen e4058f2c27 libc: update glibc abilists to 2.43 2026-01-26 05:56:54 +01:00
Alex Rønne Petersen 49afd7eee0 libc: update glibc headers to 2.43 2026-01-26 05:56:54 +01:00
Alex Rønne Petersen f6ed859cb0 std.zig.target: update glibc triples for loongarch64 targets 2026-01-26 05:56:53 +01:00
Michael Dusan f186809caf std: impl process.totalSystemMemory for netbsd 2026-01-25 13:03:22 -05:00
Frank Denis 8709f53d44 crypto.ff: allow seamless chaining regardless of representation (#30913)
Finite field elements can be in regular or Montgomery form, and
chaining different operations use to require manual and error-prone
conversions.

Now:

- `add`, `sub` and `mul` convert the second operand to match the
first operand's form
- `sq` and `pow` preserve the input's Montgomery form
- `toPrimitive` and `toBytes` return `UnexpectedRepresentation` if
the element is in Montgomery form, preventing incorrect serialization

This is fully backwards compatible and allows seamless chaining of
operations regardless of their representation.
2026-01-25 17:42:01 +01:00
Alex Rønne Petersen 99ec1ee353 ci: temporarily disable x86_64-netbsd while I investigate failures 2026-01-24 21:08:20 +01:00
Andrew Kelley a2ea36a517 zig libc: modify errno helper to eliminate @intCast
The vast majority of libc functions return `c_int` for the return value,
when setting errno. This utility function is for those cases.

Other cases can hand-roll the logic, or additional helpers can be added.
2026-01-24 20:18:18 +01:00
Alex Rønne Petersen 9d63dfaa81 link.Lld: give better exit status information for the lld child process
It's not nice to just throw away useful information.
2026-01-24 18:30:55 +01:00
Alex Rønne Petersen cf48041b55 std.Thread.Condition: use pthread_cond_t impl when OS has no futex primitive
Same principle as #30835.
2026-01-24 16:44:55 +01:00
Lukas Lalinsky 5f950884a1 std.c: add IPPROTO_RAW for Darwin platforms
IPPROTO_RAW (255) was missing from the Darwin/macOS IPPROTO struct,
even though it is defined in system headers and supported by the platform.
This is a commonly used protocol for raw IP sockets.
2026-01-24 12:26:00 +01:00
Alex Rønne Petersen 1b544f447a Merge pull request 'enable thumb-windows-gnu module tests' (#30968) from alexrp/zig:windows-pic into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30968
2026-01-24 02:09:41 +01:00
Andrew Kelley 5c42193b17 std.Io.Threaded: rework cancelation
Now it can handle sync cancelation and alertable cancelation on Windows.

Also fix the API of NtCancelIoFileEx
2026-01-23 12:59:36 -08:00
Alex Rønne Petersen e437efd601 test: enable thumb-windows-gnu module tests
We use long calls for these just like thumb*-linux-* to prevent range issues as
the binaries grow larger over time.

We also need function and data sections due to the many __stack_chk_guard
references within the std test binary; without these options, the linker is not
able to insert range thunks in between functions because the std binary just has
one giant .text section that's opaque to the linker.

closes https://codeberg.org/ziglang/zig/issues/30923
2026-01-23 21:16:03 +01:00
Alex Rønne Petersen c699bb8134 zig cc: don't bother passing -fPIC to Clang for Windows and UEFI targets
It's completely ignored anyway, by design, for compatibility reasons.
2026-01-23 21:16:03 +01:00
Alex Rønne Petersen 909159ad8e compiler: don't enforce PIC for x86-windows and thumb-windows
Only x86_64-windows and aarch64-windows actually require PIC.
2026-01-23 21:16:01 +01:00
Alex Rønne Petersen 20fae334ac compiler: UEFI does not support dynamic linking 2026-01-23 19:50:51 +01:00
Alex Rønne Petersen 2774436a83 ci: bump riscv64-linux-debug timeout by 1 hour 2026-01-23 16:17:47 +01:00
Andrew Kelley 1badb2a840 std.Io.Threaded: dirCreateFileWindows uses NtCreateFile directly 2026-01-22 18:08:13 -08:00
InKryption 305fd06756 Build: check if dynamic lib installed for symlinks
If the library isn't actually installed, `generated_bin` will be null,
causing this to panic about a missing dependency for itself; checking
for this state avoids this.
2026-01-22 22:28:28 +01:00
bartimaeusnek 37288e53ae std.zig.system.loongarch: implement individual cpu feature bit tests (#30915)
closes #30902

Co-authored-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30915
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
Co-authored-by: bartimaeusnek <bartimaeusnek@noreply.codeberg.org>
Co-committed-by: bartimaeusnek <bartimaeusnek@noreply.codeberg.org>
2026-01-22 19:18:47 +01:00
Alex Rønne Petersen c8edfbe1d5 Merge pull request 'enable x86_64-netbsd CI' (#30889) from alexrp/zig:netbsd-ci into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30889
2026-01-22 13:38:05 +01:00
Chadwain Holness fd3657bf8c Io.Threaded: remove WSA_FLAG_OVERLAPPED from socket call 2026-01-22 03:39:00 +01:00
Andrew Kelley 4b2eae32f1 Merge pull request 'libc: use common implementation for sys/utsname.h' (#30904) from GasInfinity/zig:libc-uname into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30904
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-01-22 02:23:52 +01:00
Alex Rønne Petersen 200fb7c2ac test-libc: disable raise-race.c 2026-01-21 18:51:02 +01:00
Alex Rønne Petersen 34aa1bb94f test-libc: enable loongarch64-linux-muslsf 2026-01-21 17:53:38 +01:00
Alex Rønne Petersen 3245eddcb1 musl: fix typo in 171b104640 2026-01-21 17:53:11 +01:00
Alex Rønne Petersen 953ca759c2 ci: disable incremental tests
Too much flakiness across the board: https://codeberg.org/ziglang/zig/issues?q=&type=all&sort=relevance&labels=747060&state=open&milestone=0&project=0&assignee=0&poster=0
2026-01-21 17:21:05 +01:00
Alex Rønne Petersen 7337946875 ci: enable x86_64-netbsd in the workflow 2026-01-21 17:21:05 +01:00
Alex Rønne Petersen 85580951a7 ci: add x86_64-netbsd scripts 2026-01-21 17:21:03 +01:00
Alex Rønne Petersen b7a4756e1d langref: disable @cImport tests on NetBSD
https://github.com/Vexu/arocc/issues/960
2026-01-21 16:42:45 +01:00
Alex Rønne Petersen eb3f16db5e test: clarify that self_exe_symlink fails on NetBSD due to bad F_GETPATH
closes https://codeberg.org/ziglang/zig/issues/30841
2026-01-21 16:42:17 +01:00
Alex Rønne Petersen 9f33c339c7 std.fs.test: fix file operations on directories on NetBSD
As noted earlier in this test, reading directories does not fail on NetBSD.
2026-01-21 16:42:02 +01:00
Matthew Lugg 35a191ec1c std.Io.Threaded: fix futex timeout race handling 2026-01-21 16:41:55 +01:00
Alex Rønne Petersen a3ea3bd31d std: NetBSD doesn't have a reliable F_GETPATH
It can fail arbitrarily with ENOENT if the kernel happens to not have the FD in
its name cache. That makes it useless for our purposes.

closes https://codeberg.org/ziglang/zig/issues/30843
2026-01-21 16:41:51 +01:00
Michael Dusan 32f977a4b7 std.fs.test: fix tests using Dir.realPath
* add fn isRealPathSupported
* incorporate into tests that depends on Dir.realPath
2026-01-21 16:41:37 +01:00
Alex Rønne Petersen fc59f0e7f0 std.Io.test: skip atime check in setTimestamps on NetBSD 2026-01-21 16:41:30 +01:00
GasInfinity 1ab6bf59a6 feat(libzigc): add common linux errno syscall helper 2026-01-21 12:02:08 +01:00
Mathias Lafeldt 2207c62bb5 MachO: fix dynamic lookup of undefined symbols at runtime
Ensures `MH_NOUNDEFS` is not set when dynamic lookup is enabled for
undefined symbols via `linker_allow_shlib_undefined`.
2026-01-21 00:31:21 +01:00
Andrew Kelley 7cbe05cbd4 Merge pull request 'std.os.linux: add some missing syscalls' (#30899) from brickmonster/zig:syscalls into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30899
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-01-21 00:28:40 +01:00
GasInfinity 4f652fb4e3 feat(libzigc): use common implementations for sys/utsname.h
* and remove their musl/wasi implementation
2026-01-21 00:06:42 +01:00
GasInfinity 9d3e9054a7 feat(std.c): add wasi definition for utsname 2026-01-21 00:06:42 +01:00
GasInfinity f67d21f736 chore(libc/musl): remove unused ffs impls
* forgot to remove them in the previous PR
2026-01-21 00:06:42 +01:00
brickmonster 8042096bca std.os.linux: add some missing syscalls 2026-01-20 18:30:45 +00:00
rpkak e6ac1b77f0 libzigc: test and fix acos 2026-01-20 18:02:15 +01:00
brickmonster 62ce228b37 std.os.linux: fix some compilation errors 2026-01-20 16:09:49 +00:00
Andrew Kelley c857fce05b langref: refine the underscore prefix section
more assertive yet less judgemental
2026-01-19 14:17:00 -08:00
Daggerfall-is-the-best-TES-game 21fc85f035 Add acos to ziglibc (#30888)
Since this is my first time contributing I wanted to keep it simple and I added just one function
I tested with
```bash
stage3/bin/zig build -p stage4 -Dno-lib -Dno-langref -Denable-llvm=true --search-prefix ~/repos/zig-boostrap/out/native-linux-musl-baseline/
stage4/bin/zig build test-libc -Dlibc-test-path=../libc-test -Dtest-target-filter=x86_64-linux-musl
```
and the tests passed.
I'm planning on doing more once I get the hang of it.

Co-authored-by: david <davidc.fried@gmail.com>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30888
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Daggerfall-is-the-best-TES-game <daggerfall-is-the-best-tes-game@noreply.codeberg.org>
Co-committed-by: Daggerfall-is-the-best-TES-game <daggerfall-is-the-best-tes-game@noreply.codeberg.org>
2026-01-19 22:43:57 +01:00
Michael Dusan a8002a8564 build: avoid pkg-config when statically linking LLVM
Fixes stage4 build on NetBSD with pkg-config installed.
2026-01-19 13:16:33 +01:00
Alex Rønne Petersen ac793232ee test: skip non-libc module tests for targets that require or default to libc
We were just creating duplicate work and breaking -Dskip-libc.
2026-01-19 13:16:25 +01:00