Alex Rønne Petersen
9cd37a0696
std.debug.Dwarf: use 66 as the (fake) MIPS PC register
...
32-63 conflict with the floating point registers. 64 and 65 are used for the
ac0 hi/lo registers.
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
f6403ed5ea
std.debug.Dwarf: use 67 as the (fake) PowerPC PC register
...
It's free real estate, as it turns out.
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
feba8a83a7
std.debug.Dwarf: use 65 as the (fake) RISC-V PC register
...
32-63 conflict with the floating point registers. 64 is the Alternate Frame
Return Column.
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
9a6fad2706
std.debug.Dwarf: use 64 as the (fake) LoongArch PC register
...
32-63 conflict with the floating point registers.
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
aa74eb505a
std.debug: add unwind support for powerpc*-linux
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
ca73d697b9
std.debug: add unwind support for mips*-linux
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
a5a9ffb90b
std.debug.cpu_context: check for architecture, i.e. register size, not bitness
...
We care about the hardware here, not the ABI.
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
081d6d12a1
std.debug.Dwarf.SelfUnwinder: add an s390x check missed in 95bdb0c1c65c128923ffac3f4be6b4619eb4a54b
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
fdd109420d
std.debug: add noinline to functions that capture the current stack trace
...
Fixes stack traces missing a frame depending on inlining decisions.
ref https://github.com/ziglang/zig/issues/25418
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
0b33891f4c
std.os.linux: add ucontext_t and mcontext_t for mips/mips64
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
98af7f34e9
std.os.linux: minor NFC corrections to hexagon ucontext_t and mcontext_t
2025-10-07 16:47:57 +02:00
Alex Rønne Petersen
9760068826
std.debug: prefer FP unwinding on targets where it is ideal
...
If the ABI requires a backchain pointer, FP unwinding is always possible, safe,
and fast, so there's really no reason not to use it.
2025-10-07 16:44:25 +02:00
Jacob Young
d28006153e
llvm.Builder: allow Metadata to reference metadata strings
...
Closes #25486
2025-10-07 07:49:54 -04:00
Alex Rønne Petersen
c23a5ccd19
std.debug.Dwarf.SelfUnwinder: skip caching rules for unsupported registers
...
For unwinding purposes, we don't care about unsupported registers. Yet because
we added these rules to the cache entry, we'd later try to evaluate them and
thus fail the unwind attempt for no good reason. They'd also take up cache rule
slots that would be better spent on actually relevant registers.
Note that any attempt to read unsupported registers during unwinding will still
fail the unwind attempt as expected.
2025-10-07 09:28:43 +02:00
Andrew Kelley
6893e7feee
Merge pull request #25414 from squeek502/mingw-def-implib
...
Support generating import libraries from mingw .def files without LLVM
2025-10-06 13:38:07 -07:00
Alex Rønne Petersen
2962db333f
Merge pull request #25480 from alexrp/std-debug-hexagon
...
`std.debug`: add unwind support for `hexagon-linux`
2025-10-06 11:10:02 +02:00
xdBronch
ea9fb3ccfa
fix read of undefined in http tests
2025-10-06 06:54:52 +02:00
Alex Rønne Petersen
7c87691a61
Merge pull request #25479 from alexrp/qemu-os-checks
...
`std.zig.system`: add OS checks for QEMU in `getExternalExecutor()`
2025-10-06 06:11:06 +02:00
Alex Rønne Petersen
ddc815e3d8
drop support for powerpc64 ELF v1
...
* 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-06 01:28:56 +02:00
Alex Rønne Petersen
9e61a64033
std.zig.system: add OS checks for QEMU in getExternalExecutor()
...
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-05 23:33:12 +02:00
Alex Rønne Petersen
a5ff376b8f
std.debug: add unwind support for hexagon-linux
2025-10-05 20:09:26 +02:00
Alex Rønne Petersen
26403fe3f9
std.os.linux: add mcontext_t and ucontext_t for hexagon
2025-10-05 20:08:55 +02:00
Alex Rønne Petersen
5969d6180f
std.zig.system: handle or1k in getExternalExecutor()
2025-10-05 17:06:41 +02:00
Ryan Liptak
0a74d73459
Merge pull request #25320 from hkupty/walker2
...
std.fs.Dir: Add `walkSelectively` to provide more control over directory walking
2025-10-04 22:41:25 -07:00
Alex Rønne Petersen
e6e4792a58
std.debug: completely disable FP-based unwinding on mips
2025-10-05 07:18:50 +02:00
Alex Rønne Petersen
30f5258fe6
std.debug.SelfInfo.Elf: disable unwinding on mips n32 and x86 x32
...
The DWARF code can't handle these yet.
ref https://github.com/ziglang/zig/issues/25447
2025-10-05 07:18:50 +02:00
Alex Rønne Petersen
73602f2a13
std.Target: baseline model for s390x-zos should be arch10, not arch8
2025-10-05 00:23:51 +02:00
rpkak
b5ec75b7e7
make freebsd copy_file_range return type signed
2025-10-04 11:46:20 +02:00
Alex Rønne Petersen
b54bdace75
Merge pull request #25457 from linusg/more-serenity
...
std.debug: Add unwind support for serenity
2025-10-04 07:09:59 +02:00
David Rubin
e932ab003f
correct ed25519 test case ( #25445 )
2025-10-04 02:31:02 +00:00
Ryan Liptak
900315a3f3
std.coff: Fix size of ImportHeader.types
2025-10-03 18:26:05 -07:00
Alex Rønne Petersen
9dbfa5b294
std.debug: consider FP-based unwinding on hexagon and powerpc safe
...
The ABIs make this safe and reliable due to their backchain requirements.
2025-10-04 03:22:40 +02:00
Alex Rønne Petersen
d8268fac98
std.debug: fix FP-based unwinding on powerpc64
...
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-04 03:03:54 +02:00
Ryan Liptak
b382119c02
std.coff: Set default values for ImportHeader sig1/sig2 fields
...
Just makes this a bit nicer to work with since those fields only have 1 intended value.
2025-10-03 17:44:36 -07:00
Ryan Liptak
a974198b94
std.coff: Add sizeOf function to WeakExternalDefinition
...
Convenience function similar in nature to Symbol.sizeOf
2025-10-03 17:44:36 -07:00
Ryan Liptak
78e07b8fc8
std.coff: Fix SectionHeader.setAlignment (off by 1)
...
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-03 17:44:36 -07:00
Ryan Liptak
894a991714
Add depth function to Walker.Entry
...
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-03 16:29:09 -07:00
Ryan Liptak
98dd8856ef
std.mem: Add countScalar
2025-10-03 16:29:09 -07:00
Henry Kupty
7bee39c1fd
test: enter after check to preserve depth
2025-10-03 16:29:08 -07:00
Henry Kupty
a26a654c55
test: Include expected depth test
2025-10-03 16:29:08 -07:00
Henry Kupty
df394faf77
feat: Reintroduce depth
...
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-03 16:29:08 -07:00
Ryan Liptak
760127a760
Add SelectiveWalker/walkSelectively and implement Walker in terms of it
...
This is a breaking change, since the fields of Walker have changed. The function APIs are unchanged, though.
2025-10-03 16:29:08 -07:00
Linus Groh
b0f280f4a4
std.debug: Add unwind support for serenity
2025-10-03 22:59:40 +01:00
Linus Groh
a76851b2ef
std.c: Also make Sigaction flags a c_uint for serenity
...
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-03 22:19:25 +01:00
Linus Groh
701a6f394c
std.c: Add missing SIG constants for serenity
2025-10-03 22:15:38 +01:00
Jacob Young
12ed0ff1ef
Merge pull request #25430 from jacobly0/x86_64-win
...
Coff2: create a new linker from scratch
2025-10-03 05:03:44 -04:00
Alex Rønne Petersen
95bdb0c1c6
std.debug.Dwarf.SelfUnwinder: default some s390x registers to the same-value rule
2025-10-03 03:45:52 +02:00
Alex Rønne Petersen
8263f55ab2
std.debug: add s390x-linux unwind support
2025-10-03 03:29:20 +02:00
Alex Rønne Petersen
006bc5a8ca
std.os.linux: improve the s390x mcontext_t definition
...
The old one was correct in terms of layout but very user-hostile.
2025-10-03 03:29:20 +02:00
Alex Rønne Petersen
0f56d7afe2
std.debug: use correct return address offset for s390x
...
Makes FP-based unwinding work.
2025-10-03 03:29:20 +02:00