authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-03 20:07:51+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-03 20:43:15+01:00
log09b39f77b7e380857c79adaec4765350163d6e16
treefcf5d90a0f79f3757f51fd9917ce8bf5044647e8
parent4e09e363cd00b1dd36467ef7958d750ea09f296d
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: Remove Os.Tag.bridgeos.

It doesn't appear that targeting bridgeOS is meaningfully supported by Apple. Even LLVM/Clang appear to have incomplete support for it, suggesting that Apple never bothered to upstream that support. So there's really no sense in us pretending to support this.

5 files changed, 6 insertions(+), 34 deletions(-)

lib/compiler/aro/aro/target.zig-1
......@@ -663,7 +663,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
663663 .driverkit => "driverkit",
664664 .visionos => "xros",
665665 .serenity => "serenity",
666 .bridgeos => "bridgeos",
667666 .opencl,
668667 .opengl,
669668 .vulkan,
lib/std/Target.zig+4-20
......@@ -38,7 +38,6 @@ pub const Os = struct {
3838 netbsd,
3939 openbsd,
4040
41 bridgeos,
4241 driverkit,
4342 ios,
4443 macos,
......@@ -69,6 +68,7 @@ pub const Os = struct {
6968 vulkan,
7069
7170 // LLVM tags deliberately omitted:
71 // - bridgeos
7272 // - darwin
7373 // - kfreebsd
7474 // - nacl
......@@ -76,7 +76,6 @@ pub const Os = struct {
7676
7777 pub inline fn isDarwin(tag: Tag) bool {
7878 return switch (tag) {
79 .bridgeos,
8079 .driverkit,
8180 .ios,
8281 .macos,
......@@ -124,7 +123,6 @@ pub const Os = struct {
124123 pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {
125124 return switch (tag) {
126125 .windows, .uefi => ".dll",
127 .bridgeos,
128126 .driverkit,
129127 .ios,
130128 .macos,
......@@ -168,9 +166,6 @@ pub const Os = struct {
168166 .plan9,
169167 .serenity,
170168
171 // This should use semver once we determine the version history.
172 .bridgeos,
173
174169 .illumos,
175170
176171 .ps3,
......@@ -432,9 +427,6 @@ pub const Os = struct {
432427 .plan9,
433428 .serenity,
434429
435 // This should use semver once we determine the version history.
436 .bridgeos,
437
438430 .illumos,
439431
440432 .ps3,
......@@ -701,7 +693,6 @@ pub const Os = struct {
701693 .freebsd,
702694 .aix,
703695 .netbsd,
704 .bridgeos,
705696 .driverkit,
706697 .macos,
707698 .ios,
......@@ -927,7 +918,6 @@ pub const Abi = enum {
927918 .serenity,
928919 .zos,
929920 .dragonfly,
930 .bridgeos,
931921 .driverkit,
932922 .macos,
933923 .illumos,
......@@ -1049,7 +1039,7 @@ pub const ObjectFormat = enum {
10491039 pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat {
10501040 return switch (os_tag) {
10511041 .aix => .xcoff,
1052 .bridgeos, .driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,
1042 .driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,
10531043 .plan9 => .plan9,
10541044 .uefi, .windows => .coff,
10551045 .zos => .goff,
......@@ -1975,7 +1965,7 @@ pub const Cpu = struct {
19751965 .amdgcn => &amdgcn.cpu.gfx906,
19761966 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
19771967 .aarch64 => switch (os.tag) {
1978 .bridgeos, .driverkit, .macos => &aarch64.cpu.apple_m1,
1968 .driverkit, .macos => &aarch64.cpu.apple_m1,
19791969 .ios, .tvos => &aarch64.cpu.apple_a7,
19801970 .visionos => &aarch64.cpu.apple_m2,
19811971 .watchos => &aarch64.cpu.apple_s4,
......@@ -2159,7 +2149,6 @@ pub const DynamicLinker = struct {
21592149 .netbsd,
21602150 .openbsd,
21612151
2162 .bridgeos,
21632152 .driverkit,
21642153 .ios,
21652154 .macos,
......@@ -2546,7 +2535,6 @@ pub const DynamicLinker = struct {
25462535 else => none,
25472536 },
25482537
2549 .bridgeos => if (cpu.arch == .aarch64) init("/usr/lib/dyld") else none,
25502538 .driverkit,
25512539 .ios,
25522540 .macos,
......@@ -3045,7 +3033,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
30453033 },
30463034 },
30473035
3048 .bridgeos,
30493036 .driverkit,
30503037 .ios,
30513038 .macos,
......@@ -3069,10 +3056,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
30693056 },
30703057 .longlong, .ulonglong, .double => return 64,
30713058 .longdouble => switch (target.cpu.arch) {
3072 .aarch64 => switch (target.os.tag) {
3073 .bridgeos => return 128,
3074 else => return 64,
3075 },
3059 .aarch64 => return 64,
30763060 .x86 => switch (target.abi) {
30773061 .android => return 64,
30783062 else => return 80,
src/codegen/llvm.zig-3
......@@ -167,7 +167,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
167167 .aix,
168168 .zos,
169169 => "ibm",
170 .bridgeos,
171170 .driverkit,
172171 .ios,
173172 .macos,
......@@ -218,7 +217,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
218217 .hurd => "hurd",
219218 .wasi => "wasi",
220219 .emscripten => "emscripten",
221 .bridgeos => "bridgeos",
222220 .macos => "macosx",
223221 .ios => "ios",
224222 .tvos => "tvos",
......@@ -340,7 +338,6 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
340338 .driverkit => .DriverKit,
341339 .vulkan => .Vulkan,
342340 .serenity => .Serenity,
343 .bridgeos => .BridgeOS,
344341
345342 .opengl,
346343 .plan9,
src/link/MachO.zig+2-9
......@@ -3539,7 +3539,7 @@ pub fn requiresCodeSig(self: MachO) bool {
35393539 const target = self.getTarget();
35403540 return switch (target.cpu.arch) {
35413541 .aarch64 => switch (target.os.tag) {
3542 .bridgeos, .driverkit, .macos => true,
3542 .driverkit, .macos => true,
35433543 .ios, .tvos, .visionos, .watchos => target.abi == .simulator,
35443544 else => false,
35453545 },
......@@ -4143,7 +4143,6 @@ pub const Platform = struct {
41434143 const cmd = lc.cast(macho.build_version_command).?;
41444144 return .{
41454145 .os_tag = switch (cmd.platform) {
4146 .BRIDGEOS => .bridgeos,
41474146 .DRIVERKIT => .driverkit,
41484147 .IOS, .IOSSIMULATOR => .ios,
41494148 .MACCATALYST => .ios,
......@@ -4191,11 +4190,7 @@ pub const Platform = struct {
41914190 return .{
41924191 .os_tag = target.os.tag,
41934192 .abi = target.abi,
4194 // This should use semver once we determine the version history.
4195 .version = if (target.os.tag == .bridgeos)
4196 .{ .major = 0, .minor = 0, .patch = 0 }
4197 else
4198 target.os.version_range.semver.min,
4193 .version = target.os.version_range.semver.min,
41994194 };
42004195 }
42014196
......@@ -4205,7 +4200,6 @@ pub const Platform = struct {
42054200
42064201 pub fn toApplePlatform(plat: Platform) macho.PLATFORM {
42074202 return switch (plat.os_tag) {
4208 .bridgeos => .BRIDGEOS,
42094203 .driverkit => .DRIVERKIT,
42104204 .ios => switch (plat.abi) {
42114205 .macabi => .MACCATALYST,
......@@ -4284,7 +4278,6 @@ const SupportedPlatforms = struct {
42844278// Source: https://github.com/apple-oss-distributions/ld64/blob/59a99ab60399c5e6c49e6945a9e1049c42b71135/src/ld/PlatformSupport.cpp#L52
42854279// zig fmt: off
42864280const supported_platforms = [_]SupportedPlatforms{
4287 .{ .bridgeos, .none, 0x010000, 0x010000 },
42884281 .{ .driverkit, .none, 0x130000, 0x130000 },
42894282 .{ .ios, .none, 0x0C0000, 0x070000 },
42904283 .{ .ios, .macabi, 0x0D0000, 0x0D0000 },
test/llvm_targets.zig-1
......@@ -2,7 +2,6 @@ const std = @import("std");
22const Cases = @import("src/Cases.zig");
33
44const targets = [_]std.Target.Query{
5 .{ .cpu_arch = .aarch64, .os_tag = .bridgeos, .abi = .none },
65 .{ .cpu_arch = .aarch64, .os_tag = .driverkit, .abi = .none },
76 .{ .cpu_arch = .aarch64, .os_tag = .freebsd, .abi = .none },
87 .{ .cpu_arch = .aarch64, .os_tag = .freestanding, .abi = .none },