Skip to content

feat(macho): patch universal binaries in 64-bit fat containers - #828

Merged
indaco merged 1 commit into
mainfrom
feat/parse-fat64-bottles
Aug 10, 2026
Merged

feat(macho): patch universal binaries in 64-bit fat containers#828
indaco merged 1 commit into
mainfrom
feat/parse-fat64-bottles

Conversation

@indaco

@indaco indaco commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Description

A universal binary shipped in a 64-bit fat container is now patched like any other binary. The parser recognised only the 32-bit container magic, so such a file was rejected as InvalidMagic - a misleading error for a perfectly valid Mach-O - and the patcher gave up on it, leaving its install-prefix paths pointing at the build prefix. The slice bounds guards are shared with the 32-bit path, so a malformed 64-bit arch table still fails closed.

RELOC_LOGIC_VERSION moves to 7 so cached kegs are re-relocated once: a keg cached under the old version could hold such a binary with its paths unpatched, and that cache is served before any re-patching happens.

This does not change what malt can do with bottles larger than 4 GiB.

Related Issue

  • None

Notes for Reviewers

  • None

Base automatically changed from refactor/fat-arch-reader to main August 10, 2026 13:59
@indaco
indaco force-pushed the feat/parse-fat64-bottles branch from 0d30009 to d328de9 Compare August 10, 2026 13:59
A binary shipped in a 64-bit fat container is now walked slice by slice like
any other universal binary, instead of aborting its patch with an InvalidMagic
that misdescribes a perfectly valid Mach-O file. The slice bounds guards are
shared with the 32-bit path, so a malformed 64-bit arch table fails closed the
same way.

Cached kegs are re-relocated once: a keg holding such a binary was stored with
its install-prefix paths left unpatched.
@indaco
indaco force-pushed the feat/parse-fat64-bottles branch from d328de9 to ead0e69 Compare August 10, 2026 13:59
@indaco
indaco merged commit 8219c0e into main Aug 10, 2026
3 checks passed
@indaco
indaco deleted the feat/parse-fat64-bottles branch August 10, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant