Link the iOS archive without ForceLoad - #22
Merged
Merged
Conversation
The first run that got as far as the linker died on duplicate symbols: duplicate symbol '_WebPInitUpsamplersNEON' duplicate symbol '_jpeg_destroy_decompress' duplicate symbol '_jsimd_ycc_extrgb_convert_neon' all of them twice inside libCesiumNativeC.a itself. The merge in CesiumC takes every .a it finds, and two pairs among them overlap by design: libjpeg.a and libturbojpeg.a are two APIs over one core, and libwebpdecoder.a is a subset of libwebp.a. So each of those objects is in the archive twice. ForceLoad is what turns that into an error. It pulls every member into the link whether or not anything references it, so both copies arrive. Ordinary linking takes the first definition and moves on, which is what browser-wasm has always done with the same archive and the same overlap. What ForceLoad was protecting against is real and does not go away: the linker keeps only members something references, and a symbol reached solely through a P/Invoke can be dropped. The smoke leg is what makes turning it off safe rather than hopeful -- it reads the built executable and fails if cesium_async_system_create is not among its defined symbols, which is exactly the failure this could cause. The duplication itself is worth removing in CesiumC, since it also makes the archive bigger than it needs to be. That is a separate change and needs a release cycle; this one does not.
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.
The first run that reached the linker died on duplicate symbols:
all of them twice inside
libCesiumNativeC.aitself. The merge in CesiumC takes every.ait finds, and two pairs among them overlap by design:libjpeg.aandlibturbojpeg.aare two APIs over one core, andlibwebpdecoder.ais a subset oflibwebp.a.ForceLoadis what turns that into an error — it pulls every member into the link whether or not anything references it, so both copies arrive. Ordinary linking takes the first definition and moves on, which is what browser-wasm has always done with the same archive and the same overlap.What ForceLoad was protecting against does not go away
The linker keeps only members something references, and a symbol reached solely through a P/Invoke can be dropped. The smoke leg is what makes turning this off safe rather than hopeful: it reads the built executable and fails if
cesium_async_system_createis not among its defined symbols — exactly the failure this could cause.That check was written before this problem existed, for a different reason. It is the reason this can be a one-line change rather than a guess.
Good news in the same run
The
macos-latestmove worked:Xcode 26.6, and the build got all the way toclang++. So the targets file is putting the archive on the link line — the half of phase 4 that had never been exercised.The duplication itself is worth removing in CesiumC, since it also makes a 61 MB archive bigger than it needs to be and any consumer passing
-force_loadhits the same wall. Separate change, needs a release cycle, tracked.