Preserve the executable header in the default export policy - #3073
Open
karim-alweheshy wants to merge 2 commits into
Conversation
karim-alweheshy
marked this pull request as ready for review
September 15, 2026 13:25
karim-alweheshy
requested review from
aaronsky,
adincebic,
brentleyjones,
keith and
luispadron
as code owners
September 15, 2026 13:25
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.
Summary
Companion to #3024, targeting
ks/add-empty-exported_symbols_list-by-defaultrather thanmain. This keeps Keith's existing commits intact and adds only the header-preserving follow-up discussed in #3024 (comment).The default export policy now retains
__mh_execute_headerfor executable Mach-Os instead of exporting nothing. Crash reporters use a dynamic lookup of that symbol to locate the main image; Firebase's implementation is one example.Validation
Using Xcode 26.5 (17F42), Apple ld 1267:
x86_64andarm64slices so ARM workers can execute it without Rosetta. The runtime test passed with Bazel 8.0.1 and 9.2.0; both slices also passed explicit architecture-selected execution. The original Intel-only fixture fails forced ARM execution with “Bad CPU type in executable.”dlsym(RTLD_MAIN_ONLY, MH_EXECUTE_SYM)anddladdrrecover the main image, while lookup of the ordinarymainsymbol fails.-no_exported_symbolsimplementation makes that runtime test fail with “The executable header must remain discoverable.” Restoring this fix makes it pass.git diff --checkpassed.The focused checks do not replace the full upstream CI matrix or an end-to-end Firebase crash-upload test. Framework export derivation is intentionally out of scope.
Integration
Merge this companion into #3024's branch, or cherry-pick the follow-up commit. This does not rebase #3024 onto current
mainor resolve its existing main-branch conflicts.