From 2125c94abeb2a592d03471f72426073d37400be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 14 Nov 2025 18:30:14 +0100 Subject: [PATCH] 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. --- src/link/MachO/Dylib.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/link/MachO/Dylib.zig b/src/link/MachO/Dylib.zig index 526ca2d086..c78d52f815 100644 --- a/src/link/MachO/Dylib.zig +++ b/src/link/MachO/Dylib.zig @@ -716,6 +716,11 @@ pub const TargetMatcher = struct { const host_target = try targetToAppleString(allocator, cpu_arch, .MACOS); try self.target_strings.append(allocator, host_target); }, + .MACCATALYST => { + // Mac Catalyst is allowed to link macOS libraries in a TBD because Apple were apparently too lazy + // to add the proper target strings despite doing so in other places in the format??? + try self.target_strings.append(allocator, try targetToAppleString(allocator, cpu_arch, .MACOS)); + }, .MACOS => { // Turns out that around 10.13/10.14 macOS release version, Apple changed the target tags in // tbd files from `macosx` to `macos`. In order to be compliant and therefore actually support