| ... | ... | @@ -2351,7 +2351,6 @@ pub const DynamicLinker = struct { |
| 2351 | 2351 | // TODO: `700` ABI support. |
| 2352 | 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 | 2354 | .arm, |
| 2356 | 2355 | .armeb, |
| 2357 | 2356 | .thumb, |
| ... | ... | @@ -2676,6 +2675,10 @@ pub fn stackAlignment(target: Target) u16 { |
| 2676 | 2675 | => return 2, |
| 2677 | 2676 | .amdgcn, |
| 2678 | 2677 | => return 4, |
| 2678 | .arm, |
| 2679 | .armeb, |
| 2680 | .thumb, |
| 2681 | .thumbeb, |
| 2679 | 2682 | .lanai, |
| 2680 | 2683 | .mips, |
| 2681 | 2684 | .mipsel, |
| ... | ... | @@ -2694,17 +2697,8 @@ pub fn stackAlignment(target: Target) u16 { |
| 2694 | 2697 | .wasm32, |
| 2695 | 2698 | .wasm64, |
| 2696 | 2699 | => return 16, |
| 2697 | | // Some of the following prongs should really be testing the ABI (e.g. for Arm, it's APCS vs |
| 2698 | | // AAPCS16 vs AAPCS). But our current Abi enum is not able to handle that level of nuance. |
| 2699 | | .arm, |
| 2700 | | .armeb, |
| 2701 | | .thumb, |
| 2702 | | .thumbeb, |
| 2703 | | => switch (target.os.tag) { |
| 2704 | | .netbsd => {}, |
| 2705 | | .watchos => return 16, |
| 2706 | | else => return 8, |
| 2707 | | }, |
| 2700 | // Some of the following prongs should really be testing the ABI, but our current `Abi` enum |
| 2701 | // can't handle that level of nuance yet. |
| 2708 | 2702 | .powerpc64, |
| 2709 | 2703 | .powerpc64le, |
| 2710 | 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 | 3039 | .short, .ushort => return 16, |
| 3046 | 3040 | .int, .uint, .float => return 32, |
| 3047 | 3041 | .long, .ulong => switch (target.cpu.arch) { |
| 3048 | | .x86, .arm => return 32, |
| 3049 | | .x86_64 => switch (target.abi) { |
| 3050 | | .gnux32, .muslx32 => return 32, |
| 3051 | | else => return 64, |
| 3052 | | }, |
| 3042 | .x86_64 => return 64, |
| 3053 | 3043 | else => switch (target.abi) { |
| 3054 | 3044 | .ilp32 => return 32, |
| 3055 | 3045 | else => return 64, |
| ... | ... | @@ -3057,11 +3047,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 3057 | 3047 | }, |
| 3058 | 3048 | .longlong, .ulonglong, .double => return 64, |
| 3059 | 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 | 3050 | .x86_64 => return 80, |
| 3066 | 3051 | else => return 64, |
| 3067 | 3052 | }, |
| ... | ... | @@ -3111,7 +3096,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 3111 | 3096 | .ps3, |
| 3112 | 3097 | .contiki, |
| 3113 | 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 | 3140 | return @min( |
| 3156 | 3141 | std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8), |
| 3157 | 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 | 3143 | .msp430, |
| 3177 | 3144 | => 2, |
| 3178 | 3145 | |
| ... | ... | @@ -3187,6 +3154,10 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 3187 | 3154 | .propeller2, |
| 3188 | 3155 | => 4, |
| 3189 | 3156 | |
| 3157 | .arm, |
| 3158 | .armeb, |
| 3159 | .thumb, |
| 3160 | .thumbeb, |
| 3190 | 3161 | .amdgcn, |
| 3191 | 3162 | .bpfel, |
| 3192 | 3163 | .bpfeb, |
| ... | ... | @@ -3232,29 +3203,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 3232 | 3203 | pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { |
| 3233 | 3204 | // Overrides for unusual alignments |
| 3234 | 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 | 3206 | .arc => switch (c_type) { |
| 3259 | 3207 | .longdouble => return 4, |
| 3260 | 3208 | else => {}, |
| ... | ... | @@ -3366,13 +3314,9 @@ pub fn cCallingConvention(target: Target) ?std.builtin.CallingConvention { |
| 3366 | 3314 | .windows => .{ .aarch64_aapcs_win = .{} }, |
| 3367 | 3315 | else => .{ .aarch64_aapcs = .{} }, |
| 3368 | 3316 | }, |
| 3369 | | .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { |
| 3370 | | .netbsd => .{ .arm_apcs = .{} }, |
| 3371 | | .watchos => .{ .arm_aapcs16_vfp = .{} }, |
| 3372 | | else => switch (target.abi.floatAbi()) { |
| 3373 | | .soft => .{ .arm_aapcs = .{} }, |
| 3374 | | .hard => .{ .arm_aapcs_vfp = .{} }, |
| 3375 | | }, |
| 3317 | .arm, .armeb, .thumb, .thumbeb => switch (target.abi.floatAbi()) { |
| 3318 | .soft => .{ .arm_aapcs = .{} }, |
| 3319 | .hard => .{ .arm_aapcs_vfp = .{} }, |
| 3376 | 3320 | }, |
| 3377 | 3321 | .mips64, .mips64el => switch (target.abi) { |
| 3378 | 3322 | .gnuabin32 => .{ .mips64_n32 = .{} }, |