From daf46381a684407cf57685264354d07eeeef99a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 16 Oct 2026 21:36:10 +0200 Subject: [PATCH 01/17] std.c: fix max_align_t for 32-bit x86 Compiler headers use __alignof__ on this field which is 8 rather than 4. --- lib/std/c.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index e4d123965d586f5fff53e680246a5f310ff33456..6969f4df8a4b1f3be8daf11923312c2f9a7c8a52 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -11294,7 +11294,7 @@ else if (native_os.isDarwin()) c_longdouble else extern struct { - a: c_longlong, + a: c_longlong align(if (native_arch == .x86) 8 else @alignOf(c_longlong)), b: c_longdouble, }; -- 2.54.0 From beac4e6ab13d0f5224d38f8b565318d5a16f9a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 16 Oct 2026 22:05:20 +0200 Subject: [PATCH 02/17] std.Target: fix cTypeByteSize(.longdouble) when cTypeBitSize(.longdouble) == 32 This occurs on AVR. --- lib/std/Target.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 00b99fb38a3347589dbc34f073130dbd51b9dff9..5ca03f1381190fc8d70ea05470f0f1299f5b8c1a 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3204,6 +3204,7 @@ pub fn cTypeByteSize(t: *const Target, c_type: CType) ?u16 { => @divExact(cTypeBitSize(t, c_type) orelse return null, 8), .longdouble => switch (cTypeBitSize(t, c_type) orelse return null) { + 32 => 4, 64 => 8, 80 => @intCast(std.mem.alignForward(usize, 10, cTypeAlignment(t, c_type).?)), 128 => 16, -- 2.54.0 From 7c58d118e775a44eaf7db2ca4350116b1c38ff6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 16 Oct 2026 22:06:26 +0200 Subject: [PATCH 03/17] std.Target: fix cTypeAlignment(.{longlong,double,longdouble}) on xtensa --- lib/std/Target.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 5ca03f1381190fc8d70ea05470f0f1299f5b8c1a..bd33e78c4d088f5ea5415c51299d5cbb37be012a 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3609,8 +3609,6 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) ?u16 { .sheb, .x86, .xcore, - .xtensa, - .xtensaeb, => 4, .amdgcn, @@ -3631,6 +3629,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) ?u16 { .sparc, .thumb, .thumbeb, + .xtensa, + .xtensaeb, => 8, .aarch64, -- 2.54.0 From 79413e38e8864af547ce4e6cc9ba9e7005f9d872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 16 Oct 2026 22:16:25 +0200 Subject: [PATCH 04/17] std.Target: fix cTypeBitSize(.longdouble) to be 128 on 32-bit sparc too This changed in Clang 22. --- lib/std/Target.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index bd33e78c4d088f5ea5415c51299d5cbb37be012a..20eabbc26f7c9426d13bab33f3089de54def9f7f 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3286,6 +3286,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .powerpc64, .powerpc64le, .s390x, + .sparc, .sparc64, .wasm32, .wasm64, @@ -3387,6 +3388,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .s390x, .mips64, .mips64el, + .sparc, .sparc64, .wasm32, .wasm64, -- 2.54.0 From b75d35631ca813ac0ce1653ec281a85abd419ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 02:52:53 +0200 Subject: [PATCH 05/17] std.Target: align cTypeBitSize() for GPU targets with C rather than OpenCL C --- lib/std/Target.zig | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 20eabbc26f7c9426d13bab33f3089de54def9f7f..d0aa85a9664111fa70251bbf329bd9000ffa0a8a 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3460,37 +3460,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { }, }, - .nvcl, .cuda => switch (c_type) { + .cuda, .amdhsa, .amdpal, .mesa3d, .nvcl, .opencl, .vulkan => switch (c_type) { .char => 8, .short, .ushort => 16, .int, .uint, .float => 32, - .long, .ulong => switch (target.cpu.arch) { - .nvptx => 32, - .nvptx64 => 64, - else => 64, - }, - .longlong, .ulonglong, .double => 64, - .longdouble => 64, + .long, .ulong => target.ptrBitWidth(), + .longlong, .ulonglong, .double, .longdouble => 64, }, - .amdhsa, .amdpal, .mesa3d => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float => 32, - .long, .ulong, .longlong, .ulonglong, .double => 64, - .longdouble => 128, - }, - - .opencl, .vulkan => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float => 32, - .long, .ulong, .double => 64, - .longlong, .ulonglong => 128, - // Note: The OpenCL specification does not guarantee a particular size for long double, - // but clang uses 128 bits. - .longdouble => 128, - }, .@"3ds" => switch (c_type) { .char => 8, -- 2.54.0 From 85c6d40cbdadfdb57feba90af128f380c3d07836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 02:54:33 +0200 Subject: [PATCH 06/17] std.Target: merge some Nintendo console prongs in cTypeBitSize() --- lib/std/Target.zig | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index d0aa85a9664111fa70251bbf329bd9000ffa0a8a..dce4d36097edecda836b546031be1ba00d63212f 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3468,21 +3468,12 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .longlong, .ulonglong, .double, .longdouble => 64, }, - - .@"3ds" => switch (c_type) { + .gba, .@"3ds", .wiiu => switch (c_type) { .char => 8, .short, .ushort => 16, .int, .uint, .float, .long, .ulong => 32, .longlong, .ulonglong, .double, .longdouble => 64, }, - - .wiiu => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float, .long, .ulong => 32, - .longlong, .ulonglong, .double, .longdouble => 64, - }, - .@"switch" => switch (c_type) { .char => 8, .short, .ushort => 16, @@ -3491,13 +3482,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .longdouble => 128, }, - .gba => switch (c_type) { - .char => return 8, - .short, .ushort => return 16, - .int, .uint, .long, .ulong, .float => return 32, - .longlong, .ulonglong, .double, .longdouble => return 64, - }, - .psx => switch (c_type) { .char => 8, .short, .ushort => 16, @@ -3519,6 +3503,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .long, .ulong => 64, .longlong, .ulonglong, .double, .longdouble => 64, }, + .tios => switch (c_type) { .char => 8, .short, .ushort => 16, -- 2.54.0 From 534105d83aded6904f0f9a535d1e28c3a63570d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 02:58:48 +0200 Subject: [PATCH 07/17] std.Target: fill out cTypeBitSize() for ps3 contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index dce4d36097edecda836b546031be1ba00d63212f..b76a37115191a466ab1834c7a5d35e00ec74972f 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3482,7 +3482,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .longdouble => 128, }, - .psx => switch (c_type) { + .psx, .ps3 => switch (c_type) { .char => 8, .short, .ushort => 16, .int, .uint, .long, .ulong, .float => 32, @@ -3514,7 +3514,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .opengl => null, - .ps3, .managarm, => @panic("specify the C integer and float type sizes for this OS"), }; -- 2.54.0 From 7336dd0c9918ce403a61cbf852b74217fac62091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:03:25 +0200 Subject: [PATCH 08/17] std.Target: fix cCharSignedness() to be .signed on ps3 This is different from the usual convention on PowerPC. contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index b76a37115191a466ab1834c7a5d35e00ec74972f..9b269a87d83c66d4ae4662a1a5ffbe0050fbdd0d 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3138,6 +3138,7 @@ pub fn stackGrowth(target: *const Target) StackGrowth { /// Returns `null` if no C ABI is defined for this target. pub fn cCharSignedness(target: *const Target) ?std.builtin.Signedness { switch (target.os.tag) { + .ps3 => return .signed, .opengl => return null, else => {}, } -- 2.54.0 From 0d66ff5d32ecbdee5e5bb54e0a96bf137b7a94a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:00:48 +0200 Subject: [PATCH 09/17] std.Target: handle managarm in cTypeBitSize() --- lib/std/Target.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 9b269a87d83c66d4ae4662a1a5ffbe0050fbdd0d..8b9683dca69c40c2c2799a31f1c1bb7c4c047e2e 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3302,6 +3302,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { }, .fuchsia, + .managarm, .haiku, .hurd, @@ -3514,9 +3515,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { }, .opengl => null, - - .managarm, - => @panic("specify the C integer and float type sizes for this OS"), }; } -- 2.54.0 From 5e124ec7236a3318dac7d557a7acf31ad8471b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:07:02 +0200 Subject: [PATCH 10/17] std.Target: fix cTypeBitSize(.{long,ulong}) for psp and vita contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 8b9683dca69c40c2c2799a31f1c1bb7c4c047e2e..ca68c6b13c5e808b962b9a4ee2894e6a170cd9fc 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3484,7 +3484,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .longdouble => 128, }, - .psx, .ps3 => switch (c_type) { + .psx, .ps3, .psp, .vita => switch (c_type) { .char => 8, .short, .ushort => 16, .int, .uint, .long, .ulong, .float => 32, @@ -3494,17 +3494,9 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .char => 8, .short, .ushort => 16, .int, .uint, .float => 32, - .long, .ulong => 64, - .longlong, .ulonglong, .double => 64, + .long, .ulong, .longlong, .ulonglong, .double => 64, .longdouble => 80, }, - .psp, .vita => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float => 32, - .long, .ulong => 64, - .longlong, .ulonglong, .double, .longdouble => 64, - }, .tios => switch (c_type) { .char => 8, -- 2.54.0 From e4069c6c5f8dc084dd64de5023ed8e95e34badab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:10:57 +0200 Subject: [PATCH 11/17] std.Target: simplify freestanding prong in cTypeBitSize() a bit --- lib/std/Target.zig | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index ca68c6b13c5e808b962b9a4ee2894e6a170cd9fc..a4dbacd9988cb54019d3503914b5f425cf1274d5 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3242,30 +3242,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .long, .ulong, .float => 32, .double, .longdouble, .longlong, .ulonglong => 64, }, - .mips64, - .mips64el, - => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float => 32, - .long, .ulong => switch (target.abi) { - .abin32 => 32, - else => 64, - }, - .longlong, .ulonglong, .double => 64, - .longdouble => 128, - }, - .x86_64 => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float => 32, - .long, .ulong => switch (target.abi) { - .x32 => 32, - else => 64, - }, - .longlong, .ulonglong, .double => 64, - .longdouble => 80, - }, else => switch (c_type) { .char => 8, .short, .ushort => 16, @@ -3273,7 +3249,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .long, .ulong => target.ptrBitWidth(), .longlong, .ulonglong, .double => 64, .longdouble => switch (target.cpu.arch) { - .x86 => 80, + else => 64, + + .x86, + .x86_64, + => 80, .alpha, .riscv32, @@ -3282,6 +3262,8 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .riscv64be, .aarch64, .aarch64_be, + .mips64, + .mips64el, .powerpc, .powerpcle, .powerpc64, @@ -3295,8 +3277,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .loongarch64, .ve, => 128, - - else => 64, }, }, }, -- 2.54.0 From bc92241eb7a6d8ea23a4800435d4a5f85fcf1bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:16:09 +0200 Subject: [PATCH 12/17] std.Target: refactor cCharSignedness() a tiny bit --- lib/std/Target.zig | 66 +++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index a4dbacd9988cb54019d3503914b5f425cf1274d5..99767d29f754dc69da1b065ef9d9ba9f13a2983d 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3137,39 +3137,39 @@ pub fn stackGrowth(target: *const Target) StackGrowth { /// an option to override the default signedness e.g. GCC's -funsigned-char / -fsigned-char /// Returns `null` if no C ABI is defined for this target. pub fn cCharSignedness(target: *const Target) ?std.builtin.Signedness { - switch (target.os.tag) { - .ps3 => return .signed, - .opengl => return null, - else => {}, - } - if (target.os.tag.isDarwin() or target.os.tag == .windows or target.os.tag == .uefi) return .signed; - return switch (target.cpu.arch) { - .aarch64, - .aarch64_be, - .arm, - .armeb, - .arc, - .arceb, - .csky, - .ez80, - .hexagon, - .msp430, - .powerpc, - .powerpcle, - .powerpc64, - .powerpc64le, - .s390x, - .riscv32, - .riscv32be, - .riscv64, - .riscv64be, - .thumb, - .thumbeb, - .xcore, - .xtensa, - .xtensaeb, - => .unsigned, - else => .signed, + return switch (target.os.tag) { + .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => .signed, + .windows, .uefi => .signed, + .ps3 => .signed, + .opengl => null, + else => switch (target.cpu.arch) { + .aarch64, + .aarch64_be, + .arm, + .armeb, + .arc, + .arceb, + .csky, + .ez80, + .hexagon, + .msp430, + .powerpc, + .powerpcle, + .powerpc64, + .powerpc64le, + .s390x, + .riscv32, + .riscv32be, + .riscv64, + .riscv64be, + .thumb, + .thumbeb, + .xcore, + .xtensa, + .xtensaeb, + => .unsigned, + else => .signed, + }, }; } -- 2.54.0 From 97f7ce8cf57bc38b53f6c2b8d58c4465a965bfc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:19:50 +0200 Subject: [PATCH 13/17] std.Target: fix cCharSignedness() to be .signed on vita This is different from the usual convention on ARM. contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 99767d29f754dc69da1b065ef9d9ba9f13a2983d..2689b75d11e19de6dd7e322ef8e6987870d9fe2b 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3140,7 +3140,7 @@ pub fn cCharSignedness(target: *const Target) ?std.builtin.Signedness { return switch (target.os.tag) { .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => .signed, .windows, .uefi => .signed, - .ps3 => .signed, + .ps3, .vita => .signed, .opengl => null, else => switch (target.cpu.arch) { .aarch64, -- 2.54.0 From f8c7f74882e242968fb4f9815cd591d0de0f967b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:24:05 +0200 Subject: [PATCH 14/17] std.Target: make cell the baseline CPU model for ps3 contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 2689b75d11e19de6dd7e322ef8e6987870d9fe2b..a0738f3a5ba859caaa8640715d9b688b91e51b1d 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -2135,6 +2135,7 @@ pub const Cpu = struct { .powerpc64 => switch (os.tag) { .linux, .freebsd => &powerpc.cpu.pwr8, .openbsd => &powerpc.cpu.pwr9, + .ps3 => &powerpc.cpu.cell, else => generic(arch), }, .powerpc64le => &powerpc.cpu.ppc64le, -- 2.54.0 From af6b6d46b9de671f786a187458efda57ed55fb52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:29:55 +0200 Subject: [PATCH 15/17] std.Target: ps3 doesn't have a dynamic linker path contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index a0738f3a5ba859caaa8640715d9b688b91e51b1d..1af41afadf22b5cee1f1f947e7a8f211aedd0cc7 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -2927,6 +2927,7 @@ pub const DynamicLinker = struct { .gba, .psx, + .ps3, .psp, .vita, @@ -2948,7 +2949,6 @@ pub const DynamicLinker = struct { // TODO go over each item in this list and either move it to the above list, or // implement the standard dynamic linker path code for it. - .ps3, .ps4, .ps5, => none, -- 2.54.0 From 2b448d33d916a78693ab1f7f5d8701c352352201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:32:57 +0200 Subject: [PATCH 16/17] std.Target: define standard dynamic linker path for ps4 and ps5 contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 1af41afadf22b5cee1f1f947e7a8f211aedd0cc7..70a3d5b7dff9101031d625e81c870ec73f9fe34b 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -2469,6 +2469,9 @@ pub const DynamicLinker = struct { .tvos, .visionos, .watchos, + + .ps4, + .ps5, => .arch_os, .hurd, @@ -2489,6 +2492,11 @@ pub const DynamicLinker = struct { .@"switch", .gba, + .psx, + .ps3, + .psp, + .vita, + .emscripten, .wasi, @@ -2501,13 +2509,6 @@ pub const DynamicLinker = struct { .opengl, .vulkan, - .psx, - .ps3, - .ps4, - .ps5, - .psp, - .vita, - .tios, .ashetos, => .none, @@ -2910,8 +2911,10 @@ pub const DynamicLinker = struct { else => none, }, - // Operating systems in this list have been verified as not having a standard - // dynamic linker path. + .ps4, + .ps5, + => if (cpu.arch == .x86_64) init("/libexec/ld-elf.so.1") else none, + .freestanding, .other, @@ -2946,12 +2949,6 @@ pub const DynamicLinker = struct { .tios, .ashetos, => none, - - // TODO go over each item in this list and either move it to the above list, or - // implement the standard dynamic linker path code for it. - .ps4, - .ps5, - => none, } catch unreachable; } }; -- 2.54.0 From a6e456d746bc088a61958a982f331e1eec5c0687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 05:20:14 +0200 Subject: [PATCH 17/17] std.Target: fix default ABI for powerpc64-ps3 to be ilp32 contributes to https://codeberg.org/ziglang/zig/issues/31341 --- lib/std/Target.zig | 2 +- test/llvm_targets.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 70a3d5b7dff9101031d625e81c870ec73f9fe34b..a6e7b129dd5e78ba1e509f9a8a3f57a679a95def 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -932,6 +932,7 @@ pub const Abi = enum { .wiiu => .eabihf, .gba => .eabi, .psx => .eabi, + .ps3 => .ilp32, .psp => .eabihf, .vita => .eabihf, .emscripten => .musl, @@ -951,7 +952,6 @@ pub const Abi = enum { .visionos, .watchos, .@"switch", - .ps3, .ps4, .ps5, .amdhsa, diff --git a/test/llvm_targets.zig b/test/llvm_targets.zig index 60d84c3dee78afaa168966c7a4de03fb98a66305..78c775a34bdb5666c244984b4bbc7efaa440b2df 100644 --- a/test/llvm_targets.zig +++ b/test/llvm_targets.zig @@ -206,7 +206,7 @@ const targets = [_]std.Target.Query{ .{ .cpu_arch = .powerpc64, .os_tag = .linux, .abi = .musl }, .{ .cpu_arch = .powerpc64, .os_tag = .linux, .abi = .none }, .{ .cpu_arch = .powerpc64, .os_tag = .openbsd, .abi = .none }, - .{ .cpu_arch = .powerpc64, .os_tag = .ps3, .abi = .none }, + .{ .cpu_arch = .powerpc64, .os_tag = .ps3, .abi = .ilp32 }, .{ .cpu_arch = .powerpc64, .os_tag = .rtems, .abi = .none }, .{ .cpu_arch = .powerpc64le, .os_tag = .freebsd, .abi = .none }, -- 2.54.0