Add the _requiresAlign8 bool to the compare and mangled name for GCStaticEETypeNode.cs#107650
Add the _requiresAlign8 bool to the compare and mangled name for GCStaticEETypeNode.cs#107650MichalStrehovsky merged 2 commits intodotnet:mainfrom
Conversation
jkotas
left a comment
There was a problem hiding this comment.
Thanks! I assume we want to backport this to .NET 9
I'm on the fence. The duplicate symbol means that this will not actually link and the failure mode will be pretty obvious (duplicate symbol for a GCStatic EEType). We haven't hit this in testing so I assume it's quite rare to have doubles in threadstatics. It's not a regression since we didn't have ARM32 previously. @dotnet/ilc-contrib for thoughts. |
|
It is a bug in new .NET 9 feature. Bugs in new features meet the backport bar. @yowl How did you find this bug? Was it in something real? |
|
@jkotas, it was in compiling a real Avalonia XPF app. Avalonia don't support NativeAOT-LLVM for the Wasm target, so in that sense it was not real. |
You don't actually get that far as the sorting asserts. The only way I saw the duplicate symbol was with half the fix. |
It means that Avalonia contains thread static fields that need alignment. We should backport this to .NET 9. |
|
/backport to release/9.0 |
|
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10817533064 |
This PR (from downstream dotnet/runtimelab#2681) adds the
_requiresAlign8bool to both the compare and mangled name. It is possible for 2 nodes to have the same GC map but have differing align 8 requirements causing an assert in the sort, and a duplicate symbol name.