From fccf15fc9f77001c513946cd1f37e8f6a57188e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 2 Nov 2024 02:34:10 +0100 Subject: [PATCH] std.Target: Remove armv7k/armv7s. Like d1d95294fd657f771657ea671a6984b860347fb0, this is more Apple nonsense where they abused the arch component of the triple to encode what's really an ABI. Handling this correctly in Zig's target triple model would take quite a bit of work. Fortunately, the last Armv7-based Apple Watch was released in 2017 and these targets are now considered legacy. By the time Zig hits 1.0, they will be a distant memory. So just remove them. --- lib/std/Target/arm.zig | 16 ---------------- src/codegen/llvm.zig | 3 --- tools/update_cpu_features.zig | 4 ++-- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/lib/std/Target/arm.zig b/lib/std/Target/arm.zig index 9e4e72a05a..2fcae7287b 100644 --- a/lib/std/Target/arm.zig +++ b/lib/std/Target/arm.zig @@ -158,10 +158,8 @@ pub const Feature = enum { v6t2, v7a, v7em, - v7k, v7m, v7r, - v7s, v7ve, v8_1a, v8_1m_main, @@ -1177,13 +1175,6 @@ pub const all_features = blk: { .thumb_mode, }), }; - result[@intFromEnum(Feature.v7k)] = .{ - .llvm_name = "armv7k", - .description = "ARMv7a architecture", - .dependencies = featureSet(&[_]Feature{ - .v7a, - }), - }; result[@intFromEnum(Feature.v7m)] = .{ .llvm_name = "armv7-m", .description = "ARMv7m architecture", @@ -1208,13 +1199,6 @@ pub const all_features = blk: { .rclass, }), }; - result[@intFromEnum(Feature.v7s)] = .{ - .llvm_name = "armv7s", - .description = "ARMv7a architecture", - .dependencies = featureSet(&[_]Feature{ - .v7a, - }), - }; result[@intFromEnum(Feature.v7ve)] = .{ .llvm_name = "armv7ve", .description = "ARMv7ve architecture", diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index c5bfe6f0a9..fc7d26a815 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -118,9 +118,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { .{ .v6kz, "v6kz" }, .{ .v6m, "v6m" }, .{ .v6t2, "v6t2" }, - // v7k and v7s imply v7a so they have to be tested first. - .{ .v7k, "v7k" }, - .{ .v7s, "v7s" }, .{ .v7a, "v7a" }, .{ .v7em, "v7em" }, .{ .v7m, "v7m" }, diff --git a/tools/update_cpu_features.zig b/tools/update_cpu_features.zig index fdc7b02a9e..2390a00575 100644 --- a/tools/update_cpu_features.zig +++ b/tools/update_cpu_features.zig @@ -699,11 +699,11 @@ const llvm_targets = [_]LlvmTarget{ }, .{ .llvm_name = "armv7k", - .zig_name = "v7k", + .omit = true, }, .{ .llvm_name = "armv7s", - .zig_name = "v7s", + .omit = true, }, .{ .llvm_name = "armv7ve",