From: David Wrighton Date: Tue, 24 Sep 2019 20:35:58 +0000 (-0700) Subject: Use netcoreapp3.0 for building crossgen2 (dotnet/coreclr#26792) X-Git-Tag: submit/tizen/20210909.063632~11030^2~532 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5430cd669893adebca2d62e5d8504311b052c5a;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Use netcoreapp3.0 for building crossgen2 (dotnet/coreclr#26792) * Use netcoreapp3.0 for building crossgen2 - Enables better debugging support - Enables use of netcoreapp3.0 surface area in crossgen2 - Should improve performance - Initialize the PAL in the jit on Unix builds - Enable crossgen2smoke on alpine Commit migrated from https://github.com/dotnet/coreclr/commit/41471dc78816edffa072582f2f826210829bf0d1 --- diff --git a/src/coreclr/src/tools/crossgen2/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/src/tools/crossgen2/Common/JitInterface/CorInfoImpl.cs index a64cf95..6b2d62d 100644 --- a/src/coreclr/src/tools/crossgen2/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/src/tools/crossgen2/Common/JitInterface/CorInfoImpl.cs @@ -55,6 +55,11 @@ namespace Internal.JitInterface private ExceptionDispatchInfo _lastException; + private static bool s_jitRegistered = RegisterJITModule(); + + [DllImport("clrjitilc")] + private extern static IntPtr PAL_RegisterModule([MarshalAs(UnmanagedType.LPUTF8Str)] string moduleName); + [DllImport("clrjitilc", CallingConvention=CallingConvention.StdCall)] // stdcall in CoreCLR! private extern static IntPtr jitStartup(IntPtr host); @@ -109,12 +114,26 @@ namespace Internal.JitInterface private readonly UnboxingMethodDescFactory _unboxingThunkFactory; + private static bool RegisterJITModule() + { + if ((Environment.OSVersion.Platform == PlatformID.Unix) || (Environment.OSVersion.Platform == PlatformID.MacOSX)) + { + return PAL_RegisterModule("libclrjitilc.so") != (IntPtr)1; + } + else + { + return true; + } + } + public CorInfoImpl(JitConfigProvider jitConfig) { // // Global initialization // _jitConfig = jitConfig; + if (!s_jitRegistered) + throw new IOException("Failed to register JIT"); jitStartup(GetJitHost(_jitConfig.UnmanagedInstance)); diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj index 3a0dc1e..3ac648b1 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj @@ -7,7 +7,7 @@ netstandard1.3 false x64;x86 - $(BinDir)\crossgen2 + $(BinDir)/crossgen2/libs false diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj index 28f4459..87bfdf3 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj @@ -4,12 +4,12 @@ Library ILCompiler.ReadyToRun - netstandard1.3 + netcoreapp3.0 true READYTORUN;$(DefineConstants) false x64;x86 - $(BinDir)\crossgen2 + $(BinDir)/crossgen2/libs false diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj b/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj index d130008..0598bb9 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj @@ -9,7 +9,7 @@ netstandard1.3 false x64;x86 - $(BinDir)\crossgen2 + $(BinDir)/crossgen2/libs false diff --git a/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj b/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj index 2a1fe01..e1d1e9c 100644 --- a/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj +++ b/src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj @@ -5,10 +5,10 @@ crossgen2 true Exe - netcoreapp2.0 + netcoreapp3.0 8002,NU1701 x64;x86 - $(BinDir)\crossgen2 + $(BinDir)/crossgen2 false diff --git a/src/coreclr/tests/src/readytorun/crossgen2/crossgen2smoke.csproj b/src/coreclr/tests/src/readytorun/crossgen2/crossgen2smoke.csproj index 674eba3..d521fc1 100644 --- a/src/coreclr/tests/src/readytorun/crossgen2/crossgen2smoke.csproj +++ b/src/coreclr/tests/src/readytorun/crossgen2/crossgen2smoke.csproj @@ -27,14 +27,7 @@ $(CLRTestBatchPreCommands) ]]>