authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-25 10:34:48+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-25 12:44:13+02:00
loge39b82bf4e7346ada67a0fd49c480db1c6e12260
tree631cc7115e1e1a84571d998dc72322acbf97bd73
parentfeb05a716d1ae105cf0e8f9966b6ade7f32dc680
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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

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

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

src/target.zig+4
......@@ -257,6 +257,10 @@ pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.builtin.C
257257pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
258258 if (target.cpu.arch.isSpirV()) return true;
259259 if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
260 if (target.os.tag.isSolarish()) {
261 // https://github.com/ziglang/zig/issues/25699
262 return false;
263 }
260264 if (target.os.tag.isBSD()) {
261265 // Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341
262266 return false;
test/src/ErrorTrace.zig+1-1
......@@ -41,7 +41,7 @@ pub fn addCase(self: *ErrorTrace, case: Case) void {
4141fn shouldTestNonLlvm(target: *const std.Target) bool {
4242 return switch (target.cpu.arch) {
4343 .x86_64 => switch (target.ofmt) {
44 .elf => !target.os.tag.isBSD(),
44 .elf => !target.os.tag.isBSD() and !target.os.tag.isSolarish(),
4545 else => false,
4646 },
4747 else => false,
test/src/StackTrace.zig+1-1
......@@ -46,7 +46,7 @@ fn addCaseTarget(
4646) void {
4747 const both_backends = switch (target.result.cpu.arch) {
4848 .x86_64 => switch (target.result.ofmt) {
49 .elf => !target.result.os.tag.isBSD(),
49 .elf => !target.result.os.tag.isBSD() and !target.result.os.tag.isSolarish(),
5050 else => false,
5151 },
5252 else => false,
test/tests.zig+1-1
......@@ -2493,7 +2493,7 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
24932493 const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
24942494 const os_tag = query.os_tag orelse builtin.os.tag;
24952495 switch (cpu_arch) {
2496 .x86_64 => if (os_tag.isBSD() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
2496 .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,
24972497 .spirv32, .spirv64 => return false,
24982498 else => return true,
24992499 }