Recently Apple deprecated the NXFindBestFatArch
, used to find the most compatible / appropriate slice in a universal/fat binary.
However its replacement macho_best_slice
is broken and will return EBADARCH
for any non-Apple binary 😓
The issue seems to be that the dyld3::GradedArchs::grade
method does not take into the account the nuances of the CPU sub types of type *_ALL
. Namely that any CPU with a more specific sub type (e.g. CPU_SUBTYPE_ARM64E
) can also still execute code compiled with a CPU sub type of *_ALL
(e.g. CPU_SUBTYPE_ARM64_ALL
).
All the details (+code, +debugging, +disassembly) posted at: https://objective-see.org/blog/blog_0x80.html.
Also, hrmm!?: