Commit graph

37144 commits

Author SHA1 Message Date
Andrew Kelley
4a3adaaa23 Merge pull request 'zig libc: implement malloc' (#31177) from libc-malloc into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31177
2026-02-13 06:30:42 +01:00
Karel Marek
37109fa4ef Fix IpAddress.setPort 2026-02-13 06:09:47 +01:00
Andrew Kelley
0957761d5c std.heap.BrkAllocator: fix incorrect assumptions 2026-02-12 16:30:27 -08:00
Andrew Kelley
6296924214 build: bump behavior max_rss 2026-02-12 16:30:24 -08:00
Andrew Kelley
6d52678a6c zig libc malloc: skip export when unit testing
These functions can only be exported when external libc components are
available due to the errno location dependency. Note that even when zig
libc is complete, on Windows, errno location will always be external (in
ucrtbase.dll).
2026-02-12 13:14:51 -08:00
Andrew Kelley
ec02571a30 zig libc malloc: set errno when returning null 2026-02-12 13:14:51 -08:00
Andrew Kelley
0de7668c01 test harness: refmt for readability 2026-02-12 13:14:51 -08:00
Andrew Kelley
21829a5b4a zig libc: export all symbols weak
Normally, libc goes into a static archive, making all symbols
overrideable. However, Zig supports including the libc functions as part
of the Zig Compilation Unit, so to support this use case we make all
symbols weak.
2026-02-12 13:14:51 -08:00
Andrew Kelley
f5d5dbd166 wasi libc: remove malloc defines 2026-02-12 13:14:51 -08:00
Andrew Kelley
e2fccd8dd5 musl: remove macro redefinitions of malloc 2026-02-12 13:14:51 -08:00
Andrew Kelley
6ccabbd4e5 std: brk allocator for single-threaded mode 2026-02-12 13:14:51 -08:00
Andrew Kelley
6744160211 zig libc: implement malloc 2026-02-12 13:14:51 -08:00
Andrew Kelley
5c59a46238 std.heap.PageAllocator: fix not respecting alignments
in remap and resize, alignments larger than page size were incorrectly ignored.
2026-02-12 13:14:51 -08:00
Andrew Kelley
0a61eca22c bump max_rss for module tests 2026-02-12 13:14:51 -08:00
Jacob Young
251f54d1d7 crash_report: finish reverting panic changes 2026-02-12 13:13:45 -05:00
Alex Rønne Petersen
381e231468 Merge pull request 'fix(codegen/llvm): teach llvm to not dllexport hidden exports' (#31180) from GasInfinity/zig:fix-hidden-dllexport into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31180
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-02-12 08:36:15 +01:00
Meghan Denny
13f31bb3c3 std/c: glibc has supported arc4random_buf since 2.36 2026-02-11 15:29:51 -08:00
Andrew Kelley
b600b6e5e0 std.posix: remove close function 2026-02-11 23:37:31 +01:00
Andrew Kelley
ea30f86113 bump maxrss for compiler_rt, libc, and c-abi tests 2026-02-11 23:37:31 +01:00
Andrew Kelley
ba293eb820 Revert "compiler: override debug_io in release + evented mode"
This reverts commit 6840326711.

The commit bungled deinitialization in main.
2026-02-11 10:44:04 -08:00
Pivok
d4217e2119 zig libc: exp10, exp10f, pow10, pow10f (#31163)
See #30978.

Commands i run:
```
$ stage3/bin/zig build -p stage4 -Denable-llvm -Dno-lib

$ stage4/bin/zig build test-libc -Dlibc-test-path=../../libc-test -Dtest-filter=exp10 -fqemu -fwasmtime --summary line
Build Summary: 725/737 steps succeeded (12 skipped)
```

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31163
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Pivok <pivoc@protonmail.com>
Co-committed-by: Pivok <pivoc@protonmail.com>
2026-02-11 19:39:40 +01:00
GasInfinity
a6f64096a1
chore(test/standalone): test linking libc in a shared library 2026-02-11 15:48:18 +01:00
GasInfinity
87fa61bdd1
fix(codegen/llvm): teach llvm to not dllexport hidden exports 2026-02-11 10:51:26 +01:00
Andrew Kelley
96bd268c8c zig libc: simplify implementation
- use symbol export helper
- move all declarations from common.zig into c.zig
- correct documentation
- delete dead code
2026-02-11 07:58:11 +01:00
Andrew Kelley
6840326711 compiler: override debug_io in release + evented mode
to avoid a dependency on std.Io.Threaded in such case
2026-02-11 00:27:06 +01:00
Jacob Young
7369008d8c Io.IoUring: implement some thread pool options and other cleanup 2026-02-10 23:45:48 +01:00
Khitiara
e314dadb01 Allow overriding std.Io at a namespace level.
This should only be used when the fundamental types break down, e.g. on freestanding or when adding support for a non-posix OS, where std.Io.File.Handle is set to void.
2026-02-10 21:07:53 +01:00
Andrew Kelley
bf1b9318a9 Merge pull request 'compiler_rt: common -> compiler_rt' (#31169) from compiler-rt-cleanup-2 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31169
2026-02-10 20:28:28 +01:00
Andrew Kelley
7fbeeca924 Merge pull request 'Linux 6.19' (#31165) from alexrp/zig:linux-6.19 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31165
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-02-10 05:29:00 +01:00
Andrew Kelley
2372c68ae8 cmake: remove compiler rt source listings 2026-02-09 20:11:39 -08:00
Andrew Kelley
74608293af compiler_rt: common -> compiler_rt
use the "symbol" helper function in all exports

move all declarations from common.zig to compiler_rt.zig

flatten the tree structure somewhat (move contents of tiny files into
parent files)

No functional changes.
2026-02-09 20:03:15 -08:00
Andrew Kelley
6c7814fabd Merge pull request 'Autodoc: display line numbers in source code display' (#31155) from nektro/fork-zig:nektro-patch-54643 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31155
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-02-10 01:43:12 +01:00
Andrew Kelley
b607b0c27a Merge pull request 'IoUring: update to new Io APIs' (#31158) from io-uring-update into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31158
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-02-10 00:43:51 +01:00
Alex Rønne Petersen
fcf0fc225a
std.Target: update max Linux version to 6.19 2026-02-09 23:54:30 +01:00
Alex Rønne Petersen
7af9882c6d
libc: update Linux headers to 6.19 2026-02-09 23:54:30 +01:00
Alex Rønne Petersen
80db2e0b8b
std.os.linux: update syscalls for 6.19 2026-02-09 23:54:30 +01:00
Alex Rønne Petersen
bc282a6389
generate_linux_syscalls: add loongarch32 2026-02-09 23:54:30 +01:00
Alex Rønne Petersen
81ef502f08
generate_linux_syscalls: add hexagon abi name 2026-02-09 23:54:30 +01:00
Alex Rønne Petersen
65c073b147
generate_linux_syscalls: update usage text 2026-02-09 23:46:19 +01:00
Andrew Kelley
04c180c8e5 compiler_rt: partial cleanup
introduce `symbol` helper function and partially migrate to using it
2026-02-09 20:04:17 +01:00
Nils Koch
6473dc22fc std.ArrayList: Fix compile error when @sizeOf(T) == 0 2026-02-09 19:59:09 +01:00
Jacob Young
7e8ee985e2 tracy: add fiber integration 2026-02-09 10:47:21 -05:00
Jacob Young
f2cbc1912b tracy: replace namedFrame with traceNamed
It is not valid to use frames here because multiple compilations may run
concurrently, and a frame with a given name must stop before starting
again.
2026-02-09 10:47:21 -05:00
Jacob Young
a28d57292f IoUring: update to new Io APIs 2026-02-09 10:47:21 -05:00
Jacob Young
b48599c549 Sema: fix crash compiling an evented compiler 2026-02-09 02:24:56 -05:00
Jacob Young
2961cf1dac tracy: update API 2026-02-09 02:24:56 -05:00
Pivok
f1b2554023 libzigc: hypotf, hypotl (#31150)
Implements hypotf and hypotl for libzigc #30978.

Continuation of #31104

Commands i run:

```
$ stage3/bin/zig build -p stage4 -Denable-llvm -Dno-lib

$ stage4/bin/zig build test-libc -Dlibc-test-path=../../libc-test -Dtest-filter=hypotf -fqemu -fwasmtime --summary line
Build Summary: 365/369 steps succeeded (4 skipped)

$ stage4/bin/zig build test-modules -Dtest-target-filter=windows -Dtest-filter=hypotf --summary line
Build Summary: 53/101 steps succeeded (48 skipped)
```

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31150
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Pivok <pivoc@protonmail.com>
Co-committed-by: Pivok <pivoc@protonmail.com>
2026-02-09 07:59:40 +01:00
antme0
fb18f2096a Allow build.zig scripts to define module definition files (.def) when building win32 dlls. 2026-02-09 07:58:13 +01:00
Meghan Denny
c99b43e3da ArrayList.writer() removed in 57dbc9e74a 2026-02-08 21:24:22 -08:00
Meghan Denny
e4438a58ae fatal removed in b745a96d20 2026-02-08 21:24:05 -08:00