fix(native): rank Mach-O slices by parsed CPU subtype

This commit is contained in:
morluto
2026-10-13 16:43:12 +08:00
parent 96fc84f1fb
commit c02fb0ea80
8 changed files with 118 additions and 29 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
import type { FixupCommands } from "./AppleMachoFixups.js";
import {
MACHO_ARCHITECTURE_POLICIES,
baseMachoCpuSubtype,
machoSubtypeRank,
} from "./MachoArchitectureSelection.js";
import { machoCpuSubtypeBase } from "../domain/apple/machoCpuIdentity.js";
import {
readFatSliceDeclarations,
validateFatSlice,
@@ -117,8 +117,8 @@ export const selectMachoSlice = (
// Equal ranks keep FAT table order unless the slices share a subtype.
if (
rank === bestRank &&
baseMachoCpuSubtype(declaration.cpuSubtype) ===
baseMachoCpuSubtype(best.cpuSubtype)
machoCpuSubtypeBase(declaration.cpuSubtype) ===
machoCpuSubtypeBase(best.cpuSubtype)
)
ambiguous = true;
continue;