std.debug: fix SelfInfo default for freestanding ELF targets

This commit is contained in:
Alex Rønne Petersen 2025-10-09 19:03:08 +02:00
parent 6c760d76b9
commit 98f0bf9b67
No known key found for this signature in database

View File

@ -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,