authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-14 18:30:14+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-14 19:19:00+01:00
log2125c94abeb2a592d03471f72426073d37400be3
tree01761a7b9a1e8a06d90bd5fe5518f52f01b4a0a4
parentca7523742f1d2894123c7d35a1ccef08651af570
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

link.MachO.Dylib: allow maccatalyst output to link macos libraries in TBDs

This is the logic that LLD uses. It is pretty silly, but it is what it is.

1 files changed, 5 insertions(+), 0 deletions(-)

src/link/MachO/Dylib.zig+5
...@@ -716,6 +716,11 @@ pub const TargetMatcher = struct {...@@ -716,6 +716,11 @@ pub const TargetMatcher = struct {
716 const host_target = try targetToAppleString(allocator, cpu_arch, .MACOS);716 const host_target = try targetToAppleString(allocator, cpu_arch, .MACOS);
717 try self.target_strings.append(allocator, host_target);717 try self.target_strings.append(allocator, host_target);
718 },718 },
719 .MACCATALYST => {
720 // Mac Catalyst is allowed to link macOS libraries in a TBD because Apple were apparently too lazy
721 // to add the proper target strings despite doing so in other places in the format???
722 try self.target_strings.append(allocator, try targetToAppleString(allocator, cpu_arch, .MACOS));
723 },
719 .MACOS => {724 .MACOS => {
720 // Turns out that around 10.13/10.14 macOS release version, Apple changed the target tags in725 // Turns out that around 10.13/10.14 macOS release version, Apple changed the target tags in
721 // tbd files from `macosx` to `macos`. In order to be compliant and therefore actually support726 // tbd files from `macosx` to `macos`. In order to be compliant and therefore actually support