Fix "Too many personality routines for compact unwind" link error for iOS#154
Merged
Conversation
hkmt-mmy
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
The previous PR #152 localized the bundled mimalloc in the iOS
libunienc_c.aviald -r -exported_symbols_list _unienc*— i.e. it kept only_unienc*global and made everything else local, including the Rust runtime's exception-handling personality routines.That over-localizes. When a downstream Xcode project statically links this
.aalongside other static libraries, each lib ends up carrying its own local personality routine. The Mach-O compact-unwind format can encode at most 3 personality routines per image, so the extra copies overflow that limit and the link fails:Fix
Localize only mimalloc's own symbols, and leave everything else (the
_unienc*FFI entry points and the Rust runtime / personality symbols) global so the linker can coalesce them normally.ld -rfrom-exported_symbols_listto-unexported_symbols_list, listing just the mimalloc symbol families:nm).apple-exports.txt→apple-mimalloc-unexports.txt.Result after localization (verified on macos-15 / ld-prime):
_unienc*: 34 kept global