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...@@ -95,7 +95,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
95 });95 });
96 }96 }
97 }97 }
98 } else if (target.cpu.arch.isARM()) {98 } else if (target.cpu.arch.isThumb()) {
99 for (mingw32_arm32_src) |dep| {99 for (mingw32_arm32_src) |dep| {
100 try c_source_files.append(.{100 try c_source_files.append(.{
101 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{101 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
...@@ -139,7 +139,7 @@ fn add_cc_args(...@@ -139,7 +139,7 @@ fn add_cc_args(
139 });139 });
140140
141 const target = comp.getTarget();141 const target = comp.getTarget();
142 if (target.cpu.arch.isARM() and target.ptrBitWidth() == 32) {142 if (target.cpu.arch.isThumb()) {
143 try args.append("-mfpu=vfp");143 try args.append("-mfpu=vfp");
144 }144 }
145145
...@@ -222,10 +222,10 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {...@@ -222,10 +222,10 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
222 });222 });
223223
224 const target_defines = switch (target.cpu.arch) {224 const target_defines = switch (target.cpu.arch) {
225 .thumb => "#define DEF_ARM32\n",
226 .aarch64 => "#define DEF_ARM64\n",
225 .x86 => "#define DEF_I386\n",227 .x86 => "#define DEF_I386\n",
226 .x86_64 => "#define DEF_X64\n",228 .x86_64 => "#define DEF_X64\n",
227 .arm, .armeb, .thumb, .thumbeb => "#define DEF_ARM32\n",
228 .aarch64, .aarch64_be => "#define DEF_ARM64\n",
229 else => unreachable,229 else => unreachable,
230 };230 };
231231
...@@ -321,10 +321,10 @@ fn findDef(...@@ -321,10 +321,10 @@ fn findDef(
321 lib_name: []const u8,321 lib_name: []const u8,
322) ![]u8 {322) ![]u8 {
323 const lib_path = switch (target.cpu.arch) {323 const lib_path = switch (target.cpu.arch) {
324 .thumb => "libarm32",
325 .aarch64 => "libarm64",
324 .x86 => "lib32",326 .x86 => "lib32",
325 .x86_64 => "lib64",327 .x86_64 => "lib64",
326 .arm, .armeb, .thumb, .thumbeb => "libarm32",
327 .aarch64, .aarch64_be => "libarm64",
328 else => unreachable,328 else => unreachable,
329 };329 };
330330