Skip to content

Commit 97ecb6c

Browse files
committed
compiler: Disable self-hosted x86_64 backend on NetBSD
#24341
1 parent b461d07 commit 97ecb6c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/target.zig

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,16 @@ pub fn hasLldSupport(ofmt: std.Target.ObjectFormat) bool {
222222
/// than or equal to the number of behavior tests as the respective LLVM backend.
223223
pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
224224
if (target.cpu.arch.isSpirV()) return true;
225-
if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) return switch (target.ofmt) {
226-
.elf, .macho => true,
227-
else => false,
228-
};
225+
if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
226+
if (target.os.tag == .netbsd) {
227+
// Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341
228+
return false;
229+
}
230+
return switch (target.ofmt) {
231+
.elf, .macho => true,
232+
else => false,
233+
};
234+
}
229235
return false;
230236
}
231237

0 commit comments

Comments
 (0)