Skip to content

Define empty compressed assembly symbols#11479

Open
simonrozsival wants to merge 2 commits into
dev/simonrozsival/trimmable-typemap-r2r-packagingfrom
dev/simonrozsival/empty-compressed-assembly-symbols
Open

Define empty compressed assembly symbols#11479
simonrozsival wants to merge 2 commits into
dev/simonrozsival/trimmable-typemap-r2r-packagingfrom
dev/simonrozsival/empty-compressed-assembly-symbols

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

Follow-up to #11473.

When AndroidEnableAssemblyCompression=false, the compressed assemblies generator emitted only uncompressed_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 BasicApplicationPublishReadyToRun to cover the no-compression case.

Validated with:

MSBUILDDISABLENODEREUSE=1 ./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter Name=BasicApplicationPublishReadyToRun -v:minimal

simonrozsival and others added 2 commits May 25, 2026 07:50
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>
@simonrozsival simonrozsival added the copilot `copilot-cli` or other AIs were used to author this label May 25, 2026
@simonrozsival simonrozsival marked this pull request as ready for review May 25, 2026 10:50
Copilot AI review requested due to automatic review settings May 25, 2026 10:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and uncompressed_assemblies_data_size when there are no compressed assemblies.
  • Keep emitting (now alongside the others) an empty uncompressed_assemblies_data_buffer definition in the no-compression case.
  • Extend BasicApplicationPublishReadyToRun to 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.

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot `copilot-cli` or other AIs were used to author this ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants