| ... | @@ -2351,7 +2351,6 @@ pub const DynamicLinker = struct { | ... | @@ -2351,7 +2351,6 @@ pub const DynamicLinker = struct { |
| 2351 | // TODO: `700` ABI support. | 2351 | // TODO: `700` ABI support. |
| 2352 | .arc => if (abi == .gnu) init("/lib/ld-linux-arc.so.2") else none, | 2352 | .arc => if (abi == .gnu) init("/lib/ld-linux-arc.so.2") else none, |
| 2353 | | 2353 | |
| 2354 | // TODO: OABI support (`/lib/ld-linux.so.2`). | | |
| 2355 | .arm, | 2354 | .arm, |
| 2356 | .armeb, | 2355 | .armeb, |
| 2357 | .thumb, | 2356 | .thumb, |
| ... | @@ -2676,6 +2675,10 @@ pub fn stackAlignment(target: Target) u16 { | ... | @@ -2676,6 +2675,10 @@ pub fn stackAlignment(target: Target) u16 { |
| 2676 | => return 2, | 2675 | => return 2, |
| 2677 | .amdgcn, | 2676 | .amdgcn, |
| 2678 | => return 4, | 2677 | => return 4, |
| | 2678 | .arm, |
| | 2679 | .armeb, |
| | 2680 | .thumb, |
| | 2681 | .thumbeb, |
| 2679 | .lanai, | 2682 | .lanai, |
| 2680 | .mips, | 2683 | .mips, |
| 2681 | .mipsel, | 2684 | .mipsel, |
| ... | @@ -2694,17 +2697,8 @@ pub fn stackAlignment(target: Target) u16 { | ... | @@ -2694,17 +2697,8 @@ pub fn stackAlignment(target: Target) u16 { |
| 2694 | .wasm32, | 2697 | .wasm32, |
| 2695 | .wasm64, | 2698 | .wasm64, |
| 2696 | => return 16, | 2699 | => return 16, |
| 2697 | // Some of the following prongs should really be testing the ABI (e.g. for Arm, it's APCS vs | 2700 | // Some of the following prongs should really be testing the ABI, but our current `Abi` enum |
| 2698 | // AAPCS16 vs AAPCS). But our current Abi enum is not able to handle that level of nuance. | 2701 | // can't handle that level of nuance yet. |
| 2699 | .arm, | | |
| 2700 | .armeb, | | |
| 2701 | .thumb, | | |
| 2702 | .thumbeb, | | |
| 2703 | => switch (target.os.tag) { | | |
| 2704 | .netbsd => {}, | | |
| 2705 | .watchos => return 16, | | |
| 2706 | else => return 8, | | |
| 2707 | }, | | |
| 2708 | .powerpc64, | 2702 | .powerpc64, |
| 2709 | .powerpc64le, | 2703 | .powerpc64le, |
| 2710 | => if (target.os.tag == .linux or target.os.tag == .aix) return 16, | 2704 | => if (target.os.tag == .linux or target.os.tag == .aix) return 16, |
| ... | @@ -3045,11 +3039,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { | ... | @@ -3045,11 +3039,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 3045 | .short, .ushort => return 16, | 3039 | .short, .ushort => return 16, |
| 3046 | .int, .uint, .float => return 32, | 3040 | .int, .uint, .float => return 32, |
| 3047 | .long, .ulong => switch (target.cpu.arch) { | 3041 | .long, .ulong => switch (target.cpu.arch) { |
| 3048 | .x86, .arm => return 32, | 3042 | .x86_64 => return 64, |
| 3049 | .x86_64 => switch (target.abi) { | | |
| 3050 | .gnux32, .muslx32 => return 32, | | |
| 3051 | else => return 64, | | |
| 3052 | }, | | |
| 3053 | else => switch (target.abi) { | 3043 | else => switch (target.abi) { |
| 3054 | .ilp32 => return 32, | 3044 | .ilp32 => return 32, |
| 3055 | else => return 64, | 3045 | else => return 64, |
| ... | @@ -3057,11 +3047,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { | ... | @@ -3057,11 +3047,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 3057 | }, | 3047 | }, |
| 3058 | .longlong, .ulonglong, .double => return 64, | 3048 | .longlong, .ulonglong, .double => return 64, |
| 3059 | .longdouble => switch (target.cpu.arch) { | 3049 | .longdouble => switch (target.cpu.arch) { |
| 3060 | .aarch64 => return 64, | | |
| 3061 | .x86 => switch (target.abi) { | | |
| 3062 | .android => return 64, | | |
| 3063 | else => return 80, | | |
| 3064 | }, | | |
| 3065 | .x86_64 => return 80, | 3050 | .x86_64 => return 80, |
| 3066 | else => return 64, | 3051 | else => return 64, |
| 3067 | }, | 3052 | }, |
| ... | @@ -3111,7 +3096,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { | ... | @@ -3111,7 +3096,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 3111 | .ps3, | 3096 | .ps3, |
| 3112 | .contiki, | 3097 | .contiki, |
| 3113 | .opengl, | 3098 | .opengl, |
| 3114 | => @panic("TODO specify the C integer and float type sizes for this OS"), | 3099 | => @panic("specify the C integer and float type sizes for this OS"), |
| 3115 | } | 3100 | } |
| 3116 | } | 3101 | } |
| 3117 | | 3102 | |
| ... | @@ -3155,24 +3140,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { | ... | @@ -3155,24 +3140,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 3155 | return @min( | 3140 | return @min( |
| 3156 | std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8), | 3141 | std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8), |
| 3157 | @as(u16, switch (target.cpu.arch) { | 3142 | @as(u16, switch (target.cpu.arch) { |
| 3158 | .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { | | |
| 3159 | .netbsd => switch (target.abi) { | | |
| 3160 | .gnueabi, | | |
| 3161 | .gnueabihf, | | |
| 3162 | .eabi, | | |
| 3163 | .eabihf, | | |
| 3164 | .android, | | |
| 3165 | .androideabi, | | |
| 3166 | .musleabi, | | |
| 3167 | .musleabihf, | | |
| 3168 | => 8, | | |
| 3169 | | | |
| 3170 | else => 4, | | |
| 3171 | }, | | |
| 3172 | .ios, .tvos, .watchos, .visionos => 4, | | |
| 3173 | else => 8, | | |
| 3174 | }, | | |
| 3175 | | | |
| 3176 | .msp430, | 3143 | .msp430, |
| 3177 | => 2, | 3144 | => 2, |
| 3178 | | 3145 | |
| ... | @@ -3187,6 +3154,10 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { | ... | @@ -3187,6 +3154,10 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 3187 | .propeller2, | 3154 | .propeller2, |
| 3188 | => 4, | 3155 | => 4, |
| 3189 | | 3156 | |
| | 3157 | .arm, |
| | 3158 | .armeb, |
| | 3159 | .thumb, |
| | 3160 | .thumbeb, |
| 3190 | .amdgcn, | 3161 | .amdgcn, |
| 3191 | .bpfel, | 3162 | .bpfel, |
| 3192 | .bpfeb, | 3163 | .bpfeb, |
| ... | @@ -3232,29 +3203,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { | ... | @@ -3232,29 +3203,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 3232 | pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { | 3203 | pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { |
| 3233 | // Overrides for unusual alignments | 3204 | // Overrides for unusual alignments |
| 3234 | switch (target.cpu.arch) { | 3205 | switch (target.cpu.arch) { |
| 3235 | .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { | | |
| 3236 | .netbsd => switch (target.abi) { | | |
| 3237 | .gnueabi, | | |
| 3238 | .gnueabihf, | | |
| 3239 | .eabi, | | |
| 3240 | .eabihf, | | |
| 3241 | .android, | | |
| 3242 | .androideabi, | | |
| 3243 | .musleabi, | | |
| 3244 | .musleabihf, | | |
| 3245 | => {}, | | |
| 3246 | | | |
| 3247 | else => switch (c_type) { | | |
| 3248 | .longdouble => return 4, | | |
| 3249 | else => {}, | | |
| 3250 | }, | | |
| 3251 | }, | | |
| 3252 | .ios, .tvos, .watchos, .visionos => switch (c_type) { | | |
| 3253 | .longdouble => return 4, | | |
| 3254 | else => {}, | | |
| 3255 | }, | | |
| 3256 | else => {}, | | |
| 3257 | }, | | |
| 3258 | .arc => switch (c_type) { | 3206 | .arc => switch (c_type) { |
| 3259 | .longdouble => return 4, | 3207 | .longdouble => return 4, |
| 3260 | else => {}, | 3208 | else => {}, |
| ... | @@ -3366,13 +3314,9 @@ pub fn cCallingConvention(target: Target) ?std.builtin.CallingConvention { | ... | @@ -3366,13 +3314,9 @@ pub fn cCallingConvention(target: Target) ?std.builtin.CallingConvention { |
| 3366 | .windows => .{ .aarch64_aapcs_win = .{} }, | 3314 | .windows => .{ .aarch64_aapcs_win = .{} }, |
| 3367 | else => .{ .aarch64_aapcs = .{} }, | 3315 | else => .{ .aarch64_aapcs = .{} }, |
| 3368 | }, | 3316 | }, |
| 3369 | .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { | 3317 | .arm, .armeb, .thumb, .thumbeb => switch (target.abi.floatAbi()) { |
| 3370 | .netbsd => .{ .arm_apcs = .{} }, | 3318 | .soft => .{ .arm_aapcs = .{} }, |
| 3371 | .watchos => .{ .arm_aapcs16_vfp = .{} }, | 3319 | .hard => .{ .arm_aapcs_vfp = .{} }, |
| 3372 | else => switch (target.abi.floatAbi()) { | | |
| 3373 | .soft => .{ .arm_aapcs = .{} }, | | |
| 3374 | .hard => .{ .arm_aapcs_vfp = .{} }, | | |
| 3375 | }, | | |
| 3376 | }, | 3320 | }, |
| 3377 | .mips64, .mips64el => switch (target.abi) { | 3321 | .mips64, .mips64el => switch (target.abi) { |
| 3378 | .gnuabin32 => .{ .mips64_n32 = .{} }, | 3322 | .gnuabin32 => .{ .mips64_n32 = .{} }, |