Skip to content

Commit 2125c94

Browse files
committed
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 parent ca75237 commit 2125c94

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/link/MachO/Dylib.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,11 @@ pub const TargetMatcher = struct {
716716
const host_target = try targetToAppleString(allocator, cpu_arch, .MACOS);
717717
try self.target_strings.append(allocator, host_target);
718718
},
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+
},
719724
.MACOS => {
720725
// Turns out that around 10.13/10.14 macOS release version, Apple changed the target tags in
721726
// tbd files from `macosx` to `macos`. In order to be compliant and therefore actually support

0 commit comments

Comments
 (0)