Closed filipnavara closed 11 months ago
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.
Author: | filipnavara |
---|---|
Assignees: | - |
Labels: | `os-linux`, `arch-x64`, `area-NativeAOT-coreclr` |
Milestone: | - |
dataBuilder.CountBytes: 32
sizeBefore: 8
ContentSize: 8
Type name: ILCompiler.DependencyAnalysis.FrozenRuntimeTypeNode
Presumably this would fix it:
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FrozenRuntimeTypeNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FrozenRuntimeTypeNode.cs
@@ -26,7 +26,7 @@ public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilde
sb.Append(nameMangler.CompilationUnitPrefix).Append("__RuntimeType_").Append(nameMangler.GetMangledTypeName(_type));
}
- protected override int ContentSize => ObjectType.InstanceByteCount.AsInt;
+ protected override int ContentSize => 3 * _type.Context.Target.PointerSize;
public override void EncodeContents(ref ObjectDataBuilder dataBuilder, NodeFactory factory, bool relocsOnly)
{
You have a mismatched compiler and corelib. In .net 9 layout of RuntimeType was changed and compiler started emitting RuntimeType as a frozen object. We don't support targeting old corelib with new compiler. They must version together.
Use a .net 9 .net installer build
Thanks for explaining!
Steps to reproduce:
dotnet new webapiaot
dotnet publish
<path to runtime>/artifacts/bin/coreclr/linux.x64.Debug/ilc/ilc @./obj/Release/net8.0/linux-x64/native/webapiaot.ilc.rsp
(ie. run a debug build of ILC from main)