| ... | @@ -396,6 +396,13 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio | ... | @@ -396,6 +396,13 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio |
| 396 | | 396 | |
| 397 | pub fn createEmpty(gpa: *Allocator, options: link.Options) !*MachO { | 397 | pub fn createEmpty(gpa: *Allocator, options: link.Options) !*MachO { |
| 398 | const self = try gpa.create(MachO); | 398 | const self = try gpa.create(MachO); |
| | 399 | const cpu_arch = options.target.cpu.arch; |
| | 400 | const os_tag = options.target.os.tag; |
| | 401 | const abi = options.target.abi; |
| | 402 | const page_size = if (cpu_arch == .aarch64) 0x4000 else 0x1000; |
| | 403 | // Adhoc code signature is required when targeting aarch64-macos either directly or indirectly via the simulator |
| | 404 | // ABI such as aarch64-ios-simulator, etc. |
| | 405 | const requires_adhoc_codesig = cpu_arch == .aarch64 and (os_tag == .macos or abi == .simulator); |
| 399 | | 406 | |
| 400 | self.* = .{ | 407 | self.* = .{ |
| 401 | .base = .{ | 408 | .base = .{ |
| ... | @@ -404,8 +411,8 @@ pub fn createEmpty(gpa: *Allocator, options: link.Options) !*MachO { | ... | @@ -404,8 +411,8 @@ pub fn createEmpty(gpa: *Allocator, options: link.Options) !*MachO { |
| 404 | .allocator = gpa, | 411 | .allocator = gpa, |
| 405 | .file = null, | 412 | .file = null, |
| 406 | }, | 413 | }, |
| 407 | .page_size = if (options.target.cpu.arch == .aarch64) 0x4000 else 0x1000, | 414 | .page_size = page_size, |
| 408 | .requires_adhoc_codesig = options.target.cpu.arch == .aarch64 and options.target.os.tag == .macos, | 415 | .requires_adhoc_codesig = requires_adhoc_codesig, |
| 409 | }; | 416 | }; |
| 410 | | 417 | |
| 411 | return self; | 418 | return self; |