0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
Commit graph

16,565 commits

Author SHA1 Message Date
Alex Rønne Petersen
65f29a7344
libcxx: fix OpenBSD build failure due to missing __get_locale_encoding()
https://github.com/llvm/llvm-project/pull/228306
2026-10-07 00:30:52 +02:00
Lucas Chollet
709430de4b
libcxx: add serenity support 2026-10-07 00:30:52 +02:00
Elaine Gibson
1d8fcfcd0e
libcxx: add haiku support
https://github.com/llvm/llvm-project/pull/196271
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
eb8ab541be
libc: add darwin header os/os_sync_wait_on_address.h 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
265f3dd10f
compiler-rt: disable __udivei4/__umodei4 test on sparc64 w/ llvm
https://codeberg.org/ziglang/zig/issues/37056
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
72222508bb
std.Target.DynamicLinker: define path for riscv64-hurd-gnu 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
e4c80ae695
std.debug.Dwarf: fix supportsUnwinding() for amdgcn
https://github.com/llvm/llvm-project/pull/183148
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
4b90a8e967
std.zig.system.x86: add jmpabs detection 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
22db242b79
std.zig.system.x86: add avx512bmm detection 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
fe188a3261
std.zig.system.x86: add hygon family CPU detection 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
b56c08c4c5
std.zig.system.x86: add znver6 CPU detection 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
0e4a98d969
std.zig.system.arm: add hip12 and rigel CPU detection 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
8c06a8dc8f
compiler: add loongarch(32,64)_preserve_none calling convention support 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
902c7bb4ff
libc: remove __SIG_ATOMIC_TYPE__ workaround for riscv(32,64)-netbsd 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
3392984789
libc: remove __WCHAR_MIN__ workaround for riscv(32,64)-netbsd 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
964e93dc47
move wcslen from libzigc to compiler-rt
Similar to strlen, LLVM 23+ will sometimes emit libcalls to this function even
when libc isn't linked.
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
45a40c4fa8
llvm: update address spaces to LLVM 23
Note: https://codeberg.org/ziglang/zig/issues/31190#issuecomment-20523923
2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
16e1906e3d
std.zig.llvm.Builder: update data layout strings to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
53173d25ab
std.Target: update CPU models and features to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
3f15fc5ed6
libtsan: update to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
a04355206b
libunwind: update to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
f689d3cf27
llvm-libc: update to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
3cc56f98b4
libcxx: update to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
6c772d90f8
libcxxabi: update to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
eeb3b230d6
zig cc: update intrinsic headers to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
6c78e9250d Merge pull request 'move no-libc ELF auxiliary vector and thread-local storage initialization to compiler-rt' (#36564) from alexrp/zig:compiler-rt-tls-auxv into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36564
2026-10-07 00:26:56 +02:00
Frank Denis
d6debf0de7 crypto.ff: remove unnecessary @as()
@truncate() was automatically converted into @as(...@truncate(...))
by `zig fmt` back in the days, but type inference is enough.
2026-10-06 10:49:39 +02:00
Frank Denis
c60dfbcc6e crypto.ff: add unit element helpers
Add isOne(), isMinusOne(), and subOne() helpers for quick constant-time
operations against the unit element, regardless of the representation.
2026-10-06 10:49:20 +02:00
Frank Denis
2ab329aed1 std.crypto.Blake3: add incremental parallel update
Add updateParallel(), so streaming input can be hashed using
multiple threads.
2026-10-06 10:49:00 +02:00
Frank Denis
a3b95e1b1a For single-chunk messages, just use regular TurboShake implementation
The local kangarootwelve version was just redundant code, and only
aborbed one byte at a time
2026-10-06 10:48:30 +02:00
Frank Denis
92d82e6a34 crypto.hash.kangarootwelve: add a parallel update function
Add an updateParallel() function to perform incremental updates
using multiple threads, and take it as an opportunity to slightly
simplify the code.
2026-10-06 10:48:30 +02:00
Frank Denis
fc9184e652 base64: properly compute the decoded size upper bound
First, the correct length for decoding should be computed with
/4*3 , not the other way round as when encoding.

But also, without padding, a string such as "Zg" is valid base64
(here, it's the character 'f', padded base64 would be "Zg==").

decodedLenUpperBound() returned 0 instead of 1 in that example.

Correctly fix the computation of the upper bound.
2026-10-06 10:44:11 +02:00
Frank Denis
a64a255335 crypto.aessiv: there's no special case for the empty string
Add a test for that case by the way.
2026-10-06 10:41:10 +02:00
Frank Denis
7151140bde crypto.sha3.tuplehash: fix XOF output length encoding
We should append TupleHashXOF's right_encode(0) marker directly
to the cSHAKE instance, not treat is as another tuple element.

The existing tests didn't catch this because they were using
TupleHash as a hash function, not as a XOF.
2026-10-06 10:39:21 +02:00
Brandon L Black
be8e7da103 Io.net.cmsg: Fix Iterator.Message.header alignment
Without this change, on some targets (e.g. aarch64-freebsd),
calling `cmsg.data()` with `Iterator.message.header` as the
argument would result in compilation failures like:

    error: expected type '*align(8) c.posix_cmsghdr', found '*c.posix_cmsghdr'
2026-10-06 07:31:14 +02:00
Ben Burkert
96b9286a1b zon: fix parse function name typos in doc comment 2026-10-05 10:43:56 -04:00
Alex Rønne Petersen
f0d0412942
compiler-rt: move some checks up to elf.zig 2026-10-05 03:26:41 +02:00
Alex Rønne Petersen
736d37ad16
move std.os.linux.tls to compiler_rt as __zig_elf_static_tls_*
As with __zig_elf_auxv, we need a canonical location for __tls_get_addr (or
__tls_get_offset on s390x), and compiler-rt is the obvious place. But that also
means that moving all of std.os.linux.tls there just makes sense. I decided not
to namespace this under linux because it's expected that most of this code will
apply to the BSDs too.

The ABI that std now expects is:

    extern fn __zig_elf_static_tls_init(phdrs: [*]elf.ElfN.Phdr, phnum: usize) void;
    extern fn __zig_elf_static_tls_fill(area: [*]u8) usize;
    extern var __zig_elf_static_tls: extern struct {
        size: usize,
        alignment: usize,
        gdt_entry_number: usize,
    };

Users can override all three weak symbols with strong symbols if they want to
provide their own ELF TLS implementation, which may be useful to do when doing
manual dynamic loading from a static executable. Note that __tls_get_addr (or
__tls_get_offset on s390x) must also be provided, per the ELF TLS specification.
2026-10-05 03:26:41 +02:00
Alex Rønne Petersen
292edd2440
move std.os.linux.elf_aux_maybe to compiler_rt as __zig_elf_auxv
This gets rid of the super confusing and (as far as I can tell) incorrect
getauxval logic in std.os.linux, and clarifies exactly who owns this state.

The ABI that std now expects is:

    extern var __zig_elf_auxv: [*]std.elf.Auxv;

Users can technically override this weak symbol with a strong symbol if they
wish, although I see no particularly useful reason to do so.

It is now a compile error to use std.os.linux.getauxval if libc is linked,
whereas previously it would just give useless results in some cases. I consider
this to be strictly an improvement. Just use std.c.getauxval when linking libc,
which std already does correctly where it needs getauxval.

This code is expected to be further simplified once our baseline Linux version
allows implementing https://codeberg.org/ziglang/zig/issues/31290.

closes https://codeberg.org/ziglang/zig/issues/36203
2026-10-05 03:26:41 +02:00
Alex Rønne Petersen
71590ad8c9
std.elf: fix Elf64_auxv_t layout on NetBSD and OpenBSD 2026-10-04 18:33:19 +02:00
Alex Rønne Petersen
5e754304de remove support for wasi-libc
closes https://github.com/ziglang/zig/issues/9342
closes https://github.com/ziglang/zig/issues/15005
closes https://github.com/ziglang/zig/issues/20747
closes https://github.com/ziglang/zig/issues/22570
closes https://codeberg.org/ziglang/zig/issues/30977
2026-10-04 18:23:18 +02:00
Alex Rønne Petersen
56023ff8fe Merge pull request 'std.Io.Threaded: only use spawnDarwin in processReplace when spawning is supported' (#37063) from enfipy/zig:std-threaded-ios-process-replace into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37063
Reviewed-by: Jacob Young <jacobly@ziglang.org>
2026-10-04 18:19:10 +02:00
Alex Rønne Petersen
59a501a9ac Merge pull request 'fix regressions caused by control data changes' (#37070) from hemisputnik/fix-control-data into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37070
2026-10-04 18:16:24 +02:00
Frank Denis
d7fe3b57fc Make valueBarrier a no-op on stage2_wasm 2026-10-04 16:56:00 +02:00
Frank Denis
ebc1c263b4 crypto.ff: hide constant-time selection masks from optimizer
Hide the selection mask so LLVM can't replace it with a branch
around the calling loop.

Fixes #37023
2026-10-04 16:56:00 +02:00
Frank Denis
0adecad9e6 Unroll for loops
Provides a 15% speedup on WebAssembly, both with wamstime and V8.
2026-10-04 14:03:54 +02:00
Frank Denis
e67cb2c7c9 Export the state alignment 2026-10-04 14:03:54 +02:00
Frank Denis
8b0f9360cf Add a test for specialized vs regular AEGIS state updates 2026-10-04 14:03:54 +02:00
Frank Denis
e782da3d89 crypto.aegis: add specialized implementation for CPUs without AES
On CPUs that don't support AES acceleration (and in environments
such as WebAssembly) we already use a generic bitsliced AES
implementation, via std.crypto.core.aes.

But AEGIS can be much faster by keeping the state bitsliced
(so we only set and extract the required bits to update the
state and get the keystream).

Rotating the state is also as simple as a 1-bit shift over the
entire bitsliced state.

This PR implements techniques described in
https://eprint.iacr.org/2026/1338 and makes AEGIS on CPUs without
AES acceleration 2x-3x faster.

On WebAssembly with SIMD, there's room for improvement (see
https://00f.net/2026/07/16/aes-with-simd-swizzles/) but that
requires swizzle operations that we don't support yet.
2026-10-04 14:03:54 +02:00
David
c92c8ef8cf std.process: match can_spawn and can_replace to Apple SDK availability 2026-10-04 10:39:43 +04:00