Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LoongArch64] add crossgen2 for LoongArch64. #72017

Merged
merged 7 commits into from
Jul 15, 2022
Merged

Conversation

shushanhf
Copy link
Contributor

@shushanhf shushanhf commented Jul 12, 2022

This is part of the issue #69705 to amend the LA's port.

Although I had compiled the crossgen2.csproj on x64-linux, there is still some other errors when building by ./build.sh clr

  [100%] Built target singlefilehost
  Install the project...
  -- Install configuration: "DEBUG"
  ~/runtime/src/coreclr
  Repo successfully built.
  Product binaries are available at /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug
  runincontext -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/runincontext.dll
  tieringtest -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/tieringtest.dll
  ILCompiler.TypeSystem -> /home/qiao/runtime/artifacts/bin/ILCompiler.TypeSystem/x64/Debug/ILCompiler.TypeSystem.dll
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs(613,30): error CS1061: “Machine”未包含“LoongArch64”的定义,并且找不到可接受第一个“Machine”类型参数的可访问扩展方法“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs(614,50): error CS1061: “Architecture”未包含“LoongArch64”的定义,并且找不到可接受第一个“Architecture”类型参数的可访问扩展方法“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj]
  ILCompiler.Diagnostics -> /home/qiao/runtime/artifacts/bin/ILCompiler.Diagnostics/x64/Debug/ILCompiler.Diagnostics.dll

生成失败。

/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs(613,30): error CS1061: “Machine”未包含“LoongArch64”的定义,并且找不到可接受第一个“Machine”类型参数的可访问扩展方法“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs(614,50): error CS1061: “Architecture”未包含“LoongArch64”的定义,并且找不到可接受第一个“Architecture”类型参数的可访问扩展方法“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj]
    0 个警告
    2 个错误

已用时间 00:00:07.65
Build failed with exit code 1. Check errors above.

The version of the SDK is liking

qiao@X64:~/runtime$ .dotnet/dotnet --version
7.0.100-preview.5.22307.18

How to resolve this error for supporting Machine.LoongArch64.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 12, 2022
@teo-tsirpanis
Copy link
Contributor

The ILCompiler.Reflection.ReadyToRun project targets .NET Standard 2.0 because ILSpy requires it.

@dgrunwald is that still required? I see that the ILSpy.ReadyToRun project targets .NET 6.

@dgrunwald
Copy link

The decompiler itself is still .NET Standard 2.0, but that doesn't need ReadyToRun. Everything else in ILSpy should be using .NET 6.
Switching ILCompiler.Reflection.ReadyToRun to .NET 6 should be fine for us.

@teo-tsirpanis
Copy link
Contributor

teo-tsirpanis commented Jul 12, 2022

OK, that's great. @shushanhf if you change ILCompiler.Reflection.ReadyToRun.csproj as follows, the compiler errors should go away.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <AssemblyName>ILCompiler.Reflection.ReadyToRun</AssemblyName>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <OutputType>Library</OutputType>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <AssemblyKey>Open</AssemblyKey>
    <IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
-    <!-- ILSpy requires this assembly to target netstandard2.0 -->
+    <!-- ILSpy requires this assembly to target net6.0 -->
-    <TargetFramework>netstandard2.0</TargetFramework>
+    <TargetFramework>net6.0</TargetFramework>
    <CLSCompliant>false</CLSCompliant>
    <NoWarn>8002,NU1701</NoWarn>
    <RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
    <OutputPath>$(RuntimeBinDir)</OutputPath>
    <Platforms>AnyCPU;x64</Platforms>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>

-  <ItemGroup>
-    <PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
-    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
-  </ItemGroup>
-
  <ItemGroup>
    <Compile Include="..\..\Common\Internal\Runtime\CorConstants.cs" Link="Common\CorConstants.cs" />
    <Compile Include="..\..\Common\Internal\Runtime\ModuleHeaders.cs" Link="Common\ModuleHeaders.cs" />
    <Compile Include="..\..\Common\Internal\Runtime\ReadyToRunConstants.cs" Link="Common\ReadyToRunConstants.cs" />
    <Compile Include="..\..\Common\Internal\Runtime\ReadyToRunInstructionSet.cs" Link="Common\ReadyToRunInstructionSet.cs" />
    <Compile Include="..\..\Common\Pgo\PgoFormat.cs" Link="Common\PgoFormat.cs" />
  </ItemGroup>
