impr: remove mergeable-library metadata from dynamic xcframework - #8658
Draft
itaybre wants to merge 2 commits into
Draft
impr: remove mergeable-library metadata from dynamic xcframework#8658itaybre wants to merge 2 commits into
itaybre wants to merge 2 commits into
Conversation
Remove the `-Wl,-make_mergeable` linker flag from the xcframework build script. This flag added LC_ATOM_INFO metadata (~7.6 MB per arm64 slice, ~71% of the binary) that is only useful when consumers link with `-merge_framework`, which SPM does not support.
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4d144d7 | 1225.77 ms | 1255.85 ms | 30.09 ms |
| 36c25b3 | 1229.10 ms | 1255.83 ms | 26.73 ms |
| cf226b0 | 1217.35 ms | 1254.55 ms | 37.20 ms |
| bcff6b6 | 1234.67 ms | 1272.73 ms | 38.06 ms |
| dde298d | 1212.13 ms | 1247.89 ms | 35.76 ms |
| 6fd3f23 | 1231.84 ms | 1261.43 ms | 29.59 ms |
| b3f356a | 1204.00 ms | 1250.07 ms | 46.07 ms |
| e44b6f8 | 1225.98 ms | 1249.20 ms | 23.23 ms |
| df67624 | 1225.12 ms | 1259.90 ms | 34.78 ms |
| d98d6a8 | 1219.69 ms | 1255.85 ms | 36.16 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4d144d7 | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| 36c25b3 | 24.14 KiB | 1.18 MiB | 1.16 MiB |
| cf226b0 | 24.14 KiB | 1.24 MiB | 1.21 MiB |
| bcff6b6 | 24.14 KiB | 1.23 MiB | 1.20 MiB |
| dde298d | 24.14 KiB | 1.22 MiB | 1.20 MiB |
| 6fd3f23 | 24.14 KiB | 1.22 MiB | 1.20 MiB |
| b3f356a | 24.14 KiB | 1.26 MiB | 1.23 MiB |
| e44b6f8 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| df67624 | 24.14 KiB | 1.14 MiB | 1.12 MiB |
| d98d6a8 | 24.14 KiB | 1.23 MiB | 1.20 MiB |
itaybre
marked this pull request as ready for review
August 3, 2026 18:01
itaybre
requested review from
NinjaLikesCheez,
noahsmartin,
philipphofmann and
philprime
as code owners
August 3, 2026 18:01
NinjaLikesCheez
approved these changes
Aug 3, 2026
philprime
reviewed
Aug 4, 2026
| @@ -83,12 +83,6 @@ fi | |||
|
|
|||
| rm -rf XCFrameworkBuildPath/DerivedData | |||
|
|
|||
Member
There was a problem hiding this comment.
h: I understand that SPM is not supporting mergeable libraries, but these Xcode Frameworks are also consumed directly downloaded from GitHub Releases. Is this change going to break customer build scripts?
Contributor
Author
There was a problem hiding this comment.
If someone is downloading the xcframework with the intention of using it as a mergeable library, this would be a breaking change. I don't think we have any way to measure how many users are doing this.
We can wait until v10 if you believe there are users using it as mergeable
Member
There was a problem hiding this comment.
I believe it would be best-practice to do so.
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
Removes the
-Wl,-make_mergeablelinker flag fromscripts/build-xcframework-slice.sh.This flag was added in #4381 and causes every dynamic framework slice to embed
LC_ATOM_INFOmetadata. This metadata is only consumed when the app links the framework with-merge_framework/MERGEABLE_LIBRARY, but SPM does not support mergeable libraries, so consumers ship this as dead weight that counts toward App Store download size.Binary size reduction
Compared
Sentry-Dynamic.xcframeworkbuilt frommain(old) vs this branch (new):Total xcframework zip: 136 MB → 88 MB
Removing the flag does not change the runtime image — exported symbols are byte-identical, confirming
LC_ATOM_INFOis link-time-only metadata. watchOS was already excluded since the watchOS linker doesn't support-make_mergeable.Closes #8342
#skip-changelog
Test plan
make build-ios FOR_AGENTS=truepassesLC_ATOM_INFOviaotool -l