Apple: Treat arm64 as matching arm64e when resolving arch sysroots

Xcode 26.4's iPhoneOS SDK advertises arm64e (not arm64) in
libSystem.tbd. After stripping the platform suffix, the arch list
contains arm64e, which doesn't match when CMAKE_OSX_ARCHITECTURES
includes arm64. As a result, arm64 falls through to the simulator
SDK, silently breaking iOS device builds.

Since arm64e is a superset of arm64 (all arm64e devices run arm64
binaries), we now fall back to checking for arm64e when arm64 is
not found in an SDK's architecture list.
This commit is contained in:
Tor Arne Vestbø
2026-04-10 14:45:48 -04:00
committed by Brad King
parent cba931b844
commit d68bed8397
+4
View File
@@ -222,6 +222,10 @@ function(_apple_resolve_multi_arch_sysroots)
set(_arch_sysroot "")
foreach(sdk ${_sdks})
list(FIND _sdk_archs_${sdk} ${arch} arch_index)
# arm64e is a superset of arm64; an SDK listing arm64e supports arm64 binaries.
if(arch_index EQUAL -1 AND arch STREQUAL "arm64")
list(FIND _sdk_archs_${sdk} "arm64e" arch_index)
endif()
if(NOT arch_index EQUAL -1)
set(_arch_sysroot ${_sdk_path_${sdk}})
break()