</Project>

@shushanhf
Copy link
Contributor Author

OK, that's great. @shushanhf if you change ILCompiler.Reflection.ReadyToRun.csproj as follows, the compiler errors should go away.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <AssemblyName>ILCompiler.Reflection.ReadyToRun</AssemblyName>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <OutputType>Library</OutputType>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <AssemblyKey>Open</AssemblyKey>
    <IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
-    <!-- ILSpy requires this assembly to target netstandard2.0 -->
+    <!-- ILSpy requires this assembly to target net6.0 -->
-    <TargetFramework>netstandard2.0</TargetFramework>
+    <TargetFramework>net6.0</TargetFramework>
    <CLSCompliant>false</CLSCompliant>
    <NoWarn>8002,NU1701</NoWarn>
    <RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
    <OutputPath>$(RuntimeBinDir)</OutputPath>
    <Platforms>AnyCPU;x64</Platforms>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>

-  <ItemGroup>
-    <PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
-    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
-  </ItemGroup>
-
  <ItemGroup>
    <Compile Include="..\..\Common\Internal\Runtime\CorConstants.cs" Link="Common\CorConstants.cs" />
    <Compile Include="..\..\Common\Internal\Runtime\ModuleHeaders.cs" Link="Common\ModuleHeaders.cs" />
    <Compile Include="..\..\Common\Internal\Runtime\ReadyToRunConstants.cs" Link="Common\ReadyToRunConstants.cs" />
    <Compile Include="..\..\Common\Internal\Runtime\ReadyToRunInstructionSet.cs" Link="Common\ReadyToRunInstructionSet.cs" />
    <Compile Include="..\..\Common\Pgo\PgoFormat.cs" Link="Common\PgoFormat.cs" />
  </ItemGroup>
</Project>

Thanks very much!

@shushanhf
Copy link
Contributor Author

shushanhf commented Jul 13, 2022

Hi, @dgrunwald @teo-tsirpanis
I had updated the ILCompiler.Reflection.ReadyToRun.csproj but the error is same.
Because the net6.0 is not supporting the LoongArch64 untile net7.0

If I update it to net7.0 liking

@@ -8,7 +8,7 @@
     <AssemblyKey>Open</AssemblyKey>
     <IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
     <!-- ILSpy requires this assembly to target net6.0 -->
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <CLSCompliant>false</CLSCompliant>
     <NoWarn>8002,NU1701</NoWarn>
     <RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>

This ILCompiler.Reflection.ReadyToRun.csproj will be ok.

There will be a new error after the ILCompiler.Reflection.ReadyToRun.csproj liking

  Product binaries are available at /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug
  runincontext -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/runincontext.dll
  tieringtest -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/tieringtest.dll
  ILCompiler.TypeSystem -> /home/qiao/runtime/artifacts/bin/ILCompiler.TypeSystem/x64/Debug/ILCompiler.TypeSystem.dll
  ILCompiler.Diagnostics -> /home/qiao/runtime/artifacts/bin/ILCompiler.Diagnostics/x64/Debug/ILCompiler.Diagnostics.dll
  ILCompiler.Reflection.ReadyToRun -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/ILCompiler.Reflection.ReadyToRun.dll
  R2RDump -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/R2RDump/R2RDump.dll
  dotnet-pgo -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/dotnet-pgo/dotnet-pgo.dll
  repro -> /home/qiao/runtime/artifacts/bin/repro/x64/Debug/repro.dll
  R2RTest -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/R2RTest/R2RTest.dll
  ILCompiler.DependencyAnalysisFramework -> /home/qiao/runtime/artifacts/bin/ILCompiler.DependencyAnalysisFramework/x64/Debug/ILCompiler.DependencyAnalysisFramework.dll
  ILCompiler.ReadyToRun -> /home/qiao/runtime/artifacts/bin/ILCompiler.ReadyToRun/x64/Debug/ILCompiler.ReadyToRun.dll
  crossgen2 -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/crossgen2/crossgen2.dll
  ILCompiler.Build.Tasks -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/ilc/netstandard/ILCompiler.Build.Tasks.dll
  ILCompiler.MetadataTransform -> /home/qiao/runtime/artifacts/bin/ILCompiler.MetadataTransform/x64/Debug/ILCompiler.MetadataTransform.dll
/home/qiao/runtime/src/coreclr/tools/Common/Compiler/DependencyAnalysis/AssemblyStubNode.cs(87,67): error CS0246: 未能找到类型或命名空间名“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64TentativeMethodNode.cs(8,26): error CS0534: “TentativeMethodNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(315,26): error CS0534: “ReadyToRunGenericLookupFromDictionaryNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(337,26): error CS0534: “ReadyToRunGenericLookupFromTypeNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMInitialInterfaceDispatchStubNode.cs(20,26): error CS0534: “InitialInterfaceDispatchStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunHelperNode.cs(46,26): error CS0534: “ReadyToRunHelperNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64UnboxingStubNode.cs(8,26): error CS0534: “UnboxingStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]

生成失败。

/home/qiao/runtime/src/coreclr/tools/Common/Compiler/DependencyAnalysis/AssemblyStubNode.cs(87,67): error CS0246: 未能找到类型或命名空间名“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64TentativeMethodNode.cs(8,26): error CS0534: “TentativeMethodNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(315,26): error CS0534: “ReadyToRunGenericLookupFromDictionaryNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(337,26): error CS0534: “ReadyToRunGenericLookupFromTypeNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMInitialInterfaceDispatchStubNode.cs(20,26): error CS0534: “InitialInterfaceDispatchStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunHelperNode.cs(46,26): error CS0534: “ReadyToRunHelperNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64UnboxingStubNode.cs(8,26): error CS0534: “UnboxingStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
    0 个警告
    7 个错误

已用时间 00:00:13.24

I think there are still some other *.csproj that should update the TargetFramework to supporting LoongArch64.

@shushanhf
Copy link
Contributor Author

Hi, @dgrunwald @teo-tsirpanis I had updated the ILCompiler.Reflection.ReadyToRun.csproj but the error is same. Because the net6.0 is not supporting the LoongArch64 untile net7.0

If I update it to net7.0 liking

@@ -8,7 +8,7 @@
     <AssemblyKey>Open</AssemblyKey>
     <IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
     <!-- ILSpy requires this assembly to target net6.0 -->
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <CLSCompliant>false</CLSCompliant>
     <NoWarn>8002,NU1701</NoWarn>
     <RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>

This ILCompiler.Reflection.ReadyToRun.csproj will be ok.

There will be a new error after the ILCompiler.Reflection.ReadyToRun.csproj liking

