- if ( _options.preferSubArchitecture() ) {
- // first try to find a slice that match cpu-type and cpu-sub-type
+ // first try to find a slice that match cpu-type and cpu-sub-type
+ for (uint32_t i=0; i < sliceCount; ++i) {
+ if ( (OSSwapBigToHostInt32(archs[i].cputype) == (uint32_t)_options.architecture())
+ && ((OSSwapBigToHostInt32(archs[i].cpusubtype) & ~CPU_SUBTYPE_MASK) == (uint32_t)_options.subArchitecture()) ) {
+ sliceToUse = i;
+ sliceFound = true;
+ break;
+ }
+ }
+ if ( !sliceFound && _options.allowSubArchitectureMismatches() ) {
+ // look for any slice that matches just cpu-type