Skip to content

[NativeAOT] IlcCompileInput ignores ILLink output when RunILLink=true #127577

Open

Description

@sbomer

ComputeIlcCompileInputs in Microsoft.NETCore.Native.targets sets IlcCompileInput from @(IntermediateAssembly). When RunILLink=true and ILLink runs before ILC, the main assembly in $(IntermediateLinkDir) may differ from IntermediateAssembly (e.g. due to pre-trimming assembly rewrites). ILC compiles the wrong assembly, causing runtime failures.

The default NativeAOT flow has RunILLink=false so this does not arise. Android sets RunILLink=true to run custom ILLink steps before ILC.

Workaround:

Override IlcCompileInput after ComputeIlcCompileInputs:

<IlcCompileInput Remove="@(IlcCompileInput)" />
<IlcCompileInput Include="$(IntermediateLinkDir)$(TargetName)$(TargetExt)" />

Related: dotnet/android#11183

This content was created with assistance from AI.

Activity

  1. added
    untriaged
    on Apr 29, 2026
  2. dotnet-policy-service commented on Apr 29, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
    See info in area-owners.md if you want to be subscribed.

  3. added this to the 11.0.0 milestone on Jun 22, 2026
  4. removed
    untriaged
    on Jun 22, 2026
  5. modified the milestones: 11.0.0, 12.0.0 on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions