aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2025-10-06drop support for powerpc64 ELF v1Alex Rønne Petersen
* ELF v1 on powerpc64 is only barely kept on life support in a couple of Linux distros. I don't anticipate that this will last much longer. * Most of the Linux world has moved to powerpc64le which requires ELF v2. * Some Linux distros have even started supporting powerpc64 with ELF v2. * The BSD world has long since moved to ELF v2. * We have no actual linking support for ELF v1. * ELF v1 had confused DWARF register mappings which is becoming a problem in our DWARF code in std.debug. It's clear that ELF v1 is on its way out, and we never fully supported it anyway. So let's not waste any time or energy on it going forward. closes #5927
2025-10-05std.zig.system: add OS checks for QEMU in getExternalExecutor()Alex Rønne Petersen
FreeBSD doesn't support the same number of platforms as Linux, and even then, only has usermode emulation for a subset of its supported platforms. NetBSD's usermode emulation support is apparently just broken at the moment.
2025-10-05std.debug: add unwind support for hexagon-linuxAlex Rønne Petersen
2025-10-05std.os.linux: add mcontext_t and ucontext_t for hexagonAlex Rønne Petersen
2025-10-05std.zig.system: handle or1k in getExternalExecutor()Alex Rønne Petersen
2025-10-04Merge pull request #25320 from hkupty/walker2Ryan Liptak
std.fs.Dir: Add `walkSelectively` to provide more control over directory walking
2025-10-05std.debug: completely disable FP-based unwinding on mipsAlex Rønne Petersen
2025-10-05std.debug.SelfInfo.Elf: disable unwinding on mips n32 and x86 x32Alex Rønne Petersen
The DWARF code can't handle these yet. ref https://github.com/ziglang/zig/issues/25447
2025-10-05std.Target: baseline model for s390x-zos should be arch10, not arch8Alex Rønne Petersen
2025-10-04make freebsd copy_file_range return type signedrpkak
2025-10-04Merge pull request #25457 from linusg/more-serenityAlex Rønne Petersen
std.debug: Add unwind support for serenity
2025-10-04correct ed25519 test case (#25445)David Rubin
2025-10-03std.coff: Fix size of ImportHeader.typesRyan Liptak
2025-10-04std.debug: consider FP-based unwinding on hexagon and powerpc safeAlex Rønne Petersen
The ABIs make this safe and reliable due to their backchain requirements.
2025-10-04std.debug: fix FP-based unwinding on powerpc64Alex Rønne Petersen
This just needs to do the same thing as powerpc64le. Note that the saved LR is at the same position in both ELF v1 and v2.
2025-10-03std.coff: Set default values for ImportHeader sig1/sig2 fieldsRyan Liptak
Just makes this a bit nicer to work with since those fields only have 1 intended value.
2025-10-03std.coff: Add sizeOf function to WeakExternalDefinitionRyan Liptak
Convenience function similar in nature to Symbol.sizeOf
2025-10-03std.coff: Fix SectionHeader.setAlignment (off by 1)Ryan Liptak
Previously, `setAlignment` would set the value to 1 fewer than it should, so if you were intending to set alignment to 8 bytes, it would actually set it to 4 bytes, etc.
2025-10-03Add depth function to `Walker.Entry`Ryan Liptak
This enables depth-related use cases without any dependency on the Walker's internal stack which doesn't always pertain to the actual depth of the current entry (i.e. recursing into a directory immediately affects the stack).
2025-10-03std.mem: Add `countScalar`Ryan Liptak
2025-10-03test: enter after check to preserve depthHenry Kupty
2025-10-03test: Include expected depth testHenry Kupty
2025-10-03feat: Reintroduce depthHenry Kupty
Some decision-making might depend on the level of the traversal, so it makes sense to expose depth here since it's stable, and not in the automatic walker where it's not.
2025-10-03Add SelectiveWalker/walkSelectively and implement Walker in terms of itRyan Liptak
This is a breaking change, since the fields of Walker have changed. The function APIs are unchanged, though.
2025-10-03std.debug: Add unwind support for serenityLinus Groh
2025-10-03std.c: Also make Sigaction flags a c_uint for serenityLinus Groh
This matches all other platforms. Even if this field is defined as 'int' in the C definition, the expectation is that the full 32-bit unsigned integer range can be used. In particular this Sigaction initializer in the new std.debug code was causing a build failure: ```zig .flags = (posix.SA.SIGINFO | posix.SA.RESTART | posix.SA.RESETHAND) ```
2025-10-03std.c: Add missing SIG constants for serenityLinus Groh
2025-10-03Merge pull request #25430 from jacobly0/x86_64-winJacob Young
Coff2: create a new linker from scratch
2025-10-03std.debug.Dwarf.SelfUnwinder: default some s390x registers to the same-value ↵Alex Rønne Petersen
rule
2025-10-03std.debug: add s390x-linux unwind supportAlex Rønne Petersen
2025-10-03std.os.linux: improve the s390x mcontext_t definitionAlex Rønne Petersen
The old one was correct in terms of layout but very user-hostile.
2025-10-03std.debug: use correct return address offset for s390xAlex Rønne Petersen
Makes FP-based unwinding work.
2025-10-02resinator: Update for std.coff changesRyan Liptak
2025-10-02Coff2: create a new linker from scratchJacob Young
2025-10-02std.debug.Dwarf.Unwind: deal with invalid def_cfa_reg by GNU toolchainsAlex Rønne Petersen
2025-10-01std.debug: add riscv32-linux and riscv64-linux unwind supportAlex Rønne Petersen
2025-10-01std.debug: add loongarch64-linux unwind supportAlex Rønne Petersen
2025-10-01std.debug: some adjustments to target handlingAlex Rønne Petersen
* driverkit handling missing in a few places. * x86-solaris is a dead target. * aarch64_be does not exist on Darwin, FreeBSD, Windows.
2025-10-01std.debug.SelfInfo: rename Darwin to MachOAlex Rønne Petersen
2025-10-01std.debug: don't use SelfInfo.Windows for UEFIAlex Rønne Petersen
It is, in fact, Windows-only.
2025-10-01std.debug: select SelfInfo using ObjectFormat.default()Alex Rønne Petersen
2025-10-01resinator: Sync with upstream, fix an alignment problemRyan Liptak
2025-09-30ArrayHashMapWithAllocator: add `sortUnstable` fn alongside `sort`Ryan Liptak
2025-09-30add deflate compression, simplify decompressionKendall Condon
Implements deflate compression from scratch. A history window is kept in the writer's buffer for matching and a chained hash table is used to find matches. Tokens are accumulated until a threshold is reached and then outputted as a block. Flush is used to indicate end of stream. Additionally, two other deflate writers are provided: * `Raw` writes only in store blocks (the uncompressed bytes). It utilizes data vectors to efficiently send block headers and data. * `Huffman` only performs Huffman compression on data and no matching. The above are also able to take advantage of writer semantics since they do not need to keep a history. Literal and distance code parameters in `token` have also been reworked. Their parameters are now derived mathematically, however the more expensive ones are still obtained through a lookup table (expect on ReleaseSmall). Decompression bit reading has been greatly simplified, taking advantage of the ability to peek on the underlying reader. Additionally, a few bugs with limit handling have been fixed.
2025-09-30std.debug.SelfInfo: remove shared logicmlugg
There were only a few dozen lines of common logic, and they frankly introduced more complexity than they eliminated. Instead, let's accept that the implementations of `SelfInfo` are all pretty different and want to track different state. This probably fixes some synchronization and memory bugs by simplifying a bunch of stuff. It also improves the DWARF unwind cache, making it around twice as fast in a debug build with the self-hosted x86_64 backend, because we no longer have to redundantly go through the hashmap lookup logic to find the module. Unwinding on Windows will also see a slight performance boost from this change, because `RtlVirtualUnwind` does not need to know the module whatsoever, so the old `SelfInfo` implementation was doing redundant work. Lastly, this makes it even easier to implement `SelfInfo` on freestanding targets; there is no longer a need to emulate a real module system, since the user controls the whole implementation! There are various other small refactors here in the `SelfInfo` implementations as well as in the DWARF unwinding logic. This change turned out to make a lot of stuff simpler!
2025-09-30Dwarf.Unwind: fix typomlugg
2025-09-30typomlugg
2025-09-30Dwarf.Unwind: handle macOS deviation from standardmlugg
Apparently the `__eh_frame` in Mach-O binaries doesn't include the terminator entry, but in all other respects it acts like `.eh_frame` rather than `.debug_frame`. I have no idea.
2025-09-30std.debug: significantly speed up capturing stack tracesmlugg
By my estimation, these changes speed up DWARF unwinding when using the self-hosted x86_64 backend by around 7x. There are two very significant enhancements: we no longer iterate frames which don't fit in the stack trace buffer, and we cache register rules (in a fixed buffer) to avoid re-parsing and evaluating CFI instructions in most cases. Alongside this are a bunch of smaller enhancements, such as pre-caching the result of evaluating the CIE's initial instructions, avoiding re-parsing of CIEs, and big simplifications to the `Dwarf.Unwind.VirtualMachine` logic.
2025-09-30cbe: workaround GCC miscompilationmlugg
This was causing a zig2 miscomp, which emitted slightly broken debug information, which caused extremely slow stack unwinding. We're working on fixing or reporting this upstream, but we can use this workaround for now, because GCC guarantees arithmetic signed shift.