mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Merge pull request #22141 from alexrp/target-remove-bridgeos
`std.Target`: Remove `Os.Tag.bridgeos`
This commit is contained in:
commit
d70be200d8
1
lib/compiler/aro/aro/target.zig
vendored
1
lib/compiler/aro/aro/target.zig
vendored
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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",
|
||||
@ -303,103 +301,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
|
||||
return llvm_triple.toOwnedSlice();
|
||||
}
|
||||
|
||||
pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
|
||||
return switch (os_tag) {
|
||||
.freestanding => .UnknownOS,
|
||||
.windows, .uefi => .Win32,
|
||||
.dragonfly => .DragonFly,
|
||||
.freebsd => .FreeBSD,
|
||||
.fuchsia => .Fuchsia,
|
||||
.ios => .IOS,
|
||||
.linux => .Linux,
|
||||
.ps3 => .Lv2,
|
||||
.macos => .MacOSX,
|
||||
.netbsd => .NetBSD,
|
||||
.openbsd => .OpenBSD,
|
||||
.solaris, .illumos => .Solaris,
|
||||
.zos => .ZOS,
|
||||
.haiku => .Haiku,
|
||||
.rtems => .RTEMS,
|
||||
.aix => .AIX,
|
||||
.cuda => .CUDA,
|
||||
.nvcl => .NVCL,
|
||||
.amdhsa => .AMDHSA,
|
||||
.opencl => .UnknownOS, // https://llvm.org/docs/SPIRVUsage.html#target-triples
|
||||
.ps4 => .PS4,
|
||||
.ps5 => .PS5,
|
||||
.elfiamcu => .ELFIAMCU,
|
||||
.tvos => .TvOS,
|
||||
.watchos => .WatchOS,
|
||||
.visionos => .XROS,
|
||||
.mesa3d => .Mesa3D,
|
||||
.amdpal => .AMDPAL,
|
||||
.hermit => .HermitCore,
|
||||
.hurd => .Hurd,
|
||||
.wasi => .WASI,
|
||||
.emscripten => .Emscripten,
|
||||
.driverkit => .DriverKit,
|
||||
.vulkan => .Vulkan,
|
||||
.serenity => .Serenity,
|
||||
.bridgeos => .BridgeOS,
|
||||
|
||||
.opengl,
|
||||
.plan9,
|
||||
.contiki,
|
||||
.other,
|
||||
=> .UnknownOS,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
|
||||
return switch (arch_tag) {
|
||||
.arm => .arm,
|
||||
.armeb => .armeb,
|
||||
.aarch64 => .aarch64,
|
||||
.aarch64_be => .aarch64_be,
|
||||
.arc => .arc,
|
||||
.avr => .avr,
|
||||
.bpfel => .bpfel,
|
||||
.bpfeb => .bpfeb,
|
||||
.csky => .csky,
|
||||
.hexagon => .hexagon,
|
||||
.loongarch32 => .loongarch32,
|
||||
.loongarch64 => .loongarch64,
|
||||
.m68k => .m68k,
|
||||
.mips => .mips,
|
||||
.mipsel => .mipsel,
|
||||
.mips64 => .mips64,
|
||||
.mips64el => .mips64el,
|
||||
.msp430 => .msp430,
|
||||
.powerpc => .ppc,
|
||||
.powerpcle => .ppcle,
|
||||
.powerpc64 => .ppc64,
|
||||
.powerpc64le => .ppc64le,
|
||||
.amdgcn => .amdgcn,
|
||||
.riscv32 => .riscv32,
|
||||
.riscv64 => .riscv64,
|
||||
.sparc => .sparc,
|
||||
.sparc64 => .sparcv9, // In LLVM, sparc64 == sparcv9.
|
||||
.s390x => .systemz,
|
||||
.thumb => .thumb,
|
||||
.thumbeb => .thumbeb,
|
||||
.x86 => .x86,
|
||||
.x86_64 => .x86_64,
|
||||
.xcore => .xcore,
|
||||
.xtensa => .xtensa,
|
||||
.nvptx => .nvptx,
|
||||
.nvptx64 => .nvptx64,
|
||||
.spirv => .spirv,
|
||||
.spirv32 => .spirv32,
|
||||
.spirv64 => .spirv64,
|
||||
.kalimba => .kalimba,
|
||||
.lanai => .lanai,
|
||||
.wasm32 => .wasm32,
|
||||
.wasm64 => .wasm64,
|
||||
.ve => .ve,
|
||||
.propeller1, .propeller2, .spu_2 => .UnknownArch,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn supportsTailCall(target: std.Target) bool {
|
||||
switch (target.cpu.arch) {
|
||||
.wasm32, .wasm64 => return std.Target.wasm.featureSetHas(target.cpu.features, .tail_call),
|
||||
|
||||
@ -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 },
|
||||
|
||||
@ -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 },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user