authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-05 15:05:25+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-12-05 15:05:25+01:00
logd70be200d8a388c3fd23aa0e246322300443d58a
treee9e5491d3a161265d846adf3efd80f613d9ba8fa
parentc9d6f8b5058ba0df3bf281a3be3a3570c2219754
parent4e29c67eedb3960f6c8629ee23a9f8c7c310d699
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #22141 from alexrp/target-remove-bridgeos

`std.Target`: Remove `Os.Tag.bridgeos`

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

lib/compiler/aro/aro/target.zig-1
...@@ -663,7 +663,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -663,7 +663,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
663 .driverkit => "driverkit",663 .driverkit => "driverkit",
664 .visionos => "xros",664 .visionos => "xros",
665 .serenity => "serenity",665 .serenity => "serenity",
666 .bridgeos => "bridgeos",
667 .opencl,666 .opencl,
668 .opengl,667 .opengl,
669 .vulkan,668 .vulkan,
lib/std/Target.zig+4-20
...@@ -38,7 +38,6 @@ pub const Os = struct {...@@ -38,7 +38,6 @@ pub const Os = struct {
38 netbsd,38 netbsd,
39 openbsd,39 openbsd,
4040
41 bridgeos,
42 driverkit,41 driverkit,
43 ios,42 ios,
44 macos,43 macos,
...@@ -69,6 +68,7 @@ pub const Os = struct {...@@ -69,6 +68,7 @@ pub const Os = struct {
69 vulkan,68 vulkan,
7069
71 // LLVM tags deliberately omitted:70 // LLVM tags deliberately omitted:
71 // - bridgeos
72 // - darwin72 // - darwin
73 // - kfreebsd73 // - kfreebsd
74 // - nacl74 // - nacl
...@@ -76,7 +76,6 @@ pub const Os = struct {...@@ -76,7 +76,6 @@ pub const Os = struct {
7676
77 pub inline fn isDarwin(tag: Tag) bool {77 pub inline fn isDarwin(tag: Tag) bool {
78 return switch (tag) {78 return switch (tag) {
79 .bridgeos,
80 .driverkit,79 .driverkit,
81 .ios,80 .ios,
82 .macos,81 .macos,
...@@ -124,7 +123,6 @@ pub const Os = struct {...@@ -124,7 +123,6 @@ pub const Os = struct {
124 pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {123 pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {
125 return switch (tag) {124 return switch (tag) {
126 .windows, .uefi => ".dll",125 .windows, .uefi => ".dll",
127 .bridgeos,
128 .driverkit,126 .driverkit,
129 .ios,127 .ios,
130 .macos,128 .macos,
...@@ -168,9 +166,6 @@ pub const Os = struct {...@@ -168,9 +166,6 @@ pub const Os = struct {
168 .plan9,166 .plan9,
169 .serenity,167 .serenity,
170168
171 // This should use semver once we determine the version history.
172 .bridgeos,
173
174 .illumos,169 .illumos,
175170
176 .ps3,171 .ps3,
...@@ -432,9 +427,6 @@ pub const Os = struct {...@@ -432,9 +427,6 @@ pub const Os = struct {
432 .plan9,427 .plan9,
433 .serenity,428 .serenity,
434429
435 // This should use semver once we determine the version history.
436 .bridgeos,
437
438 .illumos,430 .illumos,
439431
440 .ps3,432 .ps3,
...@@ -701,7 +693,6 @@ pub const Os = struct {...@@ -701,7 +693,6 @@ pub const Os = struct {
701 .freebsd,693 .freebsd,
702 .aix,694 .aix,
703 .netbsd,695 .netbsd,
704 .bridgeos,
705 .driverkit,696 .driverkit,
706 .macos,697 .macos,
707 .ios,698 .ios,
...@@ -927,7 +918,6 @@ pub const Abi = enum {...@@ -927,7 +918,6 @@ pub const Abi = enum {
927 .serenity,918 .serenity,
928 .zos,919 .zos,
929 .dragonfly,920 .dragonfly,
930 .bridgeos,
931 .driverkit,921 .driverkit,
932 .macos,922 .macos,
933 .illumos,923 .illumos,
...@@ -1049,7 +1039,7 @@ pub const ObjectFormat = enum {...@@ -1049,7 +1039,7 @@ pub const ObjectFormat = enum {
1049 pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat {1039 pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat {
1050 return switch (os_tag) {1040 return switch (os_tag) {
1051 .aix => .xcoff,1041 .aix => .xcoff,
1052 .bridgeos, .driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,1042 .driverkit, .ios, .macos, .tvos, .visionos, .watchos => .macho,
1053 .plan9 => .plan9,1043 .plan9 => .plan9,
1054 .uefi, .windows => .coff,1044 .uefi, .windows => .coff,
1055 .zos => .goff,1045 .zos => .goff,
...@@ -1975,7 +1965,7 @@ pub const Cpu = struct {...@@ -1975,7 +1965,7 @@ pub const Cpu = struct {
1975 .amdgcn => &amdgcn.cpu.gfx906,1965 .amdgcn => &amdgcn.cpu.gfx906,
1976 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,1966 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
1977 .aarch64 => switch (os.tag) {1967 .aarch64 => switch (os.tag) {
1978 .bridgeos, .driverkit, .macos => &aarch64.cpu.apple_m1,1968 .driverkit, .macos => &aarch64.cpu.apple_m1,
1979 .ios, .tvos => &aarch64.cpu.apple_a7,1969 .ios, .tvos => &aarch64.cpu.apple_a7,
1980 .visionos => &aarch64.cpu.apple_m2,1970 .visionos => &aarch64.cpu.apple_m2,
1981 .watchos => &aarch64.cpu.apple_s4,1971 .watchos => &aarch64.cpu.apple_s4,
...@@ -2159,7 +2149,6 @@ pub const DynamicLinker = struct {...@@ -2159,7 +2149,6 @@ pub const DynamicLinker = struct {
2159 .netbsd,2149 .netbsd,
2160 .openbsd,2150 .openbsd,
21612151
2162 .bridgeos,
2163 .driverkit,2152 .driverkit,
2164 .ios,2153 .ios,
2165 .macos,2154 .macos,
...@@ -2546,7 +2535,6 @@ pub const DynamicLinker = struct {...@@ -2546,7 +2535,6 @@ pub const DynamicLinker = struct {
2546 else => none,2535 else => none,
2547 },2536 },
25482537
2549 .bridgeos => if (cpu.arch == .aarch64) init("/usr/lib/dyld") else none,
2550 .driverkit,2538 .driverkit,
2551 .ios,2539 .ios,
2552 .macos,2540 .macos,
...@@ -3045,7 +3033,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {...@@ -3045,7 +3033,6 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
3045 },3033 },
3046 },3034 },
30473035
3048 .bridgeos,
3049 .driverkit,3036 .driverkit,
3050 .ios,3037 .ios,
3051 .macos,3038 .macos,
...@@ -3069,10 +3056,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {...@@ -3069,10 +3056,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 {
3069 },3056 },
3070 .longlong, .ulonglong, .double => return 64,3057 .longlong, .ulonglong, .double => return 64,
3071 .longdouble => switch (target.cpu.arch) {3058 .longdouble => switch (target.cpu.arch) {
3072 .aarch64 => switch (target.os.tag) {3059 .aarch64 => return 64,
3073 .bridgeos => return 128,
3074 else => return 64,
3075 },
3076 .x86 => switch (target.abi) {3060 .x86 => switch (target.abi) {
3077 .android => return 64,3061 .android => return 64,
3078 else => return 80,3062 else => return 80,
src/codegen/llvm.zig-99
...@@ -167,7 +167,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -167,7 +167,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
167 .aix,167 .aix,
168 .zos,168 .zos,
169 => "ibm",169 => "ibm",
170 .bridgeos,
171 .driverkit,170 .driverkit,
172 .ios,171 .ios,
173 .macos,172 .macos,
...@@ -218,7 +217,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -218,7 +217,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
218 .hurd => "hurd",217 .hurd => "hurd",
219 .wasi => "wasi",218 .wasi => "wasi",
220 .emscripten => "emscripten",219 .emscripten => "emscripten",
221 .bridgeos => "bridgeos",
222 .macos => "macosx",220 .macos => "macosx",
223 .ios => "ios",221 .ios => "ios",
224 .tvos => "tvos",222 .tvos => "tvos",
...@@ -303,103 +301,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -303,103 +301,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
303 return llvm_triple.toOwnedSlice();301 return llvm_triple.toOwnedSlice();
304}302}
305303
306pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
307 return switch (os_tag) {
308 .freestanding => .UnknownOS,
309 .windows, .uefi => .Win32,
310 .dragonfly => .DragonFly,
311 .freebsd => .FreeBSD,
312 .fuchsia => .Fuchsia,
313 .ios => .IOS,
314 .linux => .Linux,
315 .ps3 => .Lv2,
316 .macos => .MacOSX,
317 .netbsd => .NetBSD,
318 .openbsd => .OpenBSD,
319 .solaris, .illumos => .Solaris,
320 .zos => .ZOS,
321 .haiku => .Haiku,
322 .rtems => .RTEMS,
323 .aix => .AIX,
324 .cuda => .CUDA,
325 .nvcl => .NVCL,
326 .amdhsa => .AMDHSA,
327 .opencl => .UnknownOS, // https://llvm.org/docs/SPIRVUsage.html#target-triples
328 .ps4 => .PS4,
329 .ps5 => .PS5,
330 .elfiamcu => .ELFIAMCU,
331 .tvos => .TvOS,
332 .watchos => .WatchOS,
333 .visionos => .XROS,
334 .mesa3d => .Mesa3D,
335 .amdpal => .AMDPAL,
336 .hermit => .HermitCore,
337 .hurd => .Hurd,
338 .wasi => .WASI,
339 .emscripten => .Emscripten,
340 .driverkit => .DriverKit,
341 .vulkan => .Vulkan,
342 .serenity => .Serenity,
343 .bridgeos => .BridgeOS,
344
345 .opengl,
346 .plan9,
347 .contiki,
348 .other,
349 => .UnknownOS,
350 };
351}
352
353pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
354 return switch (arch_tag) {
355 .arm => .arm,
356 .armeb => .armeb,
357 .aarch64 => .aarch64,
358 .aarch64_be => .aarch64_be,
359 .arc => .arc,
360 .avr => .avr,
361 .bpfel => .bpfel,
362 .bpfeb => .bpfeb,
363 .csky => .csky,
364 .hexagon => .hexagon,
365 .loongarch32 => .loongarch32,
366 .loongarch64 => .loongarch64,
367 .m68k => .m68k,
368 .mips => .mips,
369 .mipsel => .mipsel,
370 .mips64 => .mips64,
371 .mips64el => .mips64el,
372 .msp430 => .msp430,
373 .powerpc => .ppc,
374 .powerpcle => .ppcle,
375 .powerpc64 => .ppc64,
376 .powerpc64le => .ppc64le,
377 .amdgcn => .amdgcn,
378 .riscv32 => .riscv32,
379 .riscv64 => .riscv64,
380 .sparc => .sparc,
381 .sparc64 => .sparcv9, // In LLVM, sparc64 == sparcv9.
382 .s390x => .systemz,
383 .thumb => .thumb,
384 .thumbeb => .thumbeb,
385 .x86 => .x86,
386 .x86_64 => .x86_64,
387 .xcore => .xcore,
388 .xtensa => .xtensa,
389 .nvptx => .nvptx,
390 .nvptx64 => .nvptx64,
391 .spirv => .spirv,
392 .spirv32 => .spirv32,
393 .spirv64 => .spirv64,
394 .kalimba => .kalimba,
395 .lanai => .lanai,
396 .wasm32 => .wasm32,
397 .wasm64 => .wasm64,
398 .ve => .ve,
399 .propeller1, .propeller2, .spu_2 => .UnknownArch,
400 };
401}
402
403pub fn supportsTailCall(target: std.Target) bool {304pub fn supportsTailCall(target: std.Target) bool {
404 switch (target.cpu.arch) {305 switch (target.cpu.arch) {
405 .wasm32, .wasm64 => return std.Target.wasm.featureSetHas(target.cpu.features, .tail_call),306 .wasm32, .wasm64 => return std.Target.wasm.featureSetHas(target.cpu.features, .tail_call),
src/link/MachO.zig+2-9
...@@ -3539,7 +3539,7 @@ pub fn requiresCodeSig(self: MachO) bool {...@@ -3539,7 +3539,7 @@ pub fn requiresCodeSig(self: MachO) bool {
3539 const target = self.getTarget();3539 const target = self.getTarget();
3540 return switch (target.cpu.arch) {3540 return switch (target.cpu.arch) {
3541 .aarch64 => switch (target.os.tag) {3541 .aarch64 => switch (target.os.tag) {
3542 .bridgeos, .driverkit, .macos => true,3542 .driverkit, .macos => true,
3543 .ios, .tvos, .visionos, .watchos => target.abi == .simulator,3543 .ios, .tvos, .visionos, .watchos => target.abi == .simulator,
3544 else => false,3544 else => false,
3545 },3545 },
...@@ -4143,7 +4143,6 @@ pub const Platform = struct {...@@ -4143,7 +4143,6 @@ pub const Platform = struct {
4143 const cmd = lc.cast(macho.build_version_command).?;4143 const cmd = lc.cast(macho.build_version_command).?;
4144 return .{4144 return .{
4145 .os_tag = switch (cmd.platform) {4145 .os_tag = switch (cmd.platform) {
4146 .BRIDGEOS => .bridgeos,
4147 .DRIVERKIT => .driverkit,4146 .DRIVERKIT => .driverkit,
4148 .IOS, .IOSSIMULATOR => .ios,4147 .IOS, .IOSSIMULATOR => .ios,
4149 .MACCATALYST => .ios,4148 .MACCATALYST => .ios,
...@@ -4191,11 +4190,7 @@ pub const Platform = struct {...@@ -4191,11 +4190,7 @@ pub const Platform = struct {
4191 return .{4190 return .{
4192 .os_tag = target.os.tag,4191 .os_tag = target.os.tag,
4193 .abi = target.abi,4192 .abi = target.abi,
4194 // This should use semver once we determine the version history.4193 .version = target.os.version_range.semver.min,
4195 .version = if (target.os.tag == .bridgeos)
4196 .{ .major = 0, .minor = 0, .patch = 0 }
4197 else
4198 target.os.version_range.semver.min,
4199 };4194 };
4200 }4195 }
42014196
...@@ -4205,7 +4200,6 @@ pub const Platform = struct {...@@ -4205,7 +4200,6 @@ pub const Platform = struct {
42054200
4206 pub fn toApplePlatform(plat: Platform) macho.PLATFORM {4201 pub fn toApplePlatform(plat: Platform) macho.PLATFORM {
4207 return switch (plat.os_tag) {4202 return switch (plat.os_tag) {
4208 .bridgeos => .BRIDGEOS,
4209 .driverkit => .DRIVERKIT,4203 .driverkit => .DRIVERKIT,
4210 .ios => switch (plat.abi) {4204 .ios => switch (plat.abi) {
4211 .macabi => .MACCATALYST,4205 .macabi => .MACCATALYST,
...@@ -4284,7 +4278,6 @@ const SupportedPlatforms = struct {...@@ -4284,7 +4278,6 @@ const SupportedPlatforms = struct {
4284// Source: https://github.com/apple-oss-distributions/ld64/blob/59a99ab60399c5e6c49e6945a9e1049c42b71135/src/ld/PlatformSupport.cpp#L524278// Source: https://github.com/apple-oss-distributions/ld64/blob/59a99ab60399c5e6c49e6945a9e1049c42b71135/src/ld/PlatformSupport.cpp#L52
4285// zig fmt: off4279// zig fmt: off
4286const supported_platforms = [_]SupportedPlatforms{4280const supported_platforms = [_]SupportedPlatforms{
4287 .{ .bridgeos, .none, 0x010000, 0x010000 },
4288 .{ .driverkit, .none, 0x130000, 0x130000 },4281 .{ .driverkit, .none, 0x130000, 0x130000 },
4289 .{ .ios, .none, 0x0C0000, 0x070000 },4282 .{ .ios, .none, 0x0C0000, 0x070000 },
4290 .{ .ios, .macabi, 0x0D0000, 0x0D0000 },4283 .{ .ios, .macabi, 0x0D0000, 0x0D0000 },
test/llvm_targets.zig-1
...@@ -2,7 +2,6 @@ const std = @import("std");...@@ -2,7 +2,6 @@ const std = @import("std");
2const Cases = @import("src/Cases.zig");2const Cases = @import("src/Cases.zig");
33
4const targets = [_]std.Target.Query{4const targets = [_]std.Target.Query{
5 .{ .cpu_arch = .aarch64, .os_tag = .bridgeos, .abi = .none },
6 .{ .cpu_arch = .aarch64, .os_tag = .driverkit, .abi = .none },5 .{ .cpu_arch = .aarch64, .os_tag = .driverkit, .abi = .none },
7 .{ .cpu_arch = .aarch64, .os_tag = .freebsd, .abi = .none },6 .{ .cpu_arch = .aarch64, .os_tag = .freebsd, .abi = .none },
8 .{ .cpu_arch = .aarch64, .os_tag = .freestanding, .abi = .none },7 .{ .cpu_arch = .aarch64, .os_tag = .freestanding, .abi = .none },