| ... | ... | @@ -3676,10 +3676,16 @@ pub inline fn getPageSize(self: MachO) u16 { |
| 3676 | 3676 | |
| 3677 | 3677 | pub fn requiresCodeSig(self: MachO) bool { |
| 3678 | 3678 | if (self.entitlements) |_| return true; |
| 3679 | | // if (self.options.adhoc_codesign) |cs| return cs; |
| 3680 | | return switch (self.getTarget().cpu.arch) { |
| 3681 | | .aarch64 => true, |
| 3682 | | else => false, |
| 3679 | if (self.options.adhoc_codesign) |cs| return cs; |
| 3680 | const target = self.getTarget(); |
| 3681 | return switch (target.cpu.arch) { |
| 3682 | .aarch64 => switch (target.os.tag) { |
| 3683 | .macos => true, |
| 3684 | .watchos, .tvos, .ios, .visionos => target.abi == .simulator, |
| 3685 | else => false, |
| 3686 | }, |
| 3687 | .x86_64 => false, |
| 3688 | else => unreachable, |
| 3683 | 3689 | }; |
| 3684 | 3690 | } |
| 3685 | 3691 | |
| ... | ... | @@ -4424,6 +4430,7 @@ pub const Platform = struct { |
| 4424 | 4430 | .TVOS, .TVOSSIMULATOR => .tvos, |
| 4425 | 4431 | .WATCHOS, .WATCHOSSIMULATOR => .watchos, |
| 4426 | 4432 | .MACCATALYST => .ios, |
| 4433 | .VISIONOS, .VISIONOSSIMULATOR => .visionos, |
| 4427 | 4434 | else => @panic("TODO"), |
| 4428 | 4435 | }, |
| 4429 | 4436 | .abi = switch (cmd.platform) { |
| ... | ... | @@ -4431,6 +4438,7 @@ pub const Platform = struct { |
| 4431 | 4438 | .IOSSIMULATOR, |
| 4432 | 4439 | .TVOSSIMULATOR, |
| 4433 | 4440 | .WATCHOSSIMULATOR, |
| 4441 | .VISIONOSSIMULATOR, |
| 4434 | 4442 | => .simulator, |
| 4435 | 4443 | else => .none, |
| 4436 | 4444 | }, |
| ... | ... | @@ -4481,6 +4489,7 @@ pub const Platform = struct { |
| 4481 | 4489 | }, |
| 4482 | 4490 | .tvos => if (plat.abi == .simulator) .TVOSSIMULATOR else .TVOS, |
| 4483 | 4491 | .watchos => if (plat.abi == .simulator) .WATCHOSSIMULATOR else .WATCHOS, |
| 4492 | .visionos => if (plat.abi == .simulator) .VISIONOSSIMULATOR else .VISIONOS, |
| 4484 | 4493 | else => unreachable, |
| 4485 | 4494 | }; |
| 4486 | 4495 | } |
| ... | ... | @@ -4549,13 +4558,15 @@ const SupportedPlatforms = struct { |
| 4549 | 4558 | // Source: https://github.com/apple-oss-distributions/ld64/blob/59a99ab60399c5e6c49e6945a9e1049c42b71135/src/ld/PlatformSupport.cpp#L52 |
| 4550 | 4559 | // zig fmt: off |
| 4551 | 4560 | const supported_platforms = [_]SupportedPlatforms{ |
| 4552 | | .{ .macos, .none, 0xA0E00, 0xA0800 }, |
| 4553 | | .{ .ios, .none, 0xC0000, 0x70000 }, |
| 4554 | | .{ .tvos, .none, 0xC0000, 0x70000 }, |
| 4555 | | .{ .watchos, .none, 0x50000, 0x20000 }, |
| 4556 | | .{ .ios, .simulator, 0xD0000, 0x80000 }, |
| 4557 | | .{ .tvos, .simulator, 0xD0000, 0x80000 }, |
| 4558 | | .{ .watchos, .simulator, 0x60000, 0x20000 }, |
| 4561 | .{ .macos, .none, 0xA0E00, 0xA0800 }, |
| 4562 | .{ .ios, .none, 0xC0000, 0x70000 }, |
| 4563 | .{ .tvos, .none, 0xC0000, 0x70000 }, |
| 4564 | .{ .watchos, .none, 0x50000, 0x20000 }, |
| 4565 | .{ .visionos, .none, 0x10000, 0x10000 }, |
| 4566 | .{ .ios, .simulator, 0xD0000, 0x80000 }, |
| 4567 | .{ .tvos, .simulator, 0xD0000, 0x80000 }, |
| 4568 | .{ .watchos, .simulator, 0x60000, 0x20000 }, |
| 4569 | .{ .visionos, .simulator, 0x10000, 0x10000 }, |
| 4559 | 4570 | }; |
| 4560 | 4571 | // zig fmt: on |
| 4561 | 4572 | |