Skip to content

Native AOT publish for win-arm64 fails with LNK1322 (Cortex-A53 erratum 843419) on .NET 11 RC 1 #133835

Description

@jamescrosswell

Description

A Native AOT console app that publishes fine for win-arm64 with .NET 11 preview 7 fails at the link step with .NET 11 RC 1. The linker can't apply its Cortex-A53 erratum 843419 fix-up to the object file ILCompiler produces.

Reproduction Steps

Repro repo: https://github.com/jamescrosswell/dotnet-nativeaot-lnk1322-repro

On a win-arm64 machine with SDK 11.0.100-rc.1.26425.128:

git clone https://github.com/jamescrosswell/dotnet-nativeaot-lnk1322-repro
cd dotnet-nativeaot-lnk1322-repro
dotnet publish apps/console-app -c Release -r win-arm64 -f net11.0 -p:SentryNative=false

apps/console-app is a dotnet new console app with PublishAot=true and a reference to Sentry 7.0.0-prerelease, which is included in the repo under packages/.

The repo's workflow runs this on a GitHub-hosted windows-11-arm runner: failing run.

Expected behavior

The app publishes successfully.

Actual behavior

console-app.obj : fatal error LNK1322: cannot avoid potential ARM hazard (Cortex-A53 MPCore processor bug #843419) in section 0x2; please consider using compiler option /Gy if it was not used
Microsoft.NETCore.Native.targets(425,5): error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\Hostarm64\arm64\link.exe" @"obj\Release\net11.0\win-arm64\native\link.rsp"" exited with code 1322.

Job log

Regression?

Yes. It worked with .NET 11 preview 7. Same runner image, same MSVC linker:

App SDK / ILCompiler Result
console-app 11.0.100-rc.1.26425.128 / 11.0.0-rc.1.26425.128 LNK1322 (job)
console-app 11.0.100-preview.7.26381.103 / 11.0.0-preview.7.26381.103 links (job)
Same code and package, assembly named IntegrationTestApp RC 1 links (job)

Known Workarounds

None we can apply. /Gy is a cl.exe option and doesn't apply to an object file produced by ILCompiler. Changing the code layout avoids the error (for example, renaming the assembly), but that isn't a practical workaround.

Configuration

  • .NET SDK 11.0.100-rc.1.26425.128, ILCompiler 11.0.0-rc.1.26425.128
  • Target and host: win-arm64
  • MSVC 14.44.35207, bin\Hostarm64\arm64\link.exe (Visual Studio 2022 Enterprise)
  • GitHub Actions windows-11-arm runner. It fails on images 20260830.155.1 and 20260906.161.1.

Other information

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions