SmartLink is what keeps the iOS symbols - #26
Merged
Conversation
…types iOS links with -dead_strip. ForceLoad pulls every member of the archive in and the strip takes back out whatever nothing references, and nothing does: these entry points are reached from managed code at run time, which the linker cannot see. The archive arrived, the executable grew from 30 MB to 32, and cesium_async_system_create was not defined in it. SmartLink has the SDK read the assembly's P/Invokes and pass -u for each, naming them as roots the strip has to keep. Proved by passing one such flag by hand before changing anything here: the executable went to 45 MB and the cesium_ symbols went from unresolved references to 175 T definitions, which is exactly the number the generator emits. ForceLoad stays on. It is what puts the members within reach at all, and it is safe now that CesiumC no longer merges libjpeg.a beside libturbojpeg.a or libwebpdecoder.a beside libwebp.a. The smoke check now reads symbol types rather than grepping for a name, and that is the more useful half of this commit. A name matches whether the symbol is a definition or an unresolved reference, so the count sat at 297 across three rounds while the thing underneath changed completely. It prints the type histogram and requires a T.
Contributor
API gate: additiveEvery symbol that existed still exists, unchanged. Nothing that compiled before stops compiling.
Enum and constant values are part of the measured surface: a renumbering keeps compiling and sends the wrong number to the driver, so it counts as a removal. |
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.
iOS links with
-dead_strip.ForceLoadpulls every member of the archive in and the strip takes back out whatever nothing references — and nothing does: these entry points are reached from managed code at run time, which the linker cannot see. The archive arrived, the executable grew from 30 MB to 32, andcesium_async_system_createwas not defined in it.SmartLinkhas the SDK read the assembly's P/Invokes and pass-ufor each, naming them as roots the strip has to keep.Proved before changing anything here
A single
-uflag passed by hand from the smoke project:175 defined globals — exactly the number of functions the generator emits.
The check is the more useful half of this
It used to grep
nm -Ufor the name. A name matches whether the symbol is a definition or an unresolved reference, so the count sat at 297 across three rounds while the thing underneath changed completely — fromUreferences toTdefinitions. That is why two rounds were spent reading an aggregate that could not answer the question.It now prints the type histogram and requires a
T.ForceLoadstays on: it is what puts the members within reach at all, and it is safe now that CesiumC#19 stopped merginglibjpeg.abesidelibturbojpeg.a.