aboutsummaryrefslogtreecommitdiff
path: root/lib/std
AgeCommit message (Collapse)Author
2025-09-30more stillmlugg
2025-09-30more stuffmlugg
2025-09-30change one million thingsmlugg
2025-09-30debug: refactor stack frame capturingJacob Young
2025-09-28std.os.linux: delete restore and restore_rt for hexagon, loongarch, mips, riscvAlex Rønne Petersen
2025-09-28std.os.linux: delete SA.RESTORER and k_sigaction.restorer for hexagon, ↵Alex Rønne Petersen
loongarch, mips, riscv The kABIs for these architectures don't define these concepts.
2025-09-27Merge pull request #25373 from mneumann/fix-dragonfly-bootstrapAlex Rønne Petersen
Fix DragonFly bootstrap
2025-09-27Merge pull request #25362 from alexrp/aro-valistAlex Rønne Petersen
`aro`: `TypeStore`: synchronize `__va_list_tag` logic with Zig's `std.builtin.VaList`
2025-09-27lib/std/c: sync "struct stat" for DragonFlyMichael Neumann
* Add missing functions like ISDIR() or ISREG(). This is required to build the zig compiler * Use octal notation for the S_ constants. This is how it is done for ".freebsd" and it is also the notation used by DragonFly in "sys/stat.h" * Reorder S_ constants in the same order as ".freebsd" does. Again, this follows the ordering within "sys/stat.h"
2025-09-26std.builtin: define VaList as `*u8` for uefiAlex Rønne Petersen
2025-09-26std.builtin: remove dead powerpc-darwin handling for VaListAlex Rønne Petersen
2025-09-26std.builtin: define VaList for arc, csky, lanai, m68k, msp430, nvptx, ve, xcoreAlex Rønne Petersen
2025-09-26std.builtin: sort VaList prongs a bitAlex Rønne Petersen
2025-09-26std.builtin: define VaList as `struct { __ap: *anyopaque }` for Arm per AAPCSAlex Rønne Petersen
2025-09-26Merge pull request #25342 from ziglang/fuzz-limitAndrew Kelley
fuzzing: implement limited fuzzing
2025-09-26Merge pull request #25351 from ziglang/chompAndrew Kelley
std.mem: introduce cut functions; rename "index of" to "find"
2025-09-25web ui: fix not sending initial context sometimesAndrew Kelley
This would cause the web ui to crash in js or wasm.
2025-09-25Merge pull request #24497 from ziglang/aro-translate-cAndrew Kelley
compiler: update aro and translate-c to latest; delete clang translate-c
2025-09-25std.mem: add cutLast and cutScalarLastAndrew Kelley
2025-09-25std.mem: rename all "index of" functionsAndrew Kelley
Moving towards our function naming convention of having one word per concept and constructing function names out of concatenated concepts. In `std.mem` the concepts are: * "find" - return index of substring * "pos" - starting index parameter * "last" - search from the end * "linear" - simple for loop rather than fancy algo * "scalar" - substring is a single element
2025-09-25std.mem: add cut and cutScalar and example usageAndrew Kelley
2025-09-25std.mem: rename chomp to cutAndrew Kelley
2025-09-25std.mem: introduce chompPrefix and chompSuffixAndrew Kelley
2025-09-25implement review suggestionsLoris Cro
2025-09-25std.Thread: disable test on armeb in addition to thumbebAlex Rønne Petersen
Same falky failure on both. See ed7ff0b693037078f451a7c6c1124611060f4892.
2025-09-24zig fmtAndrew Kelley
2025-09-24std.Build.Cache: clarify parameter is sub path, not basenameAndrew Kelley
2025-09-24move translate-c helpersAndrew Kelley
2025-09-25Merge pull request #25231 from taylordotfish/bugfix/ppc-restore_rtAlex Rønne Petersen
Fix `restore_rt` on PowerPC and remove unnecessary clobbers
2025-09-24optimize std.mem.swaprpkak
2025-09-24fuzzing: implement limited fuzzingLoris Cro
Adds the limit option to `--fuzz=[limit]`. the limit expresses a number of iterations that *each fuzz test* will perform at maximum before exiting. The limit argument supports also 'K', 'M', and 'G' suffixeds (e.g. '10K'). Does not imply `--web-ui` (like unlimited fuzzing does) and prints a fuzzing report at the end. Closes #22900 but does not implement the time based limit, as after internal discussions we concluded to be problematic to both implement and use correctly.
2025-09-23Don't specify clobbers in `restore_rt`taylor.fish
Per @alexrp, this is unnecessary in naked functions.
2025-09-23Fix PowerPC `restore_rt`taylor.fish
Clang fails to compile the CBE translation of this code ("non-ASM statement in naked function"). Similar to the implementations of `restore_rt` on x86 and ARM, when the CBE is in use, this commit employs alternative inline assembly that avoids using non-immediate input operands.
2025-09-24std: always allow spawning processes when an env map is explicitly provided ↵Carter Snook
(#25092) In a library, the two `builtin.link_libc` and `builtin.output_mode == .Exe` checks could both be false. Thus, you would get a compile error even if you specified an `env_map` at runtime. This change turns the compile error into a runtime panic and updates the documentation to reflect the runtime requirement.
2025-09-24use copy_file_range syscall on linuxrpkak
2025-09-24Fix PowerPC syscalls causing invalid code from CBEtaylor.fish
Fixes #25209. On PowerPC, some registers are both inputs to syscalls and clobbered by them. An example is r0, which initially contains the syscall number, but may be overwritten during execution of the syscall. musl and glibc use a `+` (read-write) constraint to indicate this, which isn't supported in Zig. The current implementation of PowerPC syscalls in the Zig standard library instead lists these registers as both inputs and clobbers, but this results in the C backend generating code that is invalid for at least some C compilers, like GCC, which doesn't support the specifying the same register as both an input and a clobber. This PR changes the PowerPC syscall functions to list such registers as inputs and outputs rather than inputs and clobbers. Thanks to jacobly0 who pointed out that it's possible to have multiple outputs; I had gotten the wrong idea from the documentation.
2025-09-23forbid trivial local address returned from functions (#25333)Andrew Kelley
progress towards #25312
2025-09-22std.pie: fix register constraint in getDynamicSymbol() for s390x (#25327)Alex Rønne Petersen
If the compiler happens to pick `ret = r0`, then this will assemble to `ag r0, 0` which is obviously not what we want. Using `a` instead of `r` will ensure that we get an appropriate address register, i.e. `r1` through `r15`. Re-enable pie_linux for s390x-linux which was disabled in ed7ff0b693037078f451a7c6c1124611060f4892.
2025-09-22Merge pull request #25324 from alexrp/freebsdAlex Rønne Petersen
Some changes to prepare for FreeBSD CI
2025-09-22std.posix: remove bogus assert that SIGRTMAX < NSIGalexrp
2025-09-21Elf2: create a new linker from scratchJacob Young
This iteration already has significantly better incremental support. Closes #24110
2025-09-21Merge pull request #25302 from ziglang/growCapacityAndrew Kelley
std: remove loop from growCapacity
2025-09-20allow some test cases to regressAndrew Kelley
tracked by #24061 - these should be re-enabled once that is solved.
2025-09-20coerce vectors to arrays rather than inline forAndrew Kelley
2025-09-20frontend: replace elem_val_node with elem_ptr_loadAndrew Kelley
avoids unnecessary copies
2025-09-20std.Progress: avoid problematic catch syntaxAndrew Kelley
2025-09-20frontend: replace field_val and field_val_namedAndrew Kelley
with field_ptr_load and field_ptr_named_load. These avoid doing by-val load operations for structs that are runtime-known while keeping the previous semantics for comptime-known values.
2025-09-20std.zon.parse: fix not initializing array sentinelAndrew Kelley
2025-09-20compiler: require comptime vector indexesAndrew Kelley
2025-09-20Reader.defaultReadVec: Workaround bad `r.end += r.vtable.stream()` behaviorRyan Liptak
If `r.end` is updated in the `stream` implementation, then it's possible that `r.end += ...` will behave unexpectedly. What seems to happen is that it reverts back to its value before the function call and then the increment happens. Here's a reproduction: ```zig test "fill when stream modifies `end` and returns 0" { var buf: [3]u8 = undefined; var zero_reader = infiniteZeroes(&buf); _ = try zero_reader.fill(1); try std.testing.expectEqual(buf.len, zero_reader.end); } pub fn infiniteZeroes(buf: []u8) std.Io.Reader { return .{ .vtable = &.{ .stream = stream, }, .buffer = buf, .end = 0, .seek = 0, }; } fn stream(r: *std.Io.Reader, _: *std.Io.Writer, _: std.Io.Limit) std.Io.Reader.StreamError!usize { @memset(r.buffer[r.seek..], 0); r.end = r.buffer.len; return 0; } ``` When `fill` is called, it will call into `vtable.readVec` which in this case is `defaultReadVec`. In `defaultReadVec`: - Before the `r.end += r.vtable.stream` line, `r.end` will be 0 - In `r.vtable.stream`, `r.end` is modified to 3 and it returns 0 - After the `r.end += r.vtable.stream` line, `r.end` will be 0 instead of the expected 3 Separating the `r.end += stream();` into two lines fixes the problem (and this separation is done elsewhere in `Reader` so it seems possible that this class of bug has been encountered before). Potentially related issues: - https://github.com/ziglang/zig/issues/4021 - https://github.com/ziglang/zig/issues/12064