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
- The failure depends on code layout. The same source and package built under a different assembly name links successfully. A hello-world app and a larger app with no packages (both in the repo) also link, which is why the repro includes a prerelease Sentry package.
- Object files are attached as workflow artifacts. Each has the ILCompiler object file,
link.rsp and the publish log:
- First seen in CI for getsentry/sentry-dotnet#5566.
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-arm64machine with SDK11.0.100-rc.1.26425.128:apps/console-appis adotnet new consoleapp withPublishAot=trueand a reference toSentry 7.0.0-prerelease, which is included in the repo underpackages/.The repo's workflow runs this on a GitHub-hosted
windows-11-armrunner: failing run.Expected behavior
The app publishes successfully.
Actual behavior
Job log
Regression?
Yes. It worked with .NET 11 preview 7. Same runner image, same MSVC linker:
console-app11.0.100-rc.1.26425.128/11.0.0-rc.1.26425.128console-app11.0.100-preview.7.26381.103/11.0.0-preview.7.26381.103IntegrationTestAppKnown Workarounds
None we can apply.
/Gyis acl.exeoption 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
11.0.100-rc.1.26425.128, ILCompiler11.0.0-rc.1.26425.128win-arm6414.44.35207,bin\Hostarm64\arm64\link.exe(Visual Studio 2022 Enterprise)windows-11-armrunner. It fails on images20260830.155.1and20260906.161.1.Other information
link.rspand the publish log:console-app, RC 1IntegrationTestAppname, RC 1console-app, preview 7 (object files for three sequential publishes)