authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-07-06 14:32:06+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-07-06 19:50:29+02:00
log97ecb6c551eb628e5a37d18d5a9720d3714a04ef
treec58eef4dffd7014deb5f93b530ff9ce7d9c62aba
parentb461d07a5464aec86c533434dab0b58edfffb331

compiler: Disable self-hosted x86_64 backend on NetBSD

https://github.com/ziglang/zig/issues/24341

1 files changed, 10 insertions(+), 4 deletions(-)

src/target.zig+10-4
......@@ -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.
223223pub 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