From 97ecb6c551eb628e5a37d18d5a9720d3714a04ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 6 Jul 2025 14:32:06 +0200 Subject: [PATCH] compiler: Disable self-hosted x86_64 backend on NetBSD https://github.com/ziglang/zig/issues/24341 --- src/target.zig | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/target.zig b/src/target.zig index d57e1e4adb..28cdf3e3aa 100644 --- a/src/target.zig +++ b/src/target.zig @@ -222,10 +222,16 @@ pub fn hasLldSupport(ofmt: std.Target.ObjectFormat) bool { /// than or equal to the number of behavior tests as the respective LLVM backend. pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool { if (target.cpu.arch.isSpirV()) return true; - if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) return switch (target.ofmt) { - .elf, .macho => true, - else => false, - }; + if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) { + if (target.os.tag == .netbsd) { + // Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341 + return false; + } + return switch (target.ofmt) { + .elf, .macho => true, + else => false, + }; + } return false; }