aboutsummaryrefslogtreecommitdiff
path: root/src/target.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-07-27 03:52:19 +0200
committerAndrew Kelley <andrew@ziglang.org>2024-07-28 19:44:52 -0700
commitd1d95294fd657f771657ea671a6984b860347fb0 (patch)
treed54c1098e7f0ec8c2b65ba7a6207bf4095c4b20e /src/target.zig
parentc15755092821c5c27727ebf416689084eab5b73e (diff)
downloadzig-d1d95294fd657f771657ea671a6984b860347fb0.tar.gz
zig-d1d95294fd657f771657ea671a6984b860347fb0.zip
std.Target.Cpu.Arch: Remove the `aarch64_32` tag.
This is a misfeature that we inherited from LLVM: * https://reviews.llvm.org/D61259 * https://reviews.llvm.org/D61939 (`aarch64_32` and `arm64_32` are equivalent.) I truly have no idea why this triple passed review in LLVM. It is, to date, the *only* tag in the architecture component that is not, in fact, an architecture. In reality, it is just an ILP32 ABI for AArch64 (*not* AArch32). The triples that use `aarch64_32` look like `aarch64_32-apple-watchos`. Yes, that triple is exactly what you think; it has no ABI component. They really, seriously did this. Since only Apple could come up with silliness like this, it should come as no surprise that no one else uses `aarch64_32`. Later on, a GNU ILP32 ABI for AArch64 was developed, and support was added to LLVM: * https://reviews.llvm.org/D94143 * https://reviews.llvm.org/D104931 Here, sanity seems to have prevailed, and a triple using this ABI looks like `aarch64-linux-gnu_ilp32` as you would expect. As can be seen from the diffs in this commit, there was plenty of confusion throughout the Zig codebase about what exactly `aarch64_32` was. So let's just remove it. In its place, we'll use `aarch64-watchos-ilp32`, `aarch64-linux-gnuilp32`, and so on. We'll then translate these appropriately when talking to LLVM. Hence, this commit adds the `ilp32` ABI tag (we already have `gnuilp32`).
Diffstat (limited to 'src/target.zig')
-rw-r--r--src/target.zig8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/target.zig b/src/target.zig
index 6ff9e69e61..ccf3ceb626 100644
--- a/src/target.zig
+++ b/src/target.zig
@@ -78,7 +78,6 @@ pub fn hasValgrindSupport(target: std.Target) bool {
.x86,
.x86_64,
.aarch64,
- .aarch64_32,
.aarch64_be,
=> {
return target.os.tag == .linux or target.os.tag == .solaris or target.os.tag == .illumos or
@@ -115,7 +114,6 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
.armeb,
.aarch64,
.aarch64_be,
- .aarch64_32,
.arc,
.avr,
.bpfel,
@@ -268,7 +266,6 @@ pub fn hasRedZone(target: std.Target) bool {
.x86,
.aarch64,
.aarch64_be,
- .aarch64_32,
=> true,
else => false,
@@ -412,7 +409,7 @@ pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 {
pub fn defaultFunctionAlignment(target: std.Target) Alignment {
return switch (target.cpu.arch) {
.arm, .armeb => .@"4",
- .aarch64, .aarch64_32, .aarch64_be => .@"4",
+ .aarch64, .aarch64_be => .@"4",
.sparc, .sparcel, .sparc64 => .@"4",
.riscv64 => .@"2",
else => .@"1",
@@ -424,7 +421,6 @@ pub fn minFunctionAlignment(target: std.Target) Alignment {
.arm,
.armeb,
.aarch64,
- .aarch64_32,
.aarch64_be,
.riscv32,
.riscv64,
@@ -517,7 +513,7 @@ pub fn zigBackend(target: std.Target, use_llvm: bool) std.builtin.CompilerBacken
.arm, .armeb, .thumb, .thumbeb => .stage2_arm,
.x86_64 => .stage2_x86_64,
.x86 => .stage2_x86,
- .aarch64, .aarch64_be, .aarch64_32 => .stage2_aarch64,
+ .aarch64, .aarch64_be => .stage2_aarch64,
.riscv64 => .stage2_riscv64,
.sparc64 => .stage2_sparc64,
.spirv64 => .stage2_spirv64,