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-22 01:37:32+02:00
log0700ec35bda705fccb61cb3f28734ce11166fda5
tree1cda0d7385705b69cd59e838584688a3b5607949
parent4d8dcccbd416ec49bcd681374c90bbe9a11ed5ca
signature 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
......@@ -238,7 +238,7 @@ pub fn hasLldSupport(ofmt: std.Target.ObjectFormat) bool {
238238pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
239239 if (target.cpu.arch.isSpirV()) return true;
240240 if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
241 if (target.os.tag == .netbsd or target.os.tag == .openbsd) {
241 if (target.os.tag.isBSD()) {
242242 // Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341
243243 return false;
244244 }
test/src/StackTrace.zig+1-1
......@@ -45,7 +45,7 @@ fn addCaseInner(self: *StackTrace, config: Config, use_llvm: bool) void {
4545fn shouldTestNonLlvm(target: *const std.Target) bool {
4646 return switch (target.cpu.arch) {
4747 .x86_64 => switch (target.ofmt) {
48 .elf => true,
48 .elf => !target.os.tag.isBSD(),
4949 else => false,
5050 },
5151 else => false,
test/tests.zig+2-1
......@@ -2451,8 +2451,9 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
24512451 else => return true,
24522452 }
24532453 const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
2454 const os_tag = query.os_tag orelse builtin.os.tag;
24542455 switch (cpu_arch) {
2455 .x86_64 => if (std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
2456 .x86_64 => if (os_tag.isBSD() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
24562457 .spirv32, .spirv64 => return false,
24572458 else => return true,
24582459 }