authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-21 08:47:21+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-24 01:11:42+02:00
loge526d65f5e11df3093cc2000611c9a6438f847fe
treeb059110e91ee28d43d9e71b50b612c5e75e21f5d
parent0e673fdab22eafa5099b21ec66c50ba491811ce7
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler: don't use self-hosted backend on any BSD yet

There are some blocking bugs in the self-hosted ELF linker.

3 files changed, 4 insertions(+), 3 deletions(-)

src/target.zig+1-1
......@@ -236,7 +236,7 @@ pub fn hasLldSupport(ofmt: std.Target.ObjectFormat) bool {
236236pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
237237 if (target.cpu.arch.isSpirV()) return true;
238238 if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
239 if (target.os.tag == .netbsd or target.os.tag == .openbsd) {
239 if (target.os.tag.isBSD()) {
240240 // Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341
241241 return false;
242242 }
test/src/StackTrace.zig+1-1
......@@ -44,7 +44,7 @@ fn addCaseInner(self: *StackTrace, config: Config, use_llvm: bool) void {
4444fn shouldTestNonLlvm(target: *const std.Target) bool {
4545 return switch (target.cpu.arch) {
4646 .x86_64 => switch (target.ofmt) {
47 .elf => true,
47 .elf => !target.os.tag.isBSD(),
4848 else => false,
4949 },
5050 else => false,
test/tests.zig+2-1
......@@ -2488,8 +2488,9 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
24882488 else => return true,
24892489 }
24902490 const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
2491 const os_tag = query.os_tag orelse builtin.os.tag;
24912492 switch (cpu_arch) {
2492 .x86_64 => if (std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
2493 .x86_64 => if (os_tag.isBSD() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
24932494 .spirv32, .spirv64 => return false,
24942495 else => return true,
24952496 }