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.
This commit is contained in:
Alex Rønne Petersen 2024-12-03 20:07:51 +01:00
parent 4e09e363cd
commit 09b39f77b7
No known key found for this signature in database
5 changed files with 6 additions and 34 deletions

View file

@ -663,7 +663,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.driverkit => "driverkit",
.visionos => "xros",
.serenity => "serenity",
.bridgeos => "bridgeos",
.opencl,
.opengl,
.vulkan,

View file

@ -38,7 +38,6 @@ pub const Os = struct {
netbsd,
openbsd,
bridgeos,
driverkit,
ios,
macos,
@ -69,6 +68,7 @@ pub const Os = struct {
vulkan,
// LLVM tags deliberately omitted:
// - bridgeos
// - darwin
// - kfreebsd
// - nacl
@ -76,7 +76,6 @@ pub const Os = struct {
pub inline fn isDarwin(tag: Tag) bool {
return switch (tag) {
.bridgeos,
.driverkit,
.ios,
.macos,
@ -124,7 +123,6 @@ pub const Os = struct {
pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {
return switch (tag) {
.windows, .uefi => ".dll",
.bridgeos,
.driverkit,
.ios,
.macos,
@ -168,9 +166,6 @@ pub const Os = struct {
.plan9,
.serenity,
// This should use semver once we determine the version history.
.bridgeos,
.illumos,
.ps3,
@ -432,9 +427,6 @@ pub const Os = struct {
.plan9,
.serenity,
// This should use semver once we determine the version history.
.bridgeos,
.illumos,
.ps3,
@ -701,7 +693,6 @@ pub const Os = struct {
.freebsd,
.aix,
.netbsd,
.bridgeos,
.driverkit,
.macos,
.ios,
@ -927,7 +918,6 @@ pub const Abi = enum {
.serenity,
.zos,
.dragonfly,
.bridgeos,
.driverkit,
.macos,
.illumos,
@ -1049,7 +1039,7 @@ pub const ObjectFormat = enum {
pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat {
return switch (os_tag) {
.aix => .xcoff,
.bridgeos, .driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,
.driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,
.plan9 => .plan9,
.uefi, .windows => .coff,
.zos => .goff,
@ -1975,7 +1965,7 @@ pub const Cpu = struct {
.amdgcn => &amdgcn.cpu.gfx906,
.arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
.aarch64 => switch (os.tag) {
.bridgeos, .driverkit, .macos => &aarch64.cpu.apple_m1,
.driverkit, .macos => &aarch64.cpu.apple_m1,
.ios, .tvos => &aarch64.cpu.apple_a7,
.visionos => &aarch64.cpu.apple_m2,
.watchos => &aarch64.cpu.apple_s4,
@ -2159,7 +2149,6 @@ pub const DynamicLinker = struct {
.netbsd,
.openbsd,
.bridgeos,
.driverkit,
.ios,
.macos,
@ -2546,7 +2535,6 @@ pub const DynamicLinker = struct {
else => none,
},
.bridgeos => if (cpu.arch == .aarch64) init("/usr/lib/dyld") else none,
.driverkit,
.ios,
.macos,
@ -3045,7 +3033,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
},
},
.bridgeos,
.driverkit,
.ios,
.macos,
@ -3069,10 +3056,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
},
.longlong, .ulonglong, .double => return 64,
.longdouble => switch (target.cpu.arch) {
.aarch64 => switch (target.os.tag) {
.bridgeos => return 128,
else => return 64,
},
.aarch64 => return 64,
.x86 => switch (target.abi) {
.android => return 64,
else => return 80,

View file

@ -167,7 +167,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
.aix,
.zos,
=> "ibm",
.bridgeos,
.driverkit,
.ios,
.macos,
@ -218,7 +217,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
.hurd => "hurd",
.wasi => "wasi",
.emscripten => "emscripten",
.bridgeos => "bridgeos",
.macos => "macosx",
.ios => "ios",
.tvos => "tvos",
@ -340,7 +338,6 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
.driverkit => .DriverKit,
.vulkan => .Vulkan,
.serenity => .Serenity,
.bridgeos => .BridgeOS,
.opengl,
.plan9,

View file

@ -3539,7 +3539,7 @@ pub fn requiresCodeSig(self: MachO) bool {
const target = self.getTarget();
return switch (target.cpu.arch) {
.aarch64 => switch (target.os.tag) {
.bridgeos, .driverkit, .macos => true,
.driverkit, .macos => true,
.ios, .tvos, .visionos, .watchos => target.abi == .simulator,
else => false,
},
@ -4143,7 +4143,6 @@ pub const Platform = struct {
const cmd = lc.cast(macho.build_version_command).?;
return .{
.os_tag = switch (cmd.platform) {
.BRIDGEOS => .bridgeos,
.DRIVERKIT => .driverkit,
.IOS, .IOSSIMULATOR => .ios,
.MACCATALYST => .ios,
@ -4191,11 +4190,7 @@ pub const Platform = struct {
return .{
.os_tag = target.os.tag,
.abi = target.abi,
// This should use semver once we determine the version history.
.version = if (target.os.tag == .bridgeos)
.{ .major = 0, .minor = 0, .patch = 0 }
else
target.os.version_range.semver.min,
.version = target.os.version_range.semver.min,
};
}
@ -4205,7 +4200,6 @@ pub const Platform = struct {
pub fn toApplePlatform(plat: Platform) macho.PLATFORM {
return switch (plat.os_tag) {
.bridgeos => .BRIDGEOS,
.driverkit => .DRIVERKIT,
.ios => switch (plat.abi) {
.macabi => .MACCATALYST,
@ -4284,7 +4278,6 @@ const SupportedPlatforms = struct {
// Source: https://github.com/apple-oss-distributions/ld64/blob/59a99ab60399c5e6c49e6945a9e1049c42b71135/src/ld/PlatformSupport.cpp#L52
// zig fmt: off
const supported_platforms = [_]SupportedPlatforms{
.{ .bridgeos, .none, 0x010000, 0x010000 },
.{ .driverkit, .none, 0x130000, 0x130000 },
.{ .ios, .none, 0x0C0000, 0x070000 },
.{ .ios, .macabi, 0x0D0000, 0x0D0000 },

View file

@ -2,7 +2,6 @@ const std = @import("std");
const Cases = @import("src/Cases.zig");
const targets = [_]std.Target.Query{
.{ .cpu_arch = .aarch64, .os_tag = .bridgeos, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .driverkit, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .freebsd, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .freestanding, .abi = .none },