aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-08-21 14:25:08 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-08-28 03:08:10 +0200
commit6d15dc1ab8bc04a5768fa48c14d82d7e6536561b (patch)
tree63243829a75bea447d8f6b35b4eb9687a12f008f /src
parenta3990a950d5ec207d3b3494e39db29fdb0b3a0ea (diff)
downloadzig-6d15dc1ab8bc04a5768fa48c14d82d7e6536561b.tar.gz
zig-6d15dc1ab8bc04a5768fa48c14d82d7e6536561b.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/mingw.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mingw.zig b/src/mingw.zig
index 0cebc389e6..114c168765 100644
--- a/src/mingw.zig
+++ b/src/mingw.zig
@@ -95,7 +95,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
});
}
}
- } else if (target.cpu.arch.isARM()) {
+ } else if (target.cpu.arch.isThumb()) {
for (mingw32_arm32_src) |dep| {
try c_source_files.append(.{
.src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
@@ -139,7 +139,7 @@ fn add_cc_args(
});
const target = comp.getTarget();
- if (target.cpu.arch.isARM() and target.ptrBitWidth() == 32) {
+ if (target.cpu.arch.isThumb()) {
try args.append("-mfpu=vfp");
}
@@ -222,10 +222,10 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
});
const target_defines = switch (target.cpu.arch) {
+ .thumb => "#define DEF_ARM32\n",
+ .aarch64 => "#define DEF_ARM64\n",
.x86 => "#define DEF_I386\n",
.x86_64 => "#define DEF_X64\n",
- .arm, .armeb, .thumb, .thumbeb => "#define DEF_ARM32\n",
- .aarch64, .aarch64_be => "#define DEF_ARM64\n",
else => unreachable,
};
@@ -321,10 +321,10 @@ fn findDef(
lib_name: []const u8,
) ![]u8 {
const lib_path = switch (target.cpu.arch) {
+ .thumb => "libarm32",
+ .aarch64 => "libarm64",
.x86 => "lib32",
.x86_64 => "lib64",
- .arm, .armeb, .thumb, .thumbeb => "libarm32",
- .aarch64, .aarch64_be => "libarm64",
else => unreachable,
};