diff --git a/src/link/MachO/Dylib.zig b/src/link/MachO/Dylib.zig --- a/src/link/MachO/Dylib.zig +++ b/src/link/MachO/Dylib.zig @@ -732,6 +732,14 @@ pub const TargetMatcher = struct { }; const apple_string = try targetToAppleString(allocator, cpu_arch, platform); try self.target_strings.append(allocator, apple_string); + // Xcode 26.4 unified the arm64 and arm64e TBD entries under the + // arm64e name. Treat them as equivalent when matching SDK stubs. + if (cpu_arch == .aarch64) { + const arm64e_string = try std.fmt.allocPrint( + allocator, "arm64e{s}", .{apple_string["arm64".len..]}, + ); + try self.target_strings.append(allocator, arm64e_string); + } switch (platform) { .IOSSIMULATOR, .TVOSSIMULATOR, .WATCHOSSIMULATOR, .VISIONOSSIMULATOR => { @@ -798,7 +806,8 @@ pub const TargetMatcher = struct { } fn matchesArch(self: TargetMatcher, archs: []const []const u8) bool { - return hasValue(archs, cpuArchToAppleString(self.cpu_arch)); + if (hasValue(archs, cpuArchToAppleString(self.cpu_arch))) return true; + return self.cpu_arch == .aarch64 and hasValue(archs, "arm64e"); } fn matchesTarget(self: TargetMatcher, targets: []const []const u8) bool {