aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2025-09-24resinator: fix compile errorsAndrew Kelley
2025-09-24update aro & translate-cVeikka Tuominen
2025-09-24aro: updateAndrew Kelley
This is f5fb720a5399ee98e45f36337b2f68a4d23a783c plus ehaas's nonnull attribute pull request currently at 4b26cb3ac610a0a070fc43e43da8b4cdf0e9101b with zig patches intact.
2025-09-24zig fmtAndrew Kelley
2025-09-24aro: fix dep file logicAndrew Kelley
also add ability to omit main source file from dep file as it messes up caching strategy
2025-09-24std.Build.Cache: clarify parameter is sub path, not basenameAndrew Kelley
2025-09-24translate-c: update for array list defaultsAndrew Kelley
2025-09-24fix rebase conflictsAndrew Kelley
2025-09-24aro: avoid BoundedArrayAndrew Kelley
2025-09-24update aro and translate-c sourcesVeikka Tuominen
2025-09-24resinator: Update for latest aroRyan Liptak
2025-09-24simplify diagnosticsAndrew Kelley
2025-09-24delete enough aro to make it compileAndrew Kelley
2025-09-24move translate-c helpersAndrew Kelley
2025-09-24compiler: update aro and translate-c to latest; delete clang translate-cAndrew 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-24glibc: guard inet-fortified.hKyle Schwarz
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
2025-09-20std.json: delete test tightly coupled to ArrayList growthAndrew Kelley
This test works by assuming that std.ArrayList will grow with a specific capacity increasing pattern, which is an invalid assumption. Delete the offending test.
2025-09-20std: remove loop from growCapacityAndrew Kelley
I measured this against master branch and found no statistical difference. Since this code is simpler and logically superior due to always leaving sufficient unused capacity when growing, it is preferred over status quo.
2025-09-20Merge pull request #25298 from ziglang/SegmentedList-orphaned-againAndrew Kelley
std: delete SegmentedList again
2025-09-20std.c: add MSG support for dragonflyJohn Benediktsson
2025-09-20std.crypto.ascon: disable Ascon-AEAD128 test on RISC-V with V supportAlex Rønne Petersen
2025-09-20std.c: adjust shm_open to be variadic on darwinJohn Benediktsson
2025-09-19std.Build.Step.Run: Enable passing (generated) file content as argsJustus Klausecker
Adds `addFileContentArg` and `addPrefixedFileContentArg` to pass the content of a file with a lazy path as an argument to a `std.Build.Step.Run`. This enables replicating shell `$()` / cmake `execute_process` with `OUTPUT_VARIABLE` as an input to another `execute_process` in conjuction with `captureStdOut`/`captureStdErr`. To also be able to replicate `$()` automatically trimming trailing newlines and cmake `OUTPUT_STRIP_TRAILING_WHITESPACE`, this patch adds an `options` arg to those functions which allows specifying the desired handling of surrounding whitespace. The `options` arg also allows to specify a custom `basename` for the output. e.g. to add a file extension (concrete use case: Zig `@import()` requires files to have a `.zig`/`.zon` extension to recognize them as valid source files).
2025-09-19std: delete SegmentedList againAndrew Kelley
The data structure was originally added in 41e1cd185b82a518c58c92544c45f0348c03ef74 and then removed in 50a336fff899ebd8a687c453ec6beb18a5a9baf9, but brought back in 711bf55eaa643c3d05640bebbf3e4315477b8ed8 for Decl in the compiler frontend, and then the last reference to it was eliminated in 548a087fafeda5b07d2237d5137906b8d07da699 which removed Decl in favor of Nav and Cau.
2025-09-19Merge pull request #23416 from gooncreeper/improved-fuzzerAndrew Kelley
greatly improve capabilities of the fuzzer
2025-09-19Merge pull request #25268 from alexrp/loongarchAlex Rønne Petersen
Miscellaneous LoongArch work to prepare for CI
2025-09-18Remove usages of deprecatedWriterandrewkraevskii
2025-09-19std.fmt: migrate bufPrintZ to bufPrintSentinel (#25260)John Benediktsson