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

40,344 commits

Author SHA1 Message Date
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
e4ad3e963e
test-behavior: re-enable float vector cmp tests on powerpc64 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
02488d96d6
test: re-enable stack protector for compiler-rt and libc tests on non-PowerPC
PowerPC is still affected by https://github.com/llvm/llvm-project/issues/195561.

closes https://codeberg.org/ziglang/zig/issues/31702
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
703a58da8d
Revert "llvm: disable loop vectorization for now"
This reverts commit 032319c942.
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
4bf080551c
Revert "llvm: workaround crash on large inline memset"
This reverts commit 84c2d809ec.

closes https://codeberg.org/ziglang/zig/issues/31701
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
66cd872dff
Revert "llvm: work around upstream aarch64-windows bug for private thread_local symbols"
This reverts commit b3747dd707.

closes https://codeberg.org/ziglang/zig/issues/31865
2026-10-07 00:30:52 +02:00
Alex Rønne Petersen
cc3b6ab1a8
cmake: remove workaround for Clang crash on s390x
https://github.com/llvm/llvm-project/pull/215027
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
bcc451758e
zig cc: update options data 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
b47534a8bf
zig cc: update driver files to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
37b8e4fc8f
build: update to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen
3a2f2614e1
README: update to LLVM 23 2026-10-07 00:30:50 +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
bff490a238 Merge pull request 'crypto.ff: remove unnecessary @as()' (#37078) from jedisct1/zig:ff-fixes10 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37078
2026-10-06 10:49:39 +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
be1fa17dce Merge pull request 'crypto.ff: add unit element helpers' (#37077) from jedisct1/zig:ff-fixes9 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37077
2026-10-06 10:49:20 +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
afb5c19612 Merge pull request 'crypto.hash.blake3: add a parallel update function' (#37069) from jedisct1/zig:blake3parallelupdate into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37069
2026-10-06 10:49:00 +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
effdac38a8 Merge pull request 'crypto.hash.kangarootwelve: add a parallel update function' (#37067) from jedisct1/zig:ktparallelupdate into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37067
2026-10-06 10:48:30 +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
7be72df07e Merge pull request 'base64: properly compute the decoded size upper bound' (#37087) from jedisct1/zig:base64upperbound into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37087
2026-10-06 10:44:11 +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
54460688ae Merge pull request 'crypto.aessiv: there's no special case for the empty string' (#37084) from jedisct1/zig:aessivempty into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37084
2026-10-06 10:41:10 +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
c389ce7d00 Merge pull request 'crypto.sha3.tuplehash: fix XOF output length encoding' (#37085) from jedisct1/zig:tuplehashfix into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37085
2026-10-06 10:39:21 +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
Alex Rønne Petersen
069986fdbf Merge pull request 'Sema: emit shr instead of shr_exact when @shrExact is used and wantSafety is true' (#37104) from rpkak/zig:safe-shrExact into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37104
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-10-06 05:05:43 +02:00
Alex Rønne Petersen
a7a6d1730d Merge pull request 'spirv: fix three regressions that make Vulkan modules invalid' (#37050) from brianferri/zig:fix/spirv-regressions into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37050
Reviewed-by: Ali Cheraghi <alichraghi@noreply.codeberg.org>
2026-10-06 04:16:16 +02:00
Ben Burkert
96b9286a1b zon: fix parse function name typos in doc comment 2026-10-05 10:43:56 -04:00
rpkak
8d47bbdbe0
Revert "langref: runtime_shrExact_overflow does not work as expected on RISC-V"
This reverts commit 9f064dff47.
2026-10-05 09:51:27 +02:00
rpkak
7c3e35d9ea
Revert "langref: runtime_shrExact_overflow does not work as expected on LoongArch"
This reverts commit c547a05b65.
2026-10-05 09:51:27 +02:00
rpkak
2af80a25e0
Revert "langref: work around s390x LLVM miscompilation in runtime_shrExact_overflow"
This reverts commit 4dd05b5a64.
2026-10-05 09:51:27 +02:00
rpkak
dc76b08e2a
Revert "langref: work around powerpc LLVM miscompilation in runtime_shrExact_overflow"
This reverts commit 9373a963a1.
2026-10-05 09:51:27 +02:00
rpkak
1f154f0893
Sema: emit shr instead of shr_exact when @shrExact is used and wantSafety is true
The safety check of @shrExact is to shift the result the same amount
back to the left and compare if this matches the input of the
@shrExact. But since the 'lshr exact' llvm instruction was used, llvm
was allowed to assume, that the result of the left-shift matches the input.
2026-10-05 09:50:58 +02: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
65b3cb2db9
test: fix mix_o_files standalone test to not mix libc and non-libc objects
Doing so might work by accident sometimes but is not actually valid in the
general case because whether libc is linked is an ABI property.
2026-10-05 03:26:41 +02:00