Product binaries are available at /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug
runincontext -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/runincontext.dll
tieringtest -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/tieringtest.dll
ILCompiler.TypeSystem -> /home/qiao/runtime/artifacts/bin/ILCompiler.TypeSystem/x64/Debug/ILCompiler.TypeSystem.dll
ILCompiler.Diagnostics -> /home/qiao/runtime/artifacts/bin/ILCompiler.Diagnostics/x64/Debug/ILCompiler.Diagnostics.dll
ILCompiler.Reflection.ReadyToRun -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/ILCompiler.Reflection.ReadyToRun.dll
R2RDump -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/R2RDump/R2RDump.dll
dotnet-pgo -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/dotnet-pgo/dotnet-pgo.dll
repro -> /home/qiao/runtime/artifacts/bin/repro/x64/Debug/repro.dll
R2RTest -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/R2RTest/R2RTest.dll
ILCompiler.DependencyAnalysisFramework -> /home/qiao/runtime/artifacts/bin/ILCompiler.DependencyAnalysisFramework/x64/Debug/ILCompiler.DependencyAnalysisFramework.dll
ILCompiler.ReadyToRun -> /home/qiao/runtime/artifacts/bin/ILCompiler.ReadyToRun/x64/Debug/ILCompiler.ReadyToRun.dll
crossgen2 -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/crossgen2/crossgen2.dll
ILCompiler.Build.Tasks -> /home/qiao/runtime/artifacts/bin/coreclr/Linux.x64.Debug/ilc/netstandard/ILCompiler.Build.Tasks.dll
ILCompiler.MetadataTransform -> /home/qiao/runtime/artifacts/bin/ILCompiler.MetadataTransform/x64/Debug/ILCompiler.MetadataTransform.dll
/home/qiao/runtime/src/coreclr/tools/Common/Compiler/DependencyAnalysis/AssemblyStubNode.cs(87,67): error CS0246: 未能找到类型或命名空间名“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64TentativeMethodNode.cs(8,26): error CS0534: “TentativeMethodNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(315,26): error CS0534: “ReadyToRunGenericLookupFromDictionaryNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(337,26): error CS0534: “ReadyToRunGenericLookupFromTypeNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMInitialInterfaceDispatchStubNode.cs(20,26): error CS0534: “InitialInterfaceDispatchStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunHelperNode.cs(46,26): error CS0534: “ReadyToRunHelperNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64UnboxingStubNode.cs(8,26): error CS0534: “UnboxingStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]

生成失败。

/home/qiao/runtime/src/coreclr/tools/Common/Compiler/DependencyAnalysis/AssemblyStubNode.cs(87,67): error CS0246: 未能找到类型或命名空间名“LoongArch64”(是否缺少 using 指令或程序集引用?) [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64TentativeMethodNode.cs(8,26): error CS0534: “TentativeMethodNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(315,26): error CS0534: “ReadyToRunGenericLookupFromDictionaryNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunGenericHelperNode.cs(337,26): error CS0534: “ReadyToRunGenericLookupFromTypeNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMInitialInterfaceDispatchStubNode.cs(20,26): error CS0534: “InitialInterfaceDispatchStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunHelperNode.cs(46,26): error CS0534: “ReadyToRunHelperNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64UnboxingStubNode.cs(8,26): error CS0534: “UnboxingStubNode”不实现继承的抽象成员“AssemblyStubNode.EmitCode(NodeFactory, ref LoongArch64.LoongArch64Emitter, bool)” [/home/qiao/runtime/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj]
0 个警告
7 个错误

已用时间 00:00:13.24
I think there are still some other *.csproj that should update the TargetFramework to supporting LoongArch64.

I will update another patch to add new *.cs files for LoongArch64.

@shushanhf
Copy link
Contributor Author

Hi, @dgrunwald @teo-tsirpanis

I had updated the patches.
Now build.sh clr is ok on x64-linux if setting the TargetFramework as net7.0 within the ILCompiler.Reflection.ReadyToRun.csproj.

@shushanhf
Copy link
Contributor Author

Hi, @jkotas
Could you please review this PR for supporting LA's crossgens2 ?

@shushanhf shushanhf requested a review from jkotas July 14, 2022 02:48
@cshung
Copy link
Member

cshung commented Jul 14, 2022

@shushanhf Since the initial build error for ReadyToRunReader is simply not recognizing the Machine.LoongArch64 symbolic constant, maybe we can work around it with a simple cast:

case Machine.LoongArch64: -> case (Machine) 0x6264 /* LoongArch64 */ ?

If that works, it might be a much easier route forward.

@shushanhf
Copy link
Contributor Author

@shushanhf Since the initial build error for ReadyToRunReader is simply not recognizing the Machine.LoongArch64 symbolic constant, maybe we can work around it with a simple cast:

case Machine.LoongArch64: -> case (Machine) 0x6264 /* LoongArch64 */ ?

If that works, it might be a much easier route forward.

@cshung
That's a good idea!
Thanks very much!

@jkotas jkotas merged commit 0937f26 into dotnet:main Jul 15, 2022
@shushanhf shushanhf deleted the LA_crossgen2 branch July 16, 2022 00:28
@ghost ghost locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-loongarch64 area-crossgen2-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants