Repository navigation
Closed
Labels
Area: NativeAOTIssues that only occur when using NativeAOT.needs-triageIssues that need to be assigned.trimmable-type-map
Description
Summary
_AndroidComputeIlcCompileInputs in Microsoft.Android.Sdk.NativeAOT.targets hardcodes the assumption that ILLink ran before ILC. It manually reads trimmed assemblies from $(IntermediateLinkDir)linked/ and populates IlcCompileInput and IlcReference from there, bypassing the standard ResolvedFileToPublish contract.
This prevents the trimmable type map path from working with NativeAOT, because the trimmable path does not run ILLink — ILC should do its own trimming directly.
Current behavior
IlcCompileDependsOnunconditionally chainsPrepareForILLink→ILLink_AndroidBeforeIlcCompiledepends on_PrepareLinking(defined inTypeMap.LlvmIr.targets)_AndroidComputeIlcCompileInputsreads from$(IntermediateLinkDir)and@(ManagedAssemblyToLink)instead of@(ResolvedFileToPublish)_AndroidRunNativeCompiledepends on_PreTrimmingFixLegacyDesignerUpdateItems(also fromTypeMap.LlvmIr.targets)
Proposed design
_AndroidComputeIlcCompileInputsshould populateIlcCompileInputandIlcReferencefrom@(ResolvedFileToPublish), matching the SDK's_ComputeIlcCompileInputscontract inMicrosoft.NETCore.Native.Publish.targets. When ILLink ran,ResolvedFileToPublishalready points at trimmed assemblies. When ILLink did not run, it has the originals.IlcCompileDependsOnshould conditionally includePrepareForILLink/ILLinkbased on_AndroidTypeMapImplementation- ILLink-specific settings (
RunILLink,SuppressTrimAnalysisWarnings,_ExtraTrimmerArgs) should be conditioned on_AndroidTypeMapImplementation != trimmable - Dependencies on targets from
TypeMap.LlvmIr.targets(_PrepareLinking,_PreTrimmingFixLegacyDesignerUpdateItems) should be removed or conditioned
Context
- Related to [TrimmableTypeMap] NativeAOT end-to-end validation #11052 (NativeAOT end-to-end validation with trimmable type map)
- Blocking NativeAOT + trimmable type map builds
This content was created with assistance from AI.
Metadata
Metadata
Assignees
Labels
Area: NativeAOTIssues that only occur when using NativeAOT.needs-triageIssues that need to be assigned.trimmable-type-map
Activity
[NativeAOT] Decouple ILC input wiring from ILLink output
[NativeAOT] Decouple ILC input wiring from ILLink output
[NativeAOT] Decouple ILC from ILLink for trimmable type map path (#11183
[NativeAOT] Add GenerateNativeAotBootstrapSources task (#11255)