zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit e39b82bf4e7346ada67a0fd49c480db1c6e12260 (tree)
parent feb05a716d1ae105cf0e8f9966b6ade7f32dc680
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Sat, 25 Oct 2025 10:34:48 +0200

compiler: avoid using self-hosted backend on x86_64-solaris/illumos

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

Diffstat:
Msrc/target.zig | 4++++
Mtest/src/ErrorTrace.zig | 2+-
Mtest/src/StackTrace.zig | 2+-
Mtest/tests.zig | 2+-
4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/target.zig b/src/target.zig @@ -257,6 +257,10 @@ pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.builtin.C 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) { + if (target.os.tag.isSolarish()) { + // https://github.com/ziglang/zig/issues/25699 + return false; + } if (target.os.tag.isBSD()) { // Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341 return false; diff --git a/test/src/ErrorTrace.zig b/test/src/ErrorTrace.zig @@ -41,7 +41,7 @@ pub fn addCase(self: *ErrorTrace, case: Case) void { fn shouldTestNonLlvm(target: *const std.Target) bool { return switch (target.cpu.arch) { .x86_64 => switch (target.ofmt) { - .elf => !target.os.tag.isBSD(), + .elf => !target.os.tag.isBSD() and !target.os.tag.isSolarish(), else => false, }, else => false, diff --git a/test/src/StackTrace.zig b/test/src/StackTrace.zig @@ -46,7 +46,7 @@ fn addCaseTarget( ) void { const both_backends = switch (target.result.cpu.arch) { .x86_64 => switch (target.result.ofmt) { - .elf => !target.result.os.tag.isBSD(), + .elf => !target.result.os.tag.isBSD() and !target.result.os.tag.isSolarish(), else => false, }, else => false, diff --git a/test/tests.zig b/test/tests.zig @@ -2493,7 +2493,7 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt const cpu_arch = query.cpu_arch orelse builtin.cpu.arch; const os_tag = query.os_tag orelse builtin.os.tag; switch (cpu_arch) { - .x86_64 => if (os_tag.isBSD() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true, + .x86_64 => if (os_tag.isBSD() or os_tag.isSolarish() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true, .spirv32, .spirv64 => return false, else => return true, }