Define empty compressed assembly symbols#11479
Open
simonrozsival wants to merge 2 commits into
Open
Conversation
Emit all compressed assembly native symbols even when assembly compression is disabled so the CoreCLR app host can link and load libmonodroid successfully. Add regression coverage to the CoreCLR ReadyToRun build test, which already builds with AndroidEnableAssemblyCompression=false. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assert the exact empty compressed assemblies LLVM IR definitions when assembly compression is disabled for CoreCLR ReadyToRun publishes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes CoreCLR publish/link failures when AndroidEnableAssemblyCompression=false by ensuring the generated compressed_assemblies.*.ll always defines the full set of compressed-assembly metadata symbols, even when there are zero compressed assemblies. This aligns the LLVM IR generator output with what the CoreCLR native side expects to link against.
Changes:
- Emit empty/default definitions for
compressed_assembly_count,compressed_assembly_descriptors, anduncompressed_assemblies_data_sizewhen there are no compressed assemblies. - Keep emitting (now alongside the others) an empty
uncompressed_assemblies_data_bufferdefinition in the no-compression case. - Extend
BasicApplicationPublishReadyToRunto assert these symbols exist in the generated LLVM IR for the no-compression scenario.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Utilities/CompressedAssembliesNativeAssemblyGenerator.cs |
Adds empty symbol definitions when archData.Count == 0 so CoreCLR link-time references are satisfied even with compression disabled. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs |
Extends the R2R publish test to validate the generated compressed_assemblies.{abi}.ll contains the expected empty symbol definitions. |
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.
Follow-up to #11473.
When
AndroidEnableAssemblyCompression=false, the compressed assemblies generator emitted onlyuncompressed_assemblies_data_buffer. CoreCLR still references the other compressed assembly metadata symbols, so publish output must define them even when there are no compressed assemblies.This emits empty/default definitions for all expected symbols and extends
BasicApplicationPublishReadyToRunto cover the no-compression case.Validated with: