Repository navigation
Use lld for ASP.NET Core AOT musl tools - #6798
Conversation
Force the linker flavor to lld when publishing ASP.NET Core bundled tools as NativeAOT for linux-musl RIDs. This avoids selecting the NativeAOT Linux default of bfd in VMR cross-build containers that do not provide ld.bfd. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Scopes a workaround for NativeAOT publishing of the ASP.NET Core bundled tools so that linux-musl-* publishes use the lld linker in VMR cross-build containers (which don’t include ld.bfd), while leaving non-musl Linux publishes on the default behavior.
Changes:
- Set
LinkerFlavor=lldduring AOT publish whenRuntimeIdentifierstarts withlinux-musl-and noLinkerFlavoris already specified. - Added an inline comment explaining why the musl-specific linker override is needed in VMR.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This fixes the 3 Alpine/musl legs but 5 of 8 failing legs use non-musl RIDs and will still fail:
These are cross-compiled inside AzureLinux containers that also don't have The runtime solved this with environment detection instead of RID matching — the |
Replace the linux-musl-* RID check with the LocateNativeCompiler target pattern from runtime/eng/toolAot.targets. This probes the actual build environment for lld availability, which correctly handles both musl containers AND glibc cross-build containers that also lack ld.bfd. Co-authored-by: Copilot <[email protected]>
|
As a side note, we could dedup this target in arcade/eng/common/native and reuse it in sdk, runtime and maybe more repos under dotnet/ org in the future. It is basically compatible with dotnet engineering infrastructure. As an end-user of PublishAot, I may just install cross binutils for cross publishing or just use the actual linux-arm64 machine etc. to build native stuff on the target platform (which is publicly documented). |
Fixes the VMR rolling build failure reported after #6720 where NativeAOT publishing for the ASP.NET Core bundled tools selected the Linux default
bfdlinker forlinux-musl-*RIDs, but the cross-build containers do not provideld.bfd.This scopes the workaround to the ASP.NET Core tool NativeAOT publishes by setting
LinkerFlavor=lldonly whenRuntimeIdentifierstarts withlinux-musl-. Non-musl Linux publishes continue to use the existing NativeAOT default.Tagging @lewing and @am11 from the #6720 discussion.
Note
This PR description was generated by GitHub Copilot.
Validation:
src\aspnetcore\restore.cmd.LinkerFlavorvia MSBuild fordotnet-user-secrets,dotnet-user-jwts, anddotnet-dev-certs:linux-musl-arm64=lld;linux-x64=bfd.