authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-25 13:48:36+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-25 13:53:20+02:00
loga583d26e7016a6111c2d1f9dbe34aeedf810c63f
treefbefbf02dbdeb9445f3e6464634c5d4a270bba22
parent4044314e3f866277658e63f7a0a254041a78769b
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler: disable self-hosted backend for x86_64-macos by default

https://codeberg.org/ziglang/zig/issues/35267 This was already the case before b66fe565db650bbac17c7fd6559734f7d658f36d since isBSD() includes isDarwin() - a great example of why that function is bad, because it was not intended for Darwin platforms to be included in that check. Anyway, we now *do* want to disable the self-hosted backend for this target due to the aforementioned linker bug, but let's actually be intentional about it.

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

src/target.zig+2-1
......@@ -313,7 +313,8 @@ pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
313313 else => {},
314314 }
315315 return switch (target.ofmt) {
316 .elf, .macho => true,
316 .elf => true,
317 .macho => false, // https://codeberg.org/ziglang/zig/issues/35267
317318 else => false,
318319 };
319320 }
test/tests.zig+2-1
......@@ -3051,7 +3051,8 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
30513051 else => {},
30523052 }
30533053 return switch (ofmt) {
3054 .elf, .macho => return false,
3054 .elf => return false,
3055 .macho => return true, // https://codeberg.org/ziglang/zig/issues/35267
30553056 else => return true,
30563057 };
30573058 },