Skip to content

Commit 98f0bf9

Browse files
committed
std.debug: fix SelfInfo default for freestanding ELF targets
1 parent 6c760d7 commit 98f0bf9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/std/debug.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ pub const SelfInfo = if (@hasDecl(root, "debug") and @hasDecl(root.debug, "SelfI
6363
root.debug.SelfInfo
6464
else switch (std.Target.ObjectFormat.default(native_os, native_arch)) {
6565
.coff => if (native_os == .windows) @import("debug/SelfInfo/Windows.zig") else void,
66-
.elf => @import("debug/SelfInfo/Elf.zig"),
66+
.elf => switch (native_os) {
67+
.freestanding, .other => void,
68+
else => @import("debug/SelfInfo/Elf.zig"),
69+
},
6770
.macho => @import("debug/SelfInfo/MachO.zig"),
6871
.goff, .plan9, .spirv, .wasm, .xcoff => void,
6972
.c, .hex, .raw => unreachable,

0 commit comments

Comments
 (0)