authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-21 14:25:08+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-28 03:08:10+02:00
log6d15dc1ab8bc04a5768fa48c14d82d7e6536561b
tree63243829a75bea447d8f6b35b4eb9687a12f008f
parenta3990a950d5ec207d3b3494e39db29fdb0b3a0ea
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

mingw: Fix various target checks to check for thumb.

Also remove mentions of arm, armeb, thumbeb, and aarch64_be; none of these are relevant for Windows.

1 files changed, 6 insertions(+), 6 deletions(-)

src/mingw.zig+6-6
......@@ -95,7 +95,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
9595 });
9696 }
9797 }
98 } else if (target.cpu.arch.isARM()) {
98 } else if (target.cpu.arch.isThumb()) {
9999 for (mingw32_arm32_src) |dep| {
100100 try c_source_files.append(.{
101101 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
......@@ -139,7 +139,7 @@ fn add_cc_args(
139139 });
140140
141141 const target = comp.getTarget();
142 if (target.cpu.arch.isARM() and target.ptrBitWidth() == 32) {
142 if (target.cpu.arch.isThumb()) {
143143 try args.append("-mfpu=vfp");
144144 }
145145
......@@ -222,10 +222,10 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
222222 });
223223
224224 const target_defines = switch (target.cpu.arch) {
225 .thumb => "#define DEF_ARM32\n",
226 .aarch64 => "#define DEF_ARM64\n",
225227 .x86 => "#define DEF_I386\n",
226228 .x86_64 => "#define DEF_X64\n",
227 .arm, .armeb, .thumb, .thumbeb => "#define DEF_ARM32\n",
228 .aarch64, .aarch64_be => "#define DEF_ARM64\n",
229229 else => unreachable,
230230 };
231231
......@@ -321,10 +321,10 @@ fn findDef(
321321 lib_name: []const u8,
322322) ![]u8 {
323323 const lib_path = switch (target.cpu.arch) {
324 .thumb => "libarm32",
325 .aarch64 => "libarm64",
324326 .x86 => "lib32",
325327 .x86_64 => "lib64",
326 .arm, .armeb, .thumb, .thumbeb => "libarm32",
327 .aarch64, .aarch64_be => "libarm64",
328328 else => unreachable,
329329 };
330330