authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-18 12:45:27+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-18 12:45:27+02:00
logcfeab9258739f44b73542952b3ca62c1187669e1
tree6de84e36a111e1f82674ebcf29b08afd6e0bf6de
parent14bc6f5917ae94902cdf209e3ac9af908b506795
parent7853cd1e008b003f2881947615832249d2e0711e

Merge pull request 'add full support for libc-less `x86_64-linux-x32` and `mips64(el)-linux-abin32`' (#35828) from alexrp/zig:x32-n32 into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35828

16 files changed, 160 insertions(+), 105 deletions(-)

lib/std/Build/Configuration.zig+6
...@@ -2271,6 +2271,8 @@ pub const TargetQuery = struct {...@@ -2271,6 +2271,8 @@ pub const TargetQuery = struct {
2271 gnux32,2271 gnux32,
2272 eabi,2272 eabi,
2273 eabihf,2273 eabihf,
2274 abin32,
2275 x32,
2274 ilp32,2276 ilp32,
2275 android,2277 android,
2276 androideabi,2278 androideabi,
...@@ -2304,6 +2306,8 @@ pub const TargetQuery = struct {...@@ -2304,6 +2306,8 @@ pub const TargetQuery = struct {
2304 .gnux32 => .gnux32,2306 .gnux32 => .gnux32,
2305 .eabi => .eabi,2307 .eabi => .eabi,
2306 .eabihf => .eabihf,2308 .eabihf => .eabihf,
2309 .abin32 => .abin32,
2310 .x32 => .x32,
2307 .ilp32 => .ilp32,2311 .ilp32 => .ilp32,
2308 .android => .android,2312 .android => .android,
2309 .androideabi => .androideabi,2313 .androideabi => .androideabi,
...@@ -2337,6 +2341,8 @@ pub const TargetQuery = struct {...@@ -2337,6 +2341,8 @@ pub const TargetQuery = struct {
2337 .gnux32 => .gnux32,2341 .gnux32 => .gnux32,
2338 .eabi => .eabi,2342 .eabi => .eabi,
2339 .eabihf => .eabihf,2343 .eabihf => .eabihf,
2344 .abin32 => .abin32,
2345 .x32 => .x32,
2340 .ilp32 => .ilp32,2346 .ilp32 => .ilp32,
2341 .android => .android,2347 .android => .android,
2342 .androideabi => .androideabi,2348 .androideabi => .androideabi,
lib/std/Target.zig+80-67
...@@ -796,6 +796,8 @@ pub const Abi = enum {...@@ -796,6 +796,8 @@ pub const Abi = enum {
796 gnux32,796 gnux32,
797 eabi,797 eabi,
798 eabihf,798 eabihf,
799 abin32,
800 x32,
799 ilp32,801 ilp32,
800 android,802 android,
801 androideabi,803 androideabi,
...@@ -887,8 +889,12 @@ pub const Abi = enum {...@@ -887,8 +889,12 @@ pub const Abi = enum {
887 => .muslabi64,889 => .muslabi64,
888890
889 // No musl support.891 // No musl support.
892 .alpha,
890 .arc,893 .arc,
891 .arceb,894 .arceb,
895 .or1k,
896 .sparc,
897 .sparc64,
892 => .gnu,898 => .gnu,
893 .csky,899 .csky,
894 => .gnueabi,900 => .gnueabi,
...@@ -2920,10 +2926,17 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {...@@ -2920,10 +2926,17 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
29202926
2921pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 {2927pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 {
2922 switch (abi) {2928 switch (abi) {
2923 .gnux32, .muslx32, .gnuabin32, .muslabin32, .ilp32 => return 32,2929 .gnux32,
2924 .gnuabi64, .muslabi64 => return 64,2930 .muslx32,
2931 .x32,
2932 .gnuabin32,
2933 .muslabin32,
2934 .abin32,
2935 .ilp32,
2936 => return 32,
2925 else => {},2937 else => {},
2926 }2938 }
2939
2927 return switch (cpu_arch) {2940 return switch (cpu_arch) {
2928 .avr,2941 .avr,
2929 .msp430,2942 .msp430,
...@@ -3002,12 +3015,12 @@ pub fn ptrBitWidth(target: *const Target) u16 {...@@ -3002,12 +3015,12 @@ pub fn ptrBitWidth(target: *const Target) u16 {
3002pub fn stackAlignment(target: *const Target) u16 {3015pub fn stackAlignment(target: *const Target) u16 {
3003 // Overrides for when the stack alignment is not equal to the pointer width.3016 // Overrides for when the stack alignment is not equal to the pointer width.
3004 switch (target.cpu.arch) {3017 switch (target.cpu.arch) {
3005 .ez80,3018 .ez80 => return 1,
3006 => return 1,3019
3007 .m68k,3020 .m68k => return 2,
3008 => return 2,3021
3009 .amdgcn,3022 .amdgcn => return 4,
3010 => return 4,3023
3011 .arm,3024 .arm,
3012 .armeb,3025 .armeb,
3013 .hppa,3026 .hppa,
...@@ -3018,6 +3031,7 @@ pub fn stackAlignment(target: *const Target) u16 {...@@ -3018,6 +3031,7 @@ pub fn stackAlignment(target: *const Target) u16 {
3018 .thumb,3031 .thumb,
3019 .thumbeb,3032 .thumbeb,
3020 => return 8,3033 => return 8,
3034
3021 .aarch64,3035 .aarch64,
3022 .aarch64_be,3036 .aarch64_be,
3023 .alpha,3037 .alpha,
...@@ -3034,18 +3048,23 @@ pub fn stackAlignment(target: *const Target) u16 {...@@ -3034,18 +3048,23 @@ pub fn stackAlignment(target: *const Target) u16 {
3034 .wasm64,3048 .wasm64,
3035 .x86_64,3049 .x86_64,
3036 => return 16,3050 => return 16,
3051
3037 // Some of the following prongs should really be testing the ABI, but our current `Abi` enum3052 // Some of the following prongs should really be testing the ABI, but our current `Abi` enum
3038 // can't handle that level of nuance yet.3053 // can't handle that level of nuance yet.
3039 .powerpc64,3054 .powerpc64,
3040 .powerpc64le,3055 .powerpc64le,
3041 => if (target.os.tag == .linux) return 16,3056 => if (target.os.tag == .linux) return 16,
3057
3042 .riscv32,3058 .riscv32,
3043 .riscv32be,3059 .riscv32be,
3044 .riscv64,3060 .riscv64,
3045 .riscv64be,3061 .riscv64be,
3046 => if (!target.cpu.has(.riscv, .e)) return 16,3062 => if (!target.cpu.has(.riscv, .e)) return 16,
3063
3047 .x86 => if (target.os.tag != .windows and target.os.tag != .uefi) return 16,3064 .x86 => if (target.os.tag != .windows and target.os.tag != .uefi) return 16,
3065
3048 .kvx => return 32,3066 .kvx => return 32,
3067
3049 else => {},3068 else => {},
3050 }3069 }
30513070
...@@ -3148,7 +3167,9 @@ pub fn cTypeByteSize(t: *const Target, c_type: CType) u16 {...@@ -3148,7 +3167,9 @@ pub fn cTypeByteSize(t: *const Target, c_type: CType) u16 {
3148pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {3167pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3149 switch (target.os.tag) {3168 switch (target.os.tag) {
3150 .freestanding, .other => switch (target.cpu.arch) {3169 .freestanding, .other => switch (target.cpu.arch) {
3151 .msp430, .x86_16 => switch (c_type) {3170 .msp430,
3171 .x86_16,
3172 => switch (c_type) {
3152 .char => return 8,3173 .char => return 8,
3153 .short, .ushort, .int, .uint => return 16,3174 .short, .ushort, .int, .uint => return 16,
3154 .float, .long, .ulong => return 32,3175 .float, .long, .ulong => return 32,
...@@ -3160,12 +3181,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3160,12 +3181,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3160 .long, .ulong, .float, .double, .longdouble => return 32,3181 .long, .ulong, .float, .double, .longdouble => return 32,
3161 .longlong, .ulonglong => return 64,3182 .longlong, .ulonglong => return 64,
3162 },3183 },
3163 .mips64, .mips64el => switch (c_type) {3184 .mips64,
3185 .mips64el,
3186 => switch (c_type) {
3164 .char => return 8,3187 .char => return 8,
3165 .short, .ushort => return 16,3188 .short, .ushort => return 16,
3166 .int, .uint, .float => return 32,3189 .int, .uint, .float => return 32,
3167 .long, .ulong => switch (target.abi) {3190 .long, .ulong => switch (target.abi) {
3168 .gnuabin32, .muslabin32 => return 32,3191 .abin32 => return 32,
3169 else => return 64,3192 else => return 64,
3170 },3193 },
3171 .longlong, .ulonglong, .double => return 64,3194 .longlong, .ulonglong, .double => return 64,
...@@ -3176,7 +3199,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3176,7 +3199,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3176 .short, .ushort => return 16,3199 .short, .ushort => return 16,
3177 .int, .uint, .float => return 32,3200 .int, .uint, .float => return 32,
3178 .long, .ulong => switch (target.abi) {3201 .long, .ulong => switch (target.abi) {
3179 .gnux32, .muslx32 => return 32,3202 .x32 => return 32,
3180 else => return 64,3203 else => return 64,
3181 },3204 },
3182 .longlong, .ulonglong, .double => return 64,3205 .longlong, .ulonglong, .double => return 64,
...@@ -3189,25 +3212,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3189,25 +3212,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3189 .long, .ulong => return target.ptrBitWidth(),3212 .long, .ulong => return target.ptrBitWidth(),
3190 .longlong, .ulonglong, .double => return 64,3213 .longlong, .ulonglong, .double => return 64,
3191 .longdouble => switch (target.cpu.arch) {3214 .longdouble => switch (target.cpu.arch) {
3192 .x86 => switch (target.abi) {3215 .x86 => return 80,
3193 .android => return 64,
3194 else => return 80,
3195 },
3196
3197 .powerpc,
3198 .powerpcle,
3199 .powerpc64,
3200 .powerpc64le,
3201 => switch (target.abi) {
3202 .musl,
3203 .muslabin32,
3204 .muslabi64,
3205 .musleabi,
3206 .musleabihf,
3207 .muslx32,
3208 => return 64,
3209 else => return 128,
3210 },
32113216
3212 .alpha,3217 .alpha,
3213 .riscv32,3218 .riscv32,
...@@ -3216,6 +3221,10 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3216,6 +3221,10 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3216 .riscv64be,3221 .riscv64be,
3217 .aarch64,3222 .aarch64,
3218 .aarch64_be,3223 .aarch64_be,
3224 .powerpc,
3225 .powerpcle,
3226 .powerpc64,
3227 .powerpc64le,
3219 .s390x,3228 .s390x,
3220 .sparc64,3229 .sparc64,
3221 .wasm32,3230 .wasm32,
...@@ -3249,23 +3258,25 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3249,23 +3258,25 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3249 .wasi,3258 .wasi,
3250 .emscripten,3259 .emscripten,
3251 => switch (target.cpu.arch) {3260 => switch (target.cpu.arch) {
3252 .mips64, .mips64el => switch (c_type) {3261 .mips64,
3262 .mips64el,
3263 => switch (c_type) {
3253 .char => return 8,3264 .char => return 8,
3254 .short, .ushort => return 16,3265 .short, .ushort => return 16,
3255 .int, .uint, .float => return 32,3266 .int, .uint, .float => return 32,
3256 .long, .ulong => switch (target.abi) {3267 .long, .ulong => switch (target.abi) {
3257 .gnuabin32, .muslabin32 => return 32,3268 .gnuabin32, .muslabin32, .abin32 => return 32,
3258 else => return 64,3269 else => return 64,
3259 },3270 },
3260 .longlong, .ulonglong, .double => return 64,3271 .longlong, .ulonglong, .double => return 64,
3261 .longdouble => if (target.os.tag == .freebsd) return 64 else return 128,3272 .longdouble => return 128,
3262 },3273 },
3263 .x86_64 => switch (c_type) {3274 .x86_64 => switch (c_type) {
3264 .char => return 8,3275 .char => return 8,
3265 .short, .ushort => return 16,3276 .short, .ushort => return 16,
3266 .int, .uint, .float => return 32,3277 .int, .uint, .float => return 32,
3267 .long, .ulong => switch (target.abi) {3278 .long, .ulong => switch (target.abi) {
3268 .gnux32, .muslx32 => return 32,3279 .gnux32, .muslx32, .x32 => return 32,
3269 else => return 64,3280 else => return 64,
3270 },3281 },
3271 .longlong, .ulonglong, .double => return 64,3282 .longlong, .ulonglong, .double => return 64,
...@@ -3286,15 +3297,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3286,15 +3297,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3286 .powerpc,3297 .powerpc,
3287 .powerpcle,3298 .powerpcle,
3288 => switch (target.abi) {3299 => switch (target.abi) {
3289 .musl,3300 .musleabi, .musleabihf => return 64,
3290 .muslabin32,
3291 .muslabi64,
3292 .musleabi,
3293 .musleabihf,
3294 .muslx32,
3295 => return 64,
3296 else => switch (target.os.tag) {3301 else => switch (target.os.tag) {
3297 .freebsd, .netbsd, .openbsd => return 64,3302 .netbsd,
3303 .openbsd,
3304 => return 64,
3298 else => return 128,3305 else => return 128,
3299 },3306 },
3300 },3307 },
...@@ -3302,15 +3309,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3302,15 +3309,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3302 .powerpc64,3309 .powerpc64,
3303 .powerpc64le,3310 .powerpc64le,
3304 => switch (target.abi) {3311 => switch (target.abi) {
3305 .musl,3312 .musl => return 64,
3306 .muslabin32,
3307 .muslabi64,
3308 .musleabi,
3309 .musleabihf,
3310 .muslx32,
3311 => return 64,
3312 else => switch (target.os.tag) {3313 else => switch (target.os.tag) {
3313 .freebsd, .openbsd => return 64,3314 .freebsd,
3315 .openbsd,
3316 => return 64,
3314 else => return 128,3317 else => return 128,
3315 },3318 },
3316 },3319 },
...@@ -3346,7 +3349,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3346,7 +3349,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3346 .long, .ulong => return 32,3349 .long, .ulong => return 32,
3347 .longlong, .ulonglong, .double => return 64,3350 .longlong, .ulonglong, .double => return 64,
3348 .longdouble => switch (target.abi) {3351 .longdouble => switch (target.abi) {
3349 .gnu, .ilp32 => return 80,3352 .gnu => return 80,
3350 else => return 64,3353 else => return 64,
3351 },3354 },
3352 },3355 },
...@@ -3357,7 +3360,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3357,7 +3360,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3357 .long, .ulong => return 32,3360 .long, .ulong => return 32,
3358 .longlong, .ulonglong, .double => return 64,3361 .longlong, .ulonglong, .double => return 64,
3359 .longdouble => switch (target.abi) {3362 .longdouble => switch (target.abi) {
3360 .gnu, .ilp32 => return 80,3363 .gnu => return 80,
3361 else => return 64,3364 else => return 64,
3362 },3365 },
3363 },3366 },
...@@ -3476,12 +3479,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3476,12 +3479,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3476pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {3479pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
3477 // Overrides for unusual alignments3480 // Overrides for unusual alignments
3478 switch (target.cpu.arch) {3481 switch (target.cpu.arch) {
3479 .avr, .ez80 => return 1,3482 .avr,
3483 .ez80,
3484 => return 1,
3480 .x86 => switch (target.os.tag) {3485 .x86 => switch (target.os.tag) {
3481 .windows, .uefi => switch (c_type) {3486 .windows, .uefi => switch (c_type) {
3482 .longlong, .ulonglong, .double => return 8,3487 .longlong, .ulonglong, .double => return 8,
3483 .longdouble => switch (target.abi) {3488 .longdouble => switch (target.abi) {
3484 .gnu, .ilp32 => return 4,3489 .gnu => return 4,
3485 else => return 8,3490 else => return 8,
3486 },3491 },
3487 else => {},3492 else => {},
...@@ -3506,8 +3511,6 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {...@@ -3506,8 +3511,6 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
3506 return @min(3511 return @min(
3507 std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8),3512 std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8),
3508 @as(u16, switch (target.cpu.arch) {3513 @as(u16, switch (target.cpu.arch) {
3509 .ez80 => 1,
3510
3511 .msp430,3514 .msp430,
3512 .x86_16,3515 .x86_16,
3513 => 2,3516 => 2,
...@@ -3575,6 +3578,7 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {...@@ -3575,6 +3578,7 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
3575 => 16,3578 => 16,
35763579
3577 .avr,3580 .avr,
3581 .ez80,
3578 => unreachable, // Handled above.3582 => unreachable, // Handled above.
3579 }),3583 }),
3580 );3584 );
...@@ -3587,11 +3591,13 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {...@@ -3587,11 +3591,13 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
3587 .longdouble => return 4,3591 .longdouble => return 4,
3588 else => {},3592 else => {},
3589 },3593 },
3590 .avr, .ez80 => return 1,3594 .avr,
3595 .ez80,
3596 => return 1,
3591 .x86 => switch (target.os.tag) {3597 .x86 => switch (target.os.tag) {
3592 .windows, .uefi => switch (c_type) {3598 .windows, .uefi => switch (c_type) {
3593 .longdouble => switch (target.abi) {3599 .longdouble => switch (target.abi) {
3594 .gnu, .ilp32 => return 4,3600 .gnu => return 4,
3595 else => return 8,3601 else => return 8,
3596 },3602 },
3597 else => {},3603 else => {},
...@@ -3619,9 +3625,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {...@@ -3619,9 +3625,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
3619 return @min(3625 return @min(
3620 std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8),3626 std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8),
3621 @as(u16, switch (target.cpu.arch) {3627 @as(u16, switch (target.cpu.arch) {
3622 .ez80 => 1,3628 .x86_16,
36233629 .msp430,
3624 .x86_16, .msp430 => 2,3630 => 2,
36253631
3626 .arc,3632 .arc,
3627 .arceb,3633 .arceb,
...@@ -3686,6 +3692,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {...@@ -3686,6 +3692,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
3686 => 16,3692 => 16,
36873693
3688 .avr,3694 .avr,
3695 .ez80,
3689 => unreachable, // Handled above.3696 => unreachable, // Handled above.
3690 }),3697 }),
3691 );3698 );
...@@ -3697,7 +3704,9 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {...@@ -3697,7 +3704,9 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {
3697 .ez80,3704 .ez80,
3698 => 1,3705 => 1,
36993706
3700 .msp430, .x86_16 => 2,3707 .msp430,
3708 .x86_16,
3709 => 2,
37013710
3702 .arc,3711 .arc,
3703 .arceb,3712 .arceb,
...@@ -3766,14 +3775,18 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {...@@ -3766,14 +3775,18 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {
3766pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention {3775pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention {
3767 return switch (target.cpu.arch) {3776 return switch (target.cpu.arch) {
3768 .x86_64 => switch (target.os.tag) {3777 .x86_64 => switch (target.os.tag) {
3769 .windows, .uefi => .{ .x86_64_win = .{} },3778 .windows,
3779 .uefi,
3780 => .{ .x86_64_win = .{} },
3770 else => switch (target.abi) {3781 else => switch (target.abi) {
3771 .gnux32, .muslx32 => .{ .x86_64_x32 = .{} },3782 .gnux32, .muslx32, .x32 => .{ .x86_64_x32 = .{} },
3772 else => .{ .x86_64_sysv = .{} },3783 else => .{ .x86_64_sysv = .{} },
3773 },3784 },
3774 },3785 },
3775 .x86 => switch (target.os.tag) {3786 .x86 => switch (target.os.tag) {
3776 .windows, .uefi => .{ .x86_win = .{} },3787 .windows,
3788 .uefi,
3789 => .{ .x86_win = .{} },
3777 else => .{ .x86_sysv = .{} },3790 else => .{ .x86_sysv = .{} },
3778 },3791 },
3779 .x86_16 => .{ .x86_16_cdecl = .{} },3792 .x86_16 => .{ .x86_16_cdecl = .{} },
...@@ -3789,7 +3802,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention...@@ -3789,7 +3802,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
3789 .hard => .{ .arm_aapcs_vfp = .{} },3802 .hard => .{ .arm_aapcs_vfp = .{} },
3790 },3803 },
3791 .mips64, .mips64el => switch (target.abi) {3804 .mips64, .mips64el => switch (target.abi) {
3792 .gnuabin32, .muslabin32 => .{ .mips64_n32 = .{} },3805 .gnuabin32, .muslabin32, .abin32 => .{ .mips64_n32 = .{} },
3793 else => .{ .mips64_n64 = .{} },3806 else => .{ .mips64_n64 = .{} },
3794 },3807 },
3795 .mips, .mipsel => .{ .mips_o32 = .{} },3808 .mips, .mipsel => .{ .mips_o32 = .{} },
lib/std/Thread.zig+2-2
...@@ -1171,7 +1171,7 @@ const LinuxThreadImpl = struct {...@@ -1171,7 +1171,7 @@ const LinuxThreadImpl = struct {
1171 [len] "{ecx}" (self.mapped.len),1171 [len] "{ecx}" (self.mapped.len),
1172 ),1172 ),
1173 .x86_64 => asm volatile (switch (target.abi) {1173 .x86_64 => asm volatile (switch (target.abi) {
1174 .gnux32, .muslx32 =>1174 .gnux32, .muslx32, .x32 =>
1175 \\ movl $0x4000000b, %%eax # SYS_munmap1175 \\ movl $0x4000000b, %%eax # SYS_munmap
1176 \\ syscall1176 \\ syscall
1177 \\ movl $0x4000003c, %%eax # SYS_exit1177 \\ movl $0x4000003c, %%eax # SYS_exit
...@@ -1286,7 +1286,7 @@ const LinuxThreadImpl = struct {...@@ -1286,7 +1286,7 @@ const LinuxThreadImpl = struct {
1286 [len] "{$5}" (self.mapped.len),1286 [len] "{$5}" (self.mapped.len),
1287 ),1287 ),
1288 .mips64, .mips64el => asm volatile (switch (target.abi) {1288 .mips64, .mips64el => asm volatile (switch (target.abi) {
1289 .gnuabin32, .muslabin32 =>1289 .gnuabin32, .muslabin32, .abin32 =>
1290 \\ li $v0, 6011 # SYS_munmap1290 \\ li $v0, 6011 # SYS_munmap
1291 \\ syscall1291 \\ syscall
1292 \\ li $v0, 6058 # SYS_exit1292 \\ li $v0, 6058 # SYS_exit
lib/std/debug/Dwarf/expression.zig+2-2
...@@ -1158,7 +1158,7 @@ test "basics" {...@@ -1158,7 +1158,7 @@ test "basics" {
11581158
1159 // TODO: Test fbreg (once implemented): mock a DIE and point compile_unit.frame_base at it1159 // TODO: Test fbreg (once implemented): mock a DIE and point compile_unit.frame_base at it
11601160
1161 mem.writeInt(usize, reg_bytes[0..@sizeOf(usize)], 0xee, native_endian);1161 mem.writeInt(std.debug.cpu_context.Native.Gpr, reg_bytes[0..@sizeOf(std.debug.cpu_context.Native.Gpr)], 0xee, native_endian);
1162 (try regNative(&cpu_context, fp_reg_num)).* = 1;1162 (try regNative(&cpu_context, fp_reg_num)).* = 1;
1163 (try regNative(&cpu_context, ip_reg_num)).* = 2;1163 (try regNative(&cpu_context, ip_reg_num)).* = 2;
11641164
...@@ -1566,7 +1566,7 @@ test "basics" {...@@ -1566,7 +1566,7 @@ test "basics" {
1566 context = .{ .cpu_context = &cpu_context };1566 context = .{ .cpu_context = &cpu_context };
15671567
1568 const reg_bytes = try cpu_context.dwarfRegisterBytes(0);1568 const reg_bytes = try cpu_context.dwarfRegisterBytes(0);
1569 mem.writeInt(usize, reg_bytes[0..@sizeOf(usize)], 0xee, native_endian);1569 mem.writeInt(std.debug.cpu_context.Native.Gpr, reg_bytes[0..@sizeOf(std.debug.cpu_context.Native.Gpr)], 0xee, native_endian);
15701570
1571 var sub_program: std.Io.Writer.Allocating = .init(allocator);1571 var sub_program: std.Io.Writer.Allocating = .init(allocator);
1572 defer sub_program.deinit();1572 defer sub_program.deinit();
lib/std/os/linux.zig+10-8
...@@ -43,7 +43,7 @@ const arch_bits = switch (native_arch) {...@@ -43,7 +43,7 @@ const arch_bits = switch (native_arch) {
43 .microblaze, .microblazeel => @import("linux/microblaze.zig"),43 .microblaze, .microblazeel => @import("linux/microblaze.zig"),
44 .mips, .mipsel => @import("linux/mips.zig"),44 .mips, .mipsel => @import("linux/mips.zig"),
45 .mips64, .mips64el => switch (builtin.abi) {45 .mips64, .mips64el => switch (builtin.abi) {
46 .gnuabin32, .muslabin32 => @import("linux/mipsn32.zig"),46 .gnuabin32, .muslabin32, .abin32 => @import("linux/mipsn32.zig"),
47 else => @import("linux/mips64.zig"),47 else => @import("linux/mips64.zig"),
48 },48 },
49 .or1k => @import("linux/or1k.zig"),49 .or1k => @import("linux/or1k.zig"),
...@@ -57,7 +57,7 @@ const arch_bits = switch (native_arch) {...@@ -57,7 +57,7 @@ const arch_bits = switch (native_arch) {
57 .sparc64 => @import("linux/sparc64.zig"),57 .sparc64 => @import("linux/sparc64.zig"),
58 .x86 => @import("linux/x86.zig"),58 .x86 => @import("linux/x86.zig"),
59 .x86_64 => switch (builtin.abi) {59 .x86_64 => switch (builtin.abi) {
60 .gnux32, .muslx32 => @import("linux/x32.zig"),60 .gnux32, .muslx32, .x32 => @import("linux/x32.zig"),
61 else => @import("linux/x86_64.zig"),61 else => @import("linux/x86_64.zig"),
62 },62 },
63 .xtensa, .xtensaeb => @import("linux/xtensa.zig"),63 .xtensa, .xtensaeb => @import("linux/xtensa.zig"),
...@@ -144,7 +144,7 @@ pub const SYS = switch (native_arch) {...@@ -144,7 +144,7 @@ pub const SYS = switch (native_arch) {
144 .microblaze, .microblazeel => syscalls.Microblaze,144 .microblaze, .microblazeel => syscalls.Microblaze,
145 .mips, .mipsel => syscalls.MipsO32,145 .mips, .mipsel => syscalls.MipsO32,
146 .mips64, .mips64el => switch (builtin.abi) {146 .mips64, .mips64el => switch (builtin.abi) {
147 .gnuabin32, .muslabin32 => syscalls.MipsN32,147 .gnuabin32, .muslabin32, .abin32 => syscalls.MipsN32,
148 else => syscalls.MipsN64,148 else => syscalls.MipsN64,
149 },149 },
150 .or1k => syscalls.OpenRisc,150 .or1k => syscalls.OpenRisc,
...@@ -158,7 +158,7 @@ pub const SYS = switch (native_arch) {...@@ -158,7 +158,7 @@ pub const SYS = switch (native_arch) {
158 .sparc64 => syscalls.Sparc64,158 .sparc64 => syscalls.Sparc64,
159 .x86 => syscalls.X86,159 .x86 => syscalls.X86,
160 .x86_64 => switch (builtin.abi) {160 .x86_64 => switch (builtin.abi) {
161 .gnux32, .muslx32 => syscalls.X32,161 .gnux32, .muslx32, .x32 => syscalls.X32,
162 else => syscalls.X64,162 else => syscalls.X64,
163 },163 },
164 .xtensa, .xtensaeb => syscalls.Xtensa,164 .xtensa, .xtensaeb => syscalls.Xtensa,
...@@ -1828,8 +1828,10 @@ pub fn lseek(fd: fd_t, offset: off_t, whence: u32) u64 {...@@ -1828,8 +1828,10 @@ pub fn lseek(fd: fd_t, offset: off_t, whence: u32) u64 {
1828 return switch (builtin.abi) {1828 return switch (builtin.abi) {
1829 .gnuabin32,1829 .gnuabin32,
1830 .muslabin32,1830 .muslabin32,
1831 .abin32,
1831 .gnux32,1832 .gnux32,
1832 .muslx32,1833 .muslx32,
1834 .x32,
1833 => syscall_lseek(fd, offset, whence),1835 => syscall_lseek(fd, offset, whence),
1834 else => syscall3(.lseek, @as(u32, @bitCast(fd)), @as(u64, @bitCast(offset)), whence),1836 else => syscall3(.lseek, @as(u32, @bitCast(fd)), @as(u64, @bitCast(offset)), whence),
1835 };1837 };
...@@ -2006,7 +2008,7 @@ pub const F = struct {...@@ -2006,7 +2008,7 @@ pub const F = struct {
2006 const SETLKW = 35;2008 const SETLKW = 35;
2007 },2009 },
2008 .mips64, .mips64el => switch (native_abi) {2010 .mips64, .mips64el => switch (native_abi) {
2009 .gnuabin32, .muslabin32 => struct {2011 .gnuabin32, .muslabin32, .abin32 => struct {
2010 const GETLK = 33;2012 const GETLK = 33;
2011 const SETLK = 34;2013 const SETLK = 34;
2012 const SETLKW = 35;2014 const SETLKW = 35;
...@@ -3187,7 +3189,7 @@ pub fn tee(src: fd_t, dest: fd_t, len: usize, flags: u32) usize {...@@ -3187,7 +3189,7 @@ pub fn tee(src: fd_t, dest: fd_t, len: usize, flags: u32) usize {
3187}3189}
31883190
3189pub const Sysinfo = switch (native_abi) {3191pub const Sysinfo = switch (native_abi) {
3190 .gnux32, .muslx32 => extern struct {3192 .gnux32, .muslx32, .x32 => extern struct {
3191 /// Seconds since boot3193 /// Seconds since boot
3192 uptime: i64,3194 uptime: i64,
3193 /// 1, 5, and 15 minute load averages3195 /// 1, 5, and 15 minute load averages
...@@ -10753,11 +10755,11 @@ pub const AUDIT = struct {...@@ -10753,11 +10755,11 @@ pub const AUDIT = struct {
10753 .mips => .MIPS,10755 .mips => .MIPS,
10754 .mipsel => .MIPSEL,10756 .mipsel => .MIPSEL,
10755 .mips64 => switch (native_abi) {10757 .mips64 => switch (native_abi) {
10756 .gnuabin32, .muslabin32 => .MIPS64N32,10758 .gnuabin32, .muslabin32, .abin32 => .MIPS64N32,
10757 else => .MIPS64,10759 else => .MIPS64,
10758 },10760 },
10759 .mips64el => switch (native_abi) {10761 .mips64el => switch (native_abi) {
10760 .gnuabin32, .muslabin32 => .MIPSEL64N32,10762 .gnuabin32, .muslabin32, .abin32 => .MIPSEL64N32,
10761 else => .MIPSEL64,10763 else => .MIPSEL64,
10762 },10764 },
10763 .or1k => .OPENRISC,10765 .or1k => .OPENRISC,
lib/std/os/linux/mipsn32.zig+2-2
...@@ -219,8 +219,8 @@ pub fn clone() callconv(.naked) u32 {...@@ -219,8 +219,8 @@ pub fn clone() callconv(.naked) u32 {
219 \\ move $fp, $zero219 \\ move $fp, $zero
220 \\ move $ra, $zero220 \\ move $ra, $zero
221 \\221 \\
222 \\ ld $t9, 0($sp)222 \\ lw $t9, 0($sp)
223 \\ ld $a0, 4($sp)223 \\ lw $a0, 4($sp)
224 \\ jalr $t9224 \\ jalr $t9
225 \\225 \\
226 \\ move $a0, $v0226 \\ move $a0, $v0
lib/std/pie.zig+1-1
...@@ -162,7 +162,7 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {...@@ -162,7 +162,7 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
162 :162 :
163 : .{ .lr = true }),163 : .{ .lr = true }),
164 .mips64, .mips64el => switch (builtin.abi) {164 .mips64, .mips64el => switch (builtin.abi) {
165 .gnuabin32, .muslabin32 => asm volatile (165 .gnuabin32, .muslabin32, .abin32 => asm volatile (
166 \\ .weak _DYNAMIC166 \\ .weak _DYNAMIC
167 \\ .hidden _DYNAMIC167 \\ .hidden _DYNAMIC
168 \\ bal 1f168 \\ bal 1f
lib/std/start.zig+1-1
...@@ -373,7 +373,7 @@ fn _start() callconv(.naked) noreturn {...@@ -373,7 +373,7 @@ fn _start() callconv(.naked) noreturn {
373 \\ jalr $t9373 \\ jalr $t9
374 ,374 ,
375 .mips64, .mips64el => switch (builtin.abi) {375 .mips64, .mips64el => switch (builtin.abi) {
376 .gnuabin32, .muslabin32 =>376 .gnuabin32, .muslabin32, .abin32 =>
377 \\ move $fp, $zero377 \\ move $fp, $zero
378 \\ bal 1f378 \\ bal 1f
379 \\ .gpword .379 \\ .gpword .
lib/std/zig/LibCDirs.zig+2
...@@ -282,6 +282,8 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 {...@@ -282,6 +282,8 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 {
282 => return "musl",282 => return "musl",
283 .eabi,283 .eabi,
284 .eabihf,284 .eabihf,
285 .abin32,
286 .x32,
285 .ilp32,287 .ilp32,
286 .android,288 .android,
287 .androideabi,289 .androideabi,
lib/std/zig/system.zig+2-2
...@@ -104,7 +104,7 @@ pub fn getExternalExecutor(io: Io, candidate: *const std.Target, options: GetExt...@@ -104,7 +104,7 @@ pub fn getExternalExecutor(io: Io, candidate: *const std.Target, options: GetExt
104 => .{ .qemu = switch (t) {104 => .{ .qemu = switch (t) {
105 .x86 => "qemu-i386",105 .x86 => "qemu-i386",
106 .x86_64 => switch (candidate.abi) {106 .x86_64 => switch (candidate.abi) {
107 .gnux32, .muslx32 => return bad_result,107 .gnux32, .muslx32, .x32 => return bad_result,
108 else => "qemu-x86_64",108 else => "qemu-x86_64",
109 },109 },
110 else => "qemu-" ++ @tagName(t),110 else => "qemu-" ++ @tagName(t),
...@@ -146,7 +146,7 @@ pub fn getExternalExecutor(io: Io, candidate: *const std.Target, options: GetExt...@@ -146,7 +146,7 @@ pub fn getExternalExecutor(io: Io, candidate: *const std.Target, options: GetExt
146 .powerpc64 => "qemu-ppc64",146 .powerpc64 => "qemu-ppc64",
147 .powerpc64le => "qemu-ppc64le",147 .powerpc64le => "qemu-ppc64le",
148 .mips64, .mips64el => switch (candidate.abi) {148 .mips64, .mips64el => switch (candidate.abi) {
149 .gnuabin32, .muslabin32 => if (t == .mips64el) "qemu-mipsn32el" else "qemu-mipsn32",149 .gnuabin32, .muslabin32, .abin32 => if (t == .mips64el) "qemu-mipsn32el" else "qemu-mipsn32",
150 else => "qemu-" ++ @tagName(t),150 else => "qemu-" ++ @tagName(t),
151 },151 },
152 // TODO: Actually check the SuperH version.152 // TODO: Actually check the SuperH version.
src/codegen/llvm.zig+5-3
...@@ -285,6 +285,8 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8...@@ -285,6 +285,8 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
285 .ilp32 => "unknown",285 .ilp32 => "unknown",
286 .eabi => "eabi",286 .eabi => "eabi",
287 .eabihf => "eabihf",287 .eabihf => "eabihf",
288 .abin32 => "unknown",
289 .x32 => "muslx32", // https://github.com/ziglang/zig/issues/25649
288 .android => "android",290 .android => "android",
289 .androideabi => "androideabi",291 .androideabi => "androideabi",
290 .musl => switch (target.os.tag) {292 .musl => switch (target.os.tag) {
...@@ -377,11 +379,11 @@ pub fn dataLayout(target: *const std.Target) []const u8 {...@@ -377,11 +379,11 @@ pub fn dataLayout(target: *const std.Target) []const u8 {
377 .mips => "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64",379 .mips => "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64",
378 .mipsel => "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64",380 .mipsel => "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64",
379 .mips64 => switch (target.abi) {381 .mips64 => switch (target.abi) {
380 .gnuabin32, .muslabin32 => "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",382 .gnuabin32, .muslabin32, .abin32 => "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
381 else => "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",383 else => "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
382 },384 },
383 .mips64el => switch (target.abi) {385 .mips64el => switch (target.abi) {
384 .gnuabin32, .muslabin32 => "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",386 .gnuabin32, .muslabin32, .abin32 => "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
385 else => "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",387 else => "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
386 },388 },
387 .m68k => "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16",389 .m68k => "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16",
...@@ -446,7 +448,7 @@ pub fn dataLayout(target: *const std.Target) []const u8 {...@@ -446,7 +448,7 @@ pub fn dataLayout(target: *const std.Target) []const u8 {
446 .x86_64 => if (target.os.tag.isDarwin() or target.ofmt == .macho)448 .x86_64 => if (target.os.tag.isDarwin() or target.ofmt == .macho)
447 "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"449 "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
448 else switch (target.abi) {450 else switch (target.abi) {
449 .gnux32, .muslx32 => "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",451 .gnux32, .muslx32, .x32 => "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
450 else => if ((target.os.tag == .windows or target.os.tag == .uefi) and target.ofmt == .coff)452 else => if ((target.os.tag == .windows or target.os.tag == .uefi) and target.ofmt == .coff)
451 "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"453 "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
452 else454 else
src/link/Lld.zig+5-5
...@@ -1295,21 +1295,21 @@ fn getLDMOption(target: *const std.Target) ?[]const u8 {...@@ -1295,21 +1295,21 @@ fn getLDMOption(target: *const std.Target) ?[]const u8 {
1295 },1295 },
1296 .mips64 => switch (target.os.tag) {1296 .mips64 => switch (target.os.tag) {
1297 .freebsd => switch (target.abi) {1297 .freebsd => switch (target.abi) {
1298 .gnuabin32, .muslabin32 => "elf32btsmipn32_fbsd",1298 .gnuabin32, .muslabin32, .abin32 => "elf32btsmipn32_fbsd",
1299 else => "elf64btsmip_fbsd",1299 else => "elf64btsmip_fbsd",
1300 },1300 },
1301 else => switch (target.abi) {1301 else => switch (target.abi) {
1302 .gnuabin32, .muslabin32 => "elf32btsmipn32",1302 .gnuabin32, .muslabin32, .abin32 => "elf32btsmipn32",
1303 else => "elf64btsmip",1303 else => "elf64btsmip",
1304 },1304 },
1305 },1305 },
1306 .mips64el => switch (target.os.tag) {1306 .mips64el => switch (target.os.tag) {
1307 .freebsd => switch (target.abi) {1307 .freebsd => switch (target.abi) {
1308 .gnuabin32, .muslabin32 => "elf32ltsmipn32_fbsd",1308 .gnuabin32, .muslabin32, .abin32 => "elf32ltsmipn32_fbsd",
1309 else => "elf64ltsmip_fbsd",1309 else => "elf64ltsmip_fbsd",
1310 },1310 },
1311 else => switch (target.abi) {1311 else => switch (target.abi) {
1312 .gnuabin32, .muslabin32 => "elf32ltsmipn32",1312 .gnuabin32, .muslabin32, .abin32 => "elf32ltsmipn32",
1313 else => "elf64ltsmip",1313 else => "elf64ltsmip",
1314 },1314 },
1315 },1315 },
...@@ -1336,7 +1336,7 @@ fn getLDMOption(target: *const std.Target) ?[]const u8 {...@@ -1336,7 +1336,7 @@ fn getLDMOption(target: *const std.Target) ?[]const u8 {
1336 else => "elf_i386",1336 else => "elf_i386",
1337 },1337 },
1338 .x86_64 => switch (target.abi) {1338 .x86_64 => switch (target.abi) {
1339 .gnux32, .muslx32 => "elf32_x86_64",1339 .gnux32, .muslx32, .x32 => "elf32_x86_64",
1340 else => "elf_x86_64",1340 else => "elf_x86_64",
1341 },1341 },
1342 else => null,1342 else => null,
src/target.zig+5-2
...@@ -164,7 +164,10 @@ pub fn hasValgrindSupport(target: *const std.Target, backend: std.lang.CompilerB...@@ -164,7 +164,10 @@ pub fn hasValgrindSupport(target: *const std.Target, backend: std.lang.CompilerB
164 else => false,164 else => false,
165 },165 },
166 .x86_64 => switch (target.os.tag) {166 .x86_64 => switch (target.os.tag) {
167 .linux => target.abi != .gnux32 and target.abi != .muslx32,167 .linux => switch (target.abi) {
168 .gnux32, .muslx32, .x32 => false,
169 else => true,
170 },
168 .freebsd, .illumos => true,171 .freebsd, .illumos => true,
169 .windows => !ofmt_c_msvc,172 .windows => !ofmt_c_msvc,
170 else => false,173 else => false,
...@@ -700,7 +703,7 @@ pub fn llvmMachineAbi(target: *const std.Target) ?[:0]const u8 {...@@ -700,7 +703,7 @@ pub fn llvmMachineAbi(target: *const std.Target) ?[:0]const u8 {
700 },703 },
701 .mips, .mipsel => "o32",704 .mips, .mipsel => "o32",
702 .mips64, .mips64el => switch (target.abi) {705 .mips64, .mips64el => switch (target.abi) {
703 .gnuabin32, .muslabin32 => "n32",706 .gnuabin32, .muslabin32, .abin32 => "n32",
704 else => "n64",707 else => "n64",
705 },708 },
706 .powerpc64 => if (target.os.tag == .ps3) "elfv1" else "elfv2",709 .powerpc64 => if (target.os.tag == .ps3) "elfv1" else "elfv2",
test/behavior/basic.zig+1-1
...@@ -1145,7 +1145,7 @@ test "arrays and vectors with big integers" {...@@ -1145,7 +1145,7 @@ test "arrays and vectors with big integers" {
1145 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;1145 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
1146 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;1146 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1147 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1147 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1148 if (builtin.zig_backend == .stage2_llvm and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/238051148 if (builtin.zig_backend == .stage2_llvm and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32 or builtin.abi == .abin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23805
11491149
1150 inline for (.{ u65528, u65529, u65535 }) |Int| {1150 inline for (.{ u65528, u65529, u65535 }) |Int| {
1151 var a: [1]Int = undefined;1151 var a: [1]Int = undefined;
test/llvm_targets.zig+3
...@@ -159,6 +159,7 @@ const targets = [_]std.Target.Query{...@@ -159,6 +159,7 @@ const targets = [_]std.Target.Query{
159 .{ .cpu_arch = .mipsel, .os_tag = .rtems, .abi = .eabihf },159 .{ .cpu_arch = .mipsel, .os_tag = .rtems, .abi = .eabihf },
160160
161 .{ .cpu_arch = .mips64, .os_tag = .freestanding, .abi = .none },161 .{ .cpu_arch = .mips64, .os_tag = .freestanding, .abi = .none },
162 .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .abin32 },
162 .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .gnuabi64 },163 .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .gnuabi64 },
163 .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .gnuabin32 },164 .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .gnuabin32 },
164 .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .muslabi64 },165 .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .muslabi64 },
...@@ -167,6 +168,7 @@ const targets = [_]std.Target.Query{...@@ -167,6 +168,7 @@ const targets = [_]std.Target.Query{
167 .{ .cpu_arch = .mips64, .os_tag = .openbsd, .abi = .none },168 .{ .cpu_arch = .mips64, .os_tag = .openbsd, .abi = .none },
168169
169 .{ .cpu_arch = .mips64el, .os_tag = .freestanding, .abi = .none },170 .{ .cpu_arch = .mips64el, .os_tag = .freestanding, .abi = .none },
171 .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .abin32 },
170 .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .gnuabi64 },172 .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .gnuabi64 },
171 .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .gnuabin32 },173 .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .gnuabin32 },
172 .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .muslabi64 },174 .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .muslabi64 },
...@@ -331,6 +333,7 @@ const targets = [_]std.Target.Query{...@@ -331,6 +333,7 @@ const targets = [_]std.Target.Query{
331 .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .muslx32 },333 .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .muslx32 },
332 .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .none },334 .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .none },
333 .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .ohos },335 .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .ohos },
336 .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .x32 },
334 .{ .cpu_arch = .x86_64, .os_tag = .maccatalyst, .abi = .none },337 .{ .cpu_arch = .x86_64, .os_tag = .maccatalyst, .abi = .none },
335 .{ .cpu_arch = .x86_64, .os_tag = .macos, .abi = .none },338 .{ .cpu_arch = .x86_64, .os_tag = .macos, .abi = .none },
336 .{ .cpu_arch = .x86_64, .os_tag = .netbsd, .abi = .none },339 .{ .cpu_arch = .x86_64, .os_tag = .netbsd, .abi = .none },
test/tests.zig+33-9
...@@ -621,6 +621,14 @@ const module_test_targets = blk: {...@@ -621,6 +621,14 @@ const module_test_targets = blk: {
621 .abi = .none,621 .abi = .none,
622 },622 },
623 },623 },
624 .{
625 .target = .{
626 .cpu_arch = .mips64,
627 .os_tag = .linux,
628 .abi = .abin32,
629 },
630 .extra_target = true,
631 },
624 .{632 .{
625 .target = .{633 .target = .{
626 .cpu_arch = .mips64,634 .cpu_arch = .mips64,
...@@ -683,6 +691,14 @@ const module_test_targets = blk: {...@@ -683,6 +691,14 @@ const module_test_targets = blk: {
683 .abi = .none,691 .abi = .none,
684 },692 },
685 },693 },
694 .{
695 .target = .{
696 .cpu_arch = .mips64el,
697 .os_tag = .linux,
698 .abi = .abin32,
699 },
700 .extra_target = true,
701 },
686 .{702 .{
687 .target = .{703 .target = .{
688 .cpu_arch = .mips64el,704 .cpu_arch = .mips64el,
...@@ -1149,18 +1165,17 @@ const module_test_targets = blk: {...@@ -1149,18 +1165,17 @@ const module_test_targets = blk: {
1149 .target = .{1165 .target = .{
1150 .cpu_arch = .x86_64,1166 .cpu_arch = .x86_64,
1151 .os_tag = .linux,1167 .os_tag = .linux,
1152 .abi = .gnu,1168 .abi = .x32,
1153 },1169 },
1154 .link_libc = true,1170 .extra_target = true,
1155 },1171 },
1156 .{1172 .{
1157 .target = .{1173 .target = .{
1158 .cpu_arch = .x86_64,1174 .cpu_arch = .x86_64,
1159 .os_tag = .linux,1175 .os_tag = .linux,
1160 .abi = .gnux32,1176 .abi = .musl,
1161 },1177 },
1162 .link_libc = true,1178 .link_libc = true,
1163 .extra_target = true,
1164 },1179 },
1165 .{1180 .{
1166 .target = .{1181 .target = .{
...@@ -1168,7 +1183,9 @@ const module_test_targets = blk: {...@@ -1168,7 +1183,9 @@ const module_test_targets = blk: {
1168 .os_tag = .linux,1183 .os_tag = .linux,
1169 .abi = .musl,1184 .abi = .musl,
1170 },1185 },
1186 .linkage = .dynamic,
1171 .link_libc = true,1187 .link_libc = true,
1188 .extra_target = true,
1172 },1189 },
1173 .{1190 .{
1174 .target = .{1191 .target = .{
...@@ -1176,9 +1193,9 @@ const module_test_targets = blk: {...@@ -1176,9 +1193,9 @@ const module_test_targets = blk: {
1176 .os_tag = .linux,1193 .os_tag = .linux,
1177 .abi = .musl,1194 .abi = .musl,
1178 },1195 },
1179 .linkage = .dynamic,
1180 .link_libc = true,1196 .link_libc = true,
1181 .extra_target = true,1197 .use_llvm = true,
1198 .use_lld = false,
1182 },1199 },
1183 .{1200 .{
1184 .target = .{1201 .target = .{
...@@ -1203,11 +1220,18 @@ const module_test_targets = blk: {...@@ -1203,11 +1220,18 @@ const module_test_targets = blk: {
1203 .target = .{1220 .target = .{
1204 .cpu_arch = .x86_64,1221 .cpu_arch = .x86_64,
1205 .os_tag = .linux,1222 .os_tag = .linux,
1206 .abi = .musl,1223 .abi = .gnu,
1207 },1224 },
1208 .link_libc = true,1225 .link_libc = true,
1209 .use_llvm = true,1226 },
1210 .use_lld = false,1227 .{
1228 .target = .{
1229 .cpu_arch = .x86_64,
1230 .os_tag = .linux,
1231 .abi = .gnux32,
1232 },
1233 .link_libc = true,
1234 .extra_target = true,
1211 },1235 },
12121236
1213 // Darwin Targets1237 // Darwin Targets