commit 98f0bf9b67abc0fc2f787df95c26c75dc6db3c88 (tree)
parent 6c760d76b93680dc6eb4e2afc22b7d6bc286e3ed
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Thu, 9 Oct 2025 19:03:08 +0200
std.debug: fix SelfInfo default for freestanding ELF targets
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
@@ -63,7 +63,10 @@ pub const SelfInfo = if (@hasDecl(root, "debug") and @hasDecl(root.debug, "SelfI
root.debug.SelfInfo
else switch (std.Target.ObjectFormat.default(native_os, native_arch)) {
.coff => if (native_os == .windows) @import("debug/SelfInfo/Windows.zig") else void,
- .elf => @import("debug/SelfInfo/Elf.zig"),
+ .elf => switch (native_os) {
+ .freestanding, .other => void,
+ else => @import("debug/SelfInfo/Elf.zig"),
+ },
.macho => @import("debug/SelfInfo/MachO.zig"),
.goff, .plan9, .spirv, .wasm, .xcoff => void,
.c, .hex, .raw => unreachable,