| author | |
| committer | |
| log | 6aaea5af415a821ee134b23cc468d32695c3063d |
| tree | 1e7ace5b8fa039ed75397c5206bd2cbc13cd44af |
| parent | 18d5cd67ce3759cbc1997279ee3b03dd2bb9aa72 |
| signature |
We only had gnu/musl variants of these previously.13 files changed, 119 insertions(+), 92 deletions(-)
lib/std/Build/Configuration.zig+6| ... | ... | @@ -2271,6 +2271,8 @@ pub const TargetQuery = struct { |
| 2271 | 2271 | gnux32, |
| 2272 | 2272 | eabi, |
| 2273 | 2273 | eabihf, |
| 2274 | abin32, | |
| 2275 | x32, | |
| 2274 | 2276 | ilp32, |
| 2275 | 2277 | android, |
| 2276 | 2278 | androideabi, |
| ... | ... | @@ -2304,6 +2306,8 @@ pub const TargetQuery = struct { |
| 2304 | 2306 | .gnux32 => .gnux32, |
| 2305 | 2307 | .eabi => .eabi, |
| 2306 | 2308 | .eabihf => .eabihf, |
| 2309 | .abin32 => .abin32, | |
| 2310 | .x32 => .x32, | |
| 2307 | 2311 | .ilp32 => .ilp32, |
| 2308 | 2312 | .android => .android, |
| 2309 | 2313 | .androideabi => .androideabi, |
| ... | ... | @@ -2337,6 +2341,8 @@ pub const TargetQuery = struct { |
| 2337 | 2341 | .gnux32 => .gnux32, |
| 2338 | 2342 | .eabi => .eabi, |
| 2339 | 2343 | .eabihf => .eabihf, |
| 2344 | .abin32 => .abin32, | |
| 2345 | .x32 => .x32, | |
| 2340 | 2346 | .ilp32 => .ilp32, |
| 2341 | 2347 | .android => .android, |
| 2342 | 2348 | .androideabi => .androideabi, |
lib/std/Target.zig+76-67| ... | ... | @@ -796,6 +796,8 @@ pub const Abi = enum { |
| 796 | 796 | gnux32, |
| 797 | 797 | eabi, |
| 798 | 798 | eabihf, |
| 799 | abin32, | |
| 800 | x32, | |
| 799 | 801 | ilp32, |
| 800 | 802 | android, |
| 801 | 803 | androideabi, |
| ... | ... | @@ -2924,10 +2926,17 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 { |
| 2924 | 2926 | |
| 2925 | 2927 | pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 { |
| 2926 | 2928 | switch (abi) { |
| 2927 | .gnux32, .muslx32, .gnuabin32, .muslabin32, .ilp32 => return 32, | |
| 2928 | .gnuabi64, .muslabi64 => return 64, | |
| 2929 | .gnux32, | |
| 2930 | .muslx32, | |
| 2931 | .x32, | |
| 2932 | .gnuabin32, | |
| 2933 | .muslabin32, | |
| 2934 | .abin32, | |
| 2935 | .ilp32, | |
| 2936 | => return 32, | |
| 2929 | 2937 | else => {}, |
| 2930 | 2938 | } |
| 2939 | ||
| 2931 | 2940 | return switch (cpu_arch) { |
| 2932 | 2941 | .avr, |
| 2933 | 2942 | .msp430, |
| ... | ... | @@ -3006,12 +3015,12 @@ pub fn ptrBitWidth(target: *const Target) u16 { |
| 3006 | 3015 | pub fn stackAlignment(target: *const Target) u16 { |
| 3007 | 3016 | // Overrides for when the stack alignment is not equal to the pointer width. |
| 3008 | 3017 | switch (target.cpu.arch) { |
| 3009 | .ez80, | |
| 3010 | => return 1, | |
| 3011 | .m68k, | |
| 3012 | => return 2, | |
| 3013 | .amdgcn, | |
| 3014 | => return 4, | |
| 3018 | .ez80 => return 1, | |
| 3019 | ||
| 3020 | .m68k => return 2, | |
| 3021 | ||
| 3022 | .amdgcn => return 4, | |
| 3023 | ||
| 3015 | 3024 | .arm, |
| 3016 | 3025 | .armeb, |
| 3017 | 3026 | .hppa, |
| ... | ... | @@ -3022,6 +3031,7 @@ pub fn stackAlignment(target: *const Target) u16 { |
| 3022 | 3031 | .thumb, |
| 3023 | 3032 | .thumbeb, |
| 3024 | 3033 | => return 8, |
| 3034 | ||
| 3025 | 3035 | .aarch64, |
| 3026 | 3036 | .aarch64_be, |
| 3027 | 3037 | .alpha, |
| ... | ... | @@ -3038,18 +3048,23 @@ pub fn stackAlignment(target: *const Target) u16 { |
| 3038 | 3048 | .wasm64, |
| 3039 | 3049 | .x86_64, |
| 3040 | 3050 | => return 16, |
| 3051 | ||
| 3041 | 3052 | // Some of the following prongs should really be testing the ABI, but our current `Abi` enum |
| 3042 | 3053 | // can't handle that level of nuance yet. |
| 3043 | 3054 | .powerpc64, |
| 3044 | 3055 | .powerpc64le, |
| 3045 | 3056 | => if (target.os.tag == .linux) return 16, |
| 3057 | ||
| 3046 | 3058 | .riscv32, |
| 3047 | 3059 | .riscv32be, |
| 3048 | 3060 | .riscv64, |
| 3049 | 3061 | .riscv64be, |
| 3050 | 3062 | => if (!target.cpu.has(.riscv, .e)) return 16, |
| 3063 | ||
| 3051 | 3064 | .x86 => if (target.os.tag != .windows and target.os.tag != .uefi) return 16, |
| 3065 | ||
| 3052 | 3066 | .kvx => return 32, |
| 3067 | ||
| 3053 | 3068 | else => {}, |
| 3054 | 3069 | } |
| 3055 | 3070 | |
| ... | ... | @@ -3152,7 +3167,9 @@ pub fn cTypeByteSize(t: *const Target, c_type: CType) u16 { |
| 3152 | 3167 | pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3153 | 3168 | switch (target.os.tag) { |
| 3154 | 3169 | .freestanding, .other => switch (target.cpu.arch) { |
| 3155 | .msp430, .x86_16 => switch (c_type) { | |
| 3170 | .msp430, | |
| 3171 | .x86_16, | |
| 3172 | => switch (c_type) { | |
| 3156 | 3173 | .char => return 8, |
| 3157 | 3174 | .short, .ushort, .int, .uint => return 16, |
| 3158 | 3175 | .float, .long, .ulong => return 32, |
| ... | ... | @@ -3164,12 +3181,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3164 | 3181 | .long, .ulong, .float, .double, .longdouble => return 32, |
| 3165 | 3182 | .longlong, .ulonglong => return 64, |
| 3166 | 3183 | }, |
| 3167 | .mips64, .mips64el => switch (c_type) { | |
| 3184 | .mips64, | |
| 3185 | .mips64el, | |
| 3186 | => switch (c_type) { | |
| 3168 | 3187 | .char => return 8, |
| 3169 | 3188 | .short, .ushort => return 16, |
| 3170 | 3189 | .int, .uint, .float => return 32, |
| 3171 | 3190 | .long, .ulong => switch (target.abi) { |
| 3172 | .gnuabin32, .muslabin32 => return 32, | |
| 3191 | .abin32 => return 32, | |
| 3173 | 3192 | else => return 64, |
| 3174 | 3193 | }, |
| 3175 | 3194 | .longlong, .ulonglong, .double => return 64, |
| ... | ... | @@ -3180,7 +3199,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3180 | 3199 | .short, .ushort => return 16, |
| 3181 | 3200 | .int, .uint, .float => return 32, |
| 3182 | 3201 | .long, .ulong => switch (target.abi) { |
| 3183 | .gnux32, .muslx32 => return 32, | |
| 3202 | .x32 => return 32, | |
| 3184 | 3203 | else => return 64, |
| 3185 | 3204 | }, |
| 3186 | 3205 | .longlong, .ulonglong, .double => return 64, |
| ... | ... | @@ -3193,25 +3212,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3193 | 3212 | .long, .ulong => return target.ptrBitWidth(), |
| 3194 | 3213 | .longlong, .ulonglong, .double => return 64, |
| 3195 | 3214 | .longdouble => switch (target.cpu.arch) { |
| 3196 | .x86 => switch (target.abi) { | |
| 3197 | .android => return 64, | |
| 3198 | else => return 80, | |
| 3199 | }, | |
| 3200 | ||
| 3201 | .powerpc, | |
| 3202 | .powerpcle, | |
| 3203 | .powerpc64, | |
| 3204 | .powerpc64le, | |
| 3205 | => switch (target.abi) { | |
| 3206 | .musl, | |
| 3207 | .muslabin32, | |
| 3208 | .muslabi64, | |
| 3209 | .musleabi, | |
| 3210 | .musleabihf, | |
| 3211 | .muslx32, | |
| 3212 | => return 64, | |
| 3213 | else => return 128, | |
| 3214 | }, | |
| 3215 | .x86 => return 80, | |
| 3215 | 3216 | |
| 3216 | 3217 | .alpha, |
| 3217 | 3218 | .riscv32, |
| ... | ... | @@ -3220,6 +3221,10 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3220 | 3221 | .riscv64be, |
| 3221 | 3222 | .aarch64, |
| 3222 | 3223 | .aarch64_be, |
| 3224 | .powerpc, | |
| 3225 | .powerpcle, | |
| 3226 | .powerpc64, | |
| 3227 | .powerpc64le, | |
| 3223 | 3228 | .s390x, |
| 3224 | 3229 | .sparc64, |
| 3225 | 3230 | .wasm32, |
| ... | ... | @@ -3253,23 +3258,25 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3253 | 3258 | .wasi, |
| 3254 | 3259 | .emscripten, |
| 3255 | 3260 | => switch (target.cpu.arch) { |
| 3256 | .mips64, .mips64el => switch (c_type) { | |
| 3261 | .mips64, | |
| 3262 | .mips64el, | |
| 3263 | => switch (c_type) { | |
| 3257 | 3264 | .char => return 8, |
| 3258 | 3265 | .short, .ushort => return 16, |
| 3259 | 3266 | .int, .uint, .float => return 32, |
| 3260 | 3267 | .long, .ulong => switch (target.abi) { |
| 3261 | .gnuabin32, .muslabin32 => return 32, | |
| 3268 | .gnuabin32, .muslabin32, .abin32 => return 32, | |
| 3262 | 3269 | else => return 64, |
| 3263 | 3270 | }, |
| 3264 | 3271 | .longlong, .ulonglong, .double => return 64, |
| 3265 | .longdouble => if (target.os.tag == .freebsd) return 64 else return 128, | |
| 3272 | .longdouble => return 128, | |
| 3266 | 3273 | }, |
| 3267 | 3274 | .x86_64 => switch (c_type) { |
| 3268 | 3275 | .char => return 8, |
| 3269 | 3276 | .short, .ushort => return 16, |
| 3270 | 3277 | .int, .uint, .float => return 32, |
| 3271 | 3278 | .long, .ulong => switch (target.abi) { |
| 3272 | .gnux32, .muslx32 => return 32, | |
| 3279 | .gnux32, .muslx32, .x32 => return 32, | |
| 3273 | 3280 | else => return 64, |
| 3274 | 3281 | }, |
| 3275 | 3282 | .longlong, .ulonglong, .double => return 64, |
| ... | ... | @@ -3290,15 +3297,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3290 | 3297 | .powerpc, |
| 3291 | 3298 | .powerpcle, |
| 3292 | 3299 | => switch (target.abi) { |
| 3293 | .musl, | |
| 3294 | .muslabin32, | |
| 3295 | .muslabi64, | |
| 3296 | .musleabi, | |
| 3297 | .musleabihf, | |
| 3298 | .muslx32, | |
| 3299 | => return 64, | |
| 3300 | .musleabi, .musleabihf => return 64, | |
| 3300 | 3301 | else => switch (target.os.tag) { |
| 3301 | .freebsd, .netbsd, .openbsd => return 64, | |
| 3302 | .netbsd, | |
| 3303 | .openbsd, | |
| 3304 | => return 64, | |
| 3302 | 3305 | else => return 128, |
| 3303 | 3306 | }, |
| 3304 | 3307 | }, |
| ... | ... | @@ -3306,15 +3309,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3306 | 3309 | .powerpc64, |
| 3307 | 3310 | .powerpc64le, |
| 3308 | 3311 | => switch (target.abi) { |
| 3309 | .musl, | |
| 3310 | .muslabin32, | |
| 3311 | .muslabi64, | |
| 3312 | .musleabi, | |
| 3313 | .musleabihf, | |
| 3314 | .muslx32, | |
| 3315 | => return 64, | |
| 3312 | .musl => return 64, | |
| 3316 | 3313 | else => switch (target.os.tag) { |
| 3317 | .freebsd, .openbsd => return 64, | |
| 3314 | .freebsd, | |
| 3315 | .openbsd, | |
| 3316 | => return 64, | |
| 3318 | 3317 | else => return 128, |
| 3319 | 3318 | }, |
| 3320 | 3319 | }, |
| ... | ... | @@ -3350,7 +3349,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3350 | 3349 | .long, .ulong => return 32, |
| 3351 | 3350 | .longlong, .ulonglong, .double => return 64, |
| 3352 | 3351 | .longdouble => switch (target.abi) { |
| 3353 | .gnu, .ilp32 => return 80, | |
| 3352 | .gnu => return 80, | |
| 3354 | 3353 | else => return 64, |
| 3355 | 3354 | }, |
| 3356 | 3355 | }, |
| ... | ... | @@ -3361,7 +3360,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3361 | 3360 | .long, .ulong => return 32, |
| 3362 | 3361 | .longlong, .ulonglong, .double => return 64, |
| 3363 | 3362 | .longdouble => switch (target.abi) { |
| 3364 | .gnu, .ilp32 => return 80, | |
| 3363 | .gnu => return 80, | |
| 3365 | 3364 | else => return 64, |
| 3366 | 3365 | }, |
| 3367 | 3366 | }, |
| ... | ... | @@ -3480,12 +3479,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3480 | 3479 | pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { |
| 3481 | 3480 | // Overrides for unusual alignments |
| 3482 | 3481 | switch (target.cpu.arch) { |
| 3483 | .avr, .ez80 => return 1, | |
| 3482 | .avr, | |
| 3483 | .ez80, | |
| 3484 | => return 1, | |
| 3484 | 3485 | .x86 => switch (target.os.tag) { |
| 3485 | 3486 | .windows, .uefi => switch (c_type) { |
| 3486 | 3487 | .longlong, .ulonglong, .double => return 8, |
| 3487 | 3488 | .longdouble => switch (target.abi) { |
| 3488 | .gnu, .ilp32 => return 4, | |
| 3489 | .gnu => return 4, | |
| 3489 | 3490 | else => return 8, |
| 3490 | 3491 | }, |
| 3491 | 3492 | else => {}, |
| ... | ... | @@ -3510,8 +3511,6 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { |
| 3510 | 3511 | return @min( |
| 3511 | 3512 | std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8), |
| 3512 | 3513 | @as(u16, switch (target.cpu.arch) { |
| 3513 | .ez80 => 1, | |
| 3514 | ||
| 3515 | 3514 | .msp430, |
| 3516 | 3515 | .x86_16, |
| 3517 | 3516 | => 2, |
| ... | ... | @@ -3579,6 +3578,7 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { |
| 3579 | 3578 | => 16, |
| 3580 | 3579 | |
| 3581 | 3580 | .avr, |
| 3581 | .ez80, | |
| 3582 | 3582 | => unreachable, // Handled above. |
| 3583 | 3583 | }), |
| 3584 | 3584 | ); |
| ... | ... | @@ -3591,11 +3591,13 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { |
| 3591 | 3591 | .longdouble => return 4, |
| 3592 | 3592 | else => {}, |
| 3593 | 3593 | }, |
| 3594 | .avr, .ez80 => return 1, | |
| 3594 | .avr, | |
| 3595 | .ez80, | |
| 3596 | => return 1, | |
| 3595 | 3597 | .x86 => switch (target.os.tag) { |
| 3596 | 3598 | .windows, .uefi => switch (c_type) { |
| 3597 | 3599 | .longdouble => switch (target.abi) { |
| 3598 | .gnu, .ilp32 => return 4, | |
| 3600 | .gnu => return 4, | |
| 3599 | 3601 | else => return 8, |
| 3600 | 3602 | }, |
| 3601 | 3603 | else => {}, |
| ... | ... | @@ -3623,9 +3625,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { |
| 3623 | 3625 | return @min( |
| 3624 | 3626 | std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8), |
| 3625 | 3627 | @as(u16, switch (target.cpu.arch) { |
| 3626 | .ez80 => 1, | |
| 3627 | ||
| 3628 | .x86_16, .msp430 => 2, | |
| 3628 | .x86_16, | |
| 3629 | .msp430, | |
| 3630 | => 2, | |
| 3629 | 3631 | |
| 3630 | 3632 | .arc, |
| 3631 | 3633 | .arceb, |
| ... | ... | @@ -3690,6 +3692,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { |
| 3690 | 3692 | => 16, |
| 3691 | 3693 | |
| 3692 | 3694 | .avr, |
| 3695 | .ez80, | |
| 3693 | 3696 | => unreachable, // Handled above. |
| 3694 | 3697 | }), |
| 3695 | 3698 | ); |
| ... | ... | @@ -3701,7 +3704,9 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { |
| 3701 | 3704 | .ez80, |
| 3702 | 3705 | => 1, |
| 3703 | 3706 | |
| 3704 | .msp430, .x86_16 => 2, | |
| 3707 | .msp430, | |
| 3708 | .x86_16, | |
| 3709 | => 2, | |
| 3705 | 3710 | |
| 3706 | 3711 | .arc, |
| 3707 | 3712 | .arceb, |
| ... | ... | @@ -3770,14 +3775,18 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { |
| 3770 | 3775 | pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention { |
| 3771 | 3776 | return switch (target.cpu.arch) { |
| 3772 | 3777 | .x86_64 => switch (target.os.tag) { |
| 3773 | .windows, .uefi => .{ .x86_64_win = .{} }, | |
| 3778 | .windows, | |
| 3779 | .uefi, | |
| 3780 | => .{ .x86_64_win = .{} }, | |
| 3774 | 3781 | else => switch (target.abi) { |
| 3775 | .gnux32, .muslx32 => .{ .x86_64_x32 = .{} }, | |
| 3782 | .gnux32, .muslx32, .x32 => .{ .x86_64_x32 = .{} }, | |
| 3776 | 3783 | else => .{ .x86_64_sysv = .{} }, |
| 3777 | 3784 | }, |
| 3778 | 3785 | }, |
| 3779 | 3786 | .x86 => switch (target.os.tag) { |
| 3780 | .windows, .uefi => .{ .x86_win = .{} }, | |
| 3787 | .windows, | |
| 3788 | .uefi, | |
| 3789 | => .{ .x86_win = .{} }, | |
| 3781 | 3790 | else => .{ .x86_sysv = .{} }, |
| 3782 | 3791 | }, |
| 3783 | 3792 | .x86_16 => .{ .x86_16_cdecl = .{} }, |
| ... | ... | @@ -3793,7 +3802,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention |
| 3793 | 3802 | .hard => .{ .arm_aapcs_vfp = .{} }, |
| 3794 | 3803 | }, |
| 3795 | 3804 | .mips64, .mips64el => switch (target.abi) { |
| 3796 | .gnuabin32, .muslabin32 => .{ .mips64_n32 = .{} }, | |
| 3805 | .gnuabin32, .muslabin32, .abin32 => .{ .mips64_n32 = .{} }, | |
| 3797 | 3806 | else => .{ .mips64_n64 = .{} }, |
| 3798 | 3807 | }, |
| 3799 | 3808 | .mips, .mipsel => .{ .mips_o32 = .{} }, |
lib/std/Thread.zig+2-2| ... | ... | @@ -1171,7 +1171,7 @@ const LinuxThreadImpl = struct { |
| 1171 | 1171 | [len] "{ecx}" (self.mapped.len), |
| 1172 | 1172 | ), |
| 1173 | 1173 | .x86_64 => asm volatile (switch (target.abi) { |
| 1174 | .gnux32, .muslx32 => | |
| 1174 | .gnux32, .muslx32, .x32 => | |
| 1175 | 1175 | \\ movl $0x4000000b, %%eax # SYS_munmap |
| 1176 | 1176 | \\ syscall |
| 1177 | 1177 | \\ movl $0x4000003c, %%eax # SYS_exit |
| ... | ... | @@ -1286,7 +1286,7 @@ const LinuxThreadImpl = struct { |
| 1286 | 1286 | [len] "{$5}" (self.mapped.len), |
| 1287 | 1287 | ), |
| 1288 | 1288 | .mips64, .mips64el => asm volatile (switch (target.abi) { |
| 1289 | .gnuabin32, .muslabin32 => | |
| 1289 | .gnuabin32, .muslabin32, .abin32 => | |
| 1290 | 1290 | \\ li $v0, 6011 # SYS_munmap |
| 1291 | 1291 | \\ syscall |
| 1292 | 1292 | \\ li $v0, 6058 # SYS_exit |
lib/std/os/linux.zig+10-8| ... | ... | @@ -43,7 +43,7 @@ const arch_bits = switch (native_arch) { |
| 43 | 43 | .microblaze, .microblazeel => @import("linux/microblaze.zig"), |
| 44 | 44 | .mips, .mipsel => @import("linux/mips.zig"), |
| 45 | 45 | .mips64, .mips64el => switch (builtin.abi) { |
| 46 | .gnuabin32, .muslabin32 => @import("linux/mipsn32.zig"), | |
| 46 | .gnuabin32, .muslabin32, .abin32 => @import("linux/mipsn32.zig"), | |
| 47 | 47 | else => @import("linux/mips64.zig"), |
| 48 | 48 | }, |
| 49 | 49 | .or1k => @import("linux/or1k.zig"), |
| ... | ... | @@ -57,7 +57,7 @@ const arch_bits = switch (native_arch) { |
| 57 | 57 | .sparc64 => @import("linux/sparc64.zig"), |
| 58 | 58 | .x86 => @import("linux/x86.zig"), |
| 59 | 59 | .x86_64 => switch (builtin.abi) { |
| 60 | .gnux32, .muslx32 => @import("linux/x32.zig"), | |
| 60 | .gnux32, .muslx32, .x32 => @import("linux/x32.zig"), | |
| 61 | 61 | else => @import("linux/x86_64.zig"), |
| 62 | 62 | }, |
| 63 | 63 | .xtensa, .xtensaeb => @import("linux/xtensa.zig"), |
| ... | ... | @@ -144,7 +144,7 @@ pub const SYS = switch (native_arch) { |
| 144 | 144 | .microblaze, .microblazeel => syscalls.Microblaze, |
| 145 | 145 | .mips, .mipsel => syscalls.MipsO32, |
| 146 | 146 | .mips64, .mips64el => switch (builtin.abi) { |
| 147 | .gnuabin32, .muslabin32 => syscalls.MipsN32, | |
| 147 | .gnuabin32, .muslabin32, .abin32 => syscalls.MipsN32, | |
| 148 | 148 | else => syscalls.MipsN64, |
| 149 | 149 | }, |
| 150 | 150 | .or1k => syscalls.OpenRisc, |
| ... | ... | @@ -158,7 +158,7 @@ pub const SYS = switch (native_arch) { |
| 158 | 158 | .sparc64 => syscalls.Sparc64, |
| 159 | 159 | .x86 => syscalls.X86, |
| 160 | 160 | .x86_64 => switch (builtin.abi) { |
| 161 | .gnux32, .muslx32 => syscalls.X32, | |
| 161 | .gnux32, .muslx32, .x32 => syscalls.X32, | |
| 162 | 162 | else => syscalls.X64, |
| 163 | 163 | }, |
| 164 | 164 | .xtensa, .xtensaeb => syscalls.Xtensa, |
| ... | ... | @@ -1828,8 +1828,10 @@ pub fn lseek(fd: fd_t, offset: off_t, whence: u32) u64 { |
| 1828 | 1828 | return switch (builtin.abi) { |
| 1829 | 1829 | .gnuabin32, |
| 1830 | 1830 | .muslabin32, |
| 1831 | .abin32, | |
| 1831 | 1832 | .gnux32, |
| 1832 | 1833 | .muslx32, |
| 1834 | .x32, | |
| 1833 | 1835 | => syscall_lseek(fd, offset, whence), |
| 1834 | 1836 | else => syscall3(.lseek, @as(u32, @bitCast(fd)), @as(u64, @bitCast(offset)), whence), |
| 1835 | 1837 | }; |
| ... | ... | @@ -2006,7 +2008,7 @@ pub const F = struct { |
| 2006 | 2008 | const SETLKW = 35; |
| 2007 | 2009 | }, |
| 2008 | 2010 | .mips64, .mips64el => switch (native_abi) { |
| 2009 | .gnuabin32, .muslabin32 => struct { | |
| 2011 | .gnuabin32, .muslabin32, .abin32 => struct { | |
| 2010 | 2012 | const GETLK = 33; |
| 2011 | 2013 | const SETLK = 34; |
| 2012 | 2014 | const SETLKW = 35; |
| ... | ... | @@ -3187,7 +3189,7 @@ pub fn tee(src: fd_t, dest: fd_t, len: usize, flags: u32) usize { |
| 3187 | 3189 | } |
| 3188 | 3190 | |
| 3189 | 3191 | pub const Sysinfo = switch (native_abi) { |
| 3190 | .gnux32, .muslx32 => extern struct { | |
| 3192 | .gnux32, .muslx32, .x32 => extern struct { | |
| 3191 | 3193 | /// Seconds since boot |
| 3192 | 3194 | uptime: i64, |
| 3193 | 3195 | /// 1, 5, and 15 minute load averages |
| ... | ... | @@ -10753,11 +10755,11 @@ pub const AUDIT = struct { |
| 10753 | 10755 | .mips => .MIPS, |
| 10754 | 10756 | .mipsel => .MIPSEL, |
| 10755 | 10757 | .mips64 => switch (native_abi) { |
| 10756 | .gnuabin32, .muslabin32 => .MIPS64N32, | |
| 10758 | .gnuabin32, .muslabin32, .abin32 => .MIPS64N32, | |
| 10757 | 10759 | else => .MIPS64, |
| 10758 | 10760 | }, |
| 10759 | 10761 | .mips64el => switch (native_abi) { |
| 10760 | .gnuabin32, .muslabin32 => .MIPSEL64N32, | |
| 10762 | .gnuabin32, .muslabin32, .abin32 => .MIPSEL64N32, | |
| 10761 | 10763 | else => .MIPSEL64, |
| 10762 | 10764 | }, |
| 10763 | 10765 | .or1k => .OPENRISC, |
lib/std/pie.zig+1-1| ... | ... | @@ -162,7 +162,7 @@ inline fn getDynamicSymbol() [*]const elf.Dyn { |
| 162 | 162 | : |
| 163 | 163 | : .{ .lr = true }), |
| 164 | 164 | .mips64, .mips64el => switch (builtin.abi) { |
| 165 | .gnuabin32, .muslabin32 => asm volatile ( | |
| 165 | .gnuabin32, .muslabin32, .abin32 => asm volatile ( | |
| 166 | 166 | \\ .weak _DYNAMIC |
| 167 | 167 | \\ .hidden _DYNAMIC |
| 168 | 168 | \\ bal 1f |
lib/std/start.zig+1-1| ... | ... | @@ -373,7 +373,7 @@ fn _start() callconv(.naked) noreturn { |
| 373 | 373 | \\ jalr $t9 |
| 374 | 374 | , |
| 375 | 375 | .mips64, .mips64el => switch (builtin.abi) { |
| 376 | .gnuabin32, .muslabin32 => | |
| 376 | .gnuabin32, .muslabin32, .abin32 => | |
| 377 | 377 | \\ move $fp, $zero |
| 378 | 378 | \\ bal 1f |
| 379 | 379 | \\ .gpword . |
lib/std/zig/LibCDirs.zig+2| ... | ... | @@ -282,6 +282,8 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 { |
| 282 | 282 | => return "musl", |
| 283 | 283 | .eabi, |
| 284 | 284 | .eabihf, |
| 285 | .abin32, | |
| 286 | .x32, | |
| 285 | 287 | .ilp32, |
| 286 | 288 | .android, |
| 287 | 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 | 104 | => .{ .qemu = switch (t) { |
| 105 | 105 | .x86 => "qemu-i386", |
| 106 | 106 | .x86_64 => switch (candidate.abi) { |
| 107 | .gnux32, .muslx32 => return bad_result, | |
| 107 | .gnux32, .muslx32, .x32 => return bad_result, | |
| 108 | 108 | else => "qemu-x86_64", |
| 109 | 109 | }, |
| 110 | 110 | else => "qemu-" ++ @tagName(t), |
| ... | ... | @@ -146,7 +146,7 @@ pub fn getExternalExecutor(io: Io, candidate: *const std.Target, options: GetExt |
| 146 | 146 | .powerpc64 => "qemu-ppc64", |
| 147 | 147 | .powerpc64le => "qemu-ppc64le", |
| 148 | 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 | 150 | else => "qemu-" ++ @tagName(t), |
| 151 | 151 | }, |
| 152 | 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 | 285 | .ilp32 => "unknown", |
| 286 | 286 | .eabi => "eabi", |
| 287 | 287 | .eabihf => "eabihf", |
| 288 | .abin32 => "unknown", | |
| 289 | .x32 => "muslx32", // https://github.com/ziglang/zig/issues/25649 | |
| 288 | 290 | .android => "android", |
| 289 | 291 | .androideabi => "androideabi", |
| 290 | 292 | .musl => switch (target.os.tag) { |
| ... | ... | @@ -377,11 +379,11 @@ pub fn dataLayout(target: *const std.Target) []const u8 { |
| 377 | 379 | .mips => "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64", |
| 378 | 380 | .mipsel => "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64", |
| 379 | 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 | 383 | else => "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", |
| 382 | 384 | }, |
| 383 | 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 | 387 | else => "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", |
| 386 | 388 | }, |
| 387 | 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 | 448 | .x86_64 => if (target.os.tag.isDarwin() or target.ofmt == .macho) |
| 447 | 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 | 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 | 452 | else => if ((target.os.tag == .windows or target.os.tag == .uefi) and target.ofmt == .coff) |
| 451 | 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 | 454 | else |
src/link/Lld.zig+5-5| ... | ... | @@ -1295,21 +1295,21 @@ fn getLDMOption(target: *const std.Target) ?[]const u8 { |
| 1295 | 1295 | }, |
| 1296 | 1296 | .mips64 => switch (target.os.tag) { |
| 1297 | 1297 | .freebsd => switch (target.abi) { |
| 1298 | .gnuabin32, .muslabin32 => "elf32btsmipn32_fbsd", | |
| 1298 | .gnuabin32, .muslabin32, .abin32 => "elf32btsmipn32_fbsd", | |
| 1299 | 1299 | else => "elf64btsmip_fbsd", |
| 1300 | 1300 | }, |
| 1301 | 1301 | else => switch (target.abi) { |
| 1302 | .gnuabin32, .muslabin32 => "elf32btsmipn32", | |
| 1302 | .gnuabin32, .muslabin32, .abin32 => "elf32btsmipn32", | |
| 1303 | 1303 | else => "elf64btsmip", |
| 1304 | 1304 | }, |
| 1305 | 1305 | }, |
| 1306 | 1306 | .mips64el => switch (target.os.tag) { |
| 1307 | 1307 | .freebsd => switch (target.abi) { |
| 1308 | .gnuabin32, .muslabin32 => "elf32ltsmipn32_fbsd", | |
| 1308 | .gnuabin32, .muslabin32, .abin32 => "elf32ltsmipn32_fbsd", | |
| 1309 | 1309 | else => "elf64ltsmip_fbsd", |
| 1310 | 1310 | }, |
| 1311 | 1311 | else => switch (target.abi) { |
| 1312 | .gnuabin32, .muslabin32 => "elf32ltsmipn32", | |
| 1312 | .gnuabin32, .muslabin32, .abin32 => "elf32ltsmipn32", | |
| 1313 | 1313 | else => "elf64ltsmip", |
| 1314 | 1314 | }, |
| 1315 | 1315 | }, |
| ... | ... | @@ -1336,7 +1336,7 @@ fn getLDMOption(target: *const std.Target) ?[]const u8 { |
| 1336 | 1336 | else => "elf_i386", |
| 1337 | 1337 | }, |
| 1338 | 1338 | .x86_64 => switch (target.abi) { |
| 1339 | .gnux32, .muslx32 => "elf32_x86_64", | |
| 1339 | .gnux32, .muslx32, .x32 => "elf32_x86_64", | |
| 1340 | 1340 | else => "elf_x86_64", |
| 1341 | 1341 | }, |
| 1342 | 1342 | else => null, |
src/target.zig+5-2| ... | ... | @@ -164,7 +164,10 @@ pub fn hasValgrindSupport(target: *const std.Target, backend: std.lang.CompilerB |
| 164 | 164 | else => false, |
| 165 | 165 | }, |
| 166 | 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 | 171 | .freebsd, .illumos => true, |
| 169 | 172 | .windows => !ofmt_c_msvc, |
| 170 | 173 | else => false, |
| ... | ... | @@ -700,7 +703,7 @@ pub fn llvmMachineAbi(target: *const std.Target) ?[:0]const u8 { |
| 700 | 703 | }, |
| 701 | 704 | .mips, .mipsel => "o32", |
| 702 | 705 | .mips64, .mips64el => switch (target.abi) { |
| 703 | .gnuabin32, .muslabin32 => "n32", | |
| 706 | .gnuabin32, .muslabin32, .abin32 => "n32", | |
| 704 | 707 | else => "n64", |
| 705 | 708 | }, |
| 706 | 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 | 1145 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1146 | 1146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 1147 | 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/23805 | |
| 1148 | 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 | |
| 1149 | 1149 | |
| 1150 | 1150 | inline for (.{ u65528, u65529, u65535 }) |Int| { |
| 1151 | 1151 | var a: [1]Int = undefined; |
test/llvm_targets.zig+3| ... | ... | @@ -159,6 +159,7 @@ const targets = [_]std.Target.Query{ |
| 159 | 159 | .{ .cpu_arch = .mipsel, .os_tag = .rtems, .abi = .eabihf }, |
| 160 | 160 | |
| 161 | 161 | .{ .cpu_arch = .mips64, .os_tag = .freestanding, .abi = .none }, |
| 162 | .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .abin32 }, | |
| 162 | 163 | .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .gnuabi64 }, |
| 163 | 164 | .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .gnuabin32 }, |
| 164 | 165 | .{ .cpu_arch = .mips64, .os_tag = .linux, .abi = .muslabi64 }, |
| ... | ... | @@ -167,6 +168,7 @@ const targets = [_]std.Target.Query{ |
| 167 | 168 | .{ .cpu_arch = .mips64, .os_tag = .openbsd, .abi = .none }, |
| 168 | 169 | |
| 169 | 170 | .{ .cpu_arch = .mips64el, .os_tag = .freestanding, .abi = .none }, |
| 171 | .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .abin32 }, | |
| 170 | 172 | .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .gnuabi64 }, |
| 171 | 173 | .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .gnuabin32 }, |
| 172 | 174 | .{ .cpu_arch = .mips64el, .os_tag = .linux, .abi = .muslabi64 }, |
| ... | ... | @@ -331,6 +333,7 @@ const targets = [_]std.Target.Query{ |
| 331 | 333 | .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .muslx32 }, |
| 332 | 334 | .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .none }, |
| 333 | 335 | .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .ohos }, |
| 336 | .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .x32 }, | |
| 334 | 337 | .{ .cpu_arch = .x86_64, .os_tag = .maccatalyst, .abi = .none }, |
| 335 | 338 | .{ .cpu_arch = .x86_64, .os_tag = .macos, .abi = .none }, |
| 336 | 339 | .{ .cpu_arch = .x86_64, .os_tag = .netbsd, .abi = .none }, |