* 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
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);
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));
<TargetFramework>netstandard1.3</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<Platforms>x64;x86</Platforms>
- <OutputPath>$(BinDir)\crossgen2</OutputPath>
+ <OutputPath>$(BinDir)/crossgen2/libs</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<ItemGroup>
<PropertyGroup>
<OutputType>Library</OutputType>
<AssemblyName>ILCompiler.ReadyToRun</AssemblyName>
- <TargetFramework>netstandard1.3</TargetFramework>
+ <TargetFramework>netcoreapp3.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>READYTORUN;$(DefineConstants)</DefineConstants>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<Platforms>x64;x86</Platforms>
- <OutputPath>$(BinDir)\crossgen2</OutputPath>
+ <OutputPath>$(BinDir)/crossgen2/libs</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<Platforms>x64;x86</Platforms>
- <OutputPath>$(BinDir)\crossgen2</OutputPath>
+ <OutputPath>$(BinDir)/crossgen2/libs</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<ItemGroup>
<AssemblyName>crossgen2</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputType>Exe</OutputType>
- <TargetFramework>netcoreapp2.0</TargetFramework>
+ <TargetFramework>netcoreapp3.0</TargetFramework>
<NoWarn>8002,NU1701</NoWarn>
<Platforms>x64;x86</Platforms>
- <OutputPath>$(BinDir)\crossgen2</OutputPath>
+ <OutputPath>$(BinDir)/crossgen2</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
]]></CLRTestBatchPreCommands>
<BashCLRTestPreCommands><![CDATA[
$(BashCLRTestPreCommands)
-if [ -e "/etc/os-release" ]; then
- source /etc/os-release
-fi
-if [ "${ID}" != "alpine" ]; then
- $CORE_ROOT/crossgen2/crossgen2 -r:$CORE_ROOT/*.dll -o:crossgen2smoke.dll crossgen2smoke.ildll
-else
- cp crossgen2smoke.ildll crossgen2smoke.dll
-fi
+$CORE_ROOT/crossgen2/crossgen2 -r:$CORE_ROOT/*.dll -o:crossgen2smoke.dll crossgen2smoke.ildll
]]></BashCLRTestPreCommands>
</PropertyGroup>
</Project>