Adding JITPath parameter to crossgen
This commit is contained in:
parent
a9e12e0336
commit
78bea7df84
1 changed files with 69 additions and 27 deletions
|
@ -31,42 +31,83 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
|
|
||||||
private string GetCrossgenPathForVersion()
|
private string GetCrossgenPathForVersion()
|
||||||
{
|
{
|
||||||
string arch = RuntimeEnvironment.RuntimeArchitecture;
|
var crossgenPackagePath = GetCrossGenPackagePathForVersion();
|
||||||
string packageId;
|
|
||||||
if (CurrentPlatform.IsWindows)
|
if (crossgenPackagePath == null)
|
||||||
{
|
|
||||||
packageId = $"runtime.win7-{arch}.Microsoft.NETCore.Runtime.CoreCLR";
|
|
||||||
}
|
|
||||||
else if (CurrentPlatform.IsUbuntu)
|
|
||||||
{
|
|
||||||
packageId = "runtime.ubuntu.14.04-x64.Microsoft.NETCore.Runtime.CoreCLR";
|
|
||||||
}
|
|
||||||
else if (CurrentPlatform.IsCentOS || CurrentPlatform.IsRHEL)
|
|
||||||
{
|
|
||||||
// CentOS runtime is in the runtime.rhel.7-x64... package.
|
|
||||||
packageId = "runtime.rhel.7-x64.Microsoft.NETCore.Runtime.CoreCLR";
|
|
||||||
}
|
|
||||||
else if (CurrentPlatform.IsOSX)
|
|
||||||
{
|
|
||||||
packageId = "runtime.osx.10.10-x64.Microsoft.NETCore.Runtime.CoreCLR";
|
|
||||||
}
|
|
||||||
else if (CurrentPlatform.IsDebian)
|
|
||||||
{
|
|
||||||
packageId = "runtime.debian.8-x64.Microsoft.NETCore.Runtime.CoreCLR";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Path.Combine(
|
return Path.Combine(
|
||||||
Dirs.NuGetPackages,
|
crossgenPackagePath,
|
||||||
packageId,
|
|
||||||
_coreClrVersion,
|
|
||||||
"tools",
|
"tools",
|
||||||
$"crossgen{Constants.ExeSuffix}");
|
$"crossgen{Constants.ExeSuffix}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetLibCLRJitPathForVersion()
|
||||||
|
{
|
||||||
|
var coreclrRid = GetCoreCLRRid();
|
||||||
|
var crossgenPackagePath = GetCrossGenPackagePathForVersion();
|
||||||
|
|
||||||
|
if (crossgenPackagePath == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Path.Combine(
|
||||||
|
crossgenPackagePath,
|
||||||
|
"runtimes",
|
||||||
|
coreclrRid,
|
||||||
|
"native",
|
||||||
|
$"{Constants.DynamicLibPrefix}clrjit{Constants.DynamicLibSuffix}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetCrossGenPackagePathForVersion()
|
||||||
|
{
|
||||||
|
string coreclrRid = GetCoreCLRRid();
|
||||||
|
|
||||||
|
if (coreclrRid == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
string packageId = $"runtime.{coreclrRid}.Microsoft.NETCore.Runtime.CoreCLR";
|
||||||
|
|
||||||
|
return Path.Combine(
|
||||||
|
Dirs.NuGetPackages,
|
||||||
|
packageId,
|
||||||
|
_coreClrVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetCoreCLRRid()
|
||||||
|
{
|
||||||
|
string rid = null;
|
||||||
|
if (CurrentPlatform.IsWindows)
|
||||||
|
{
|
||||||
|
var arch = RuntimeEnvironment.RuntimeArchitecture;
|
||||||
|
rid = $"win7-{arch}";
|
||||||
|
}
|
||||||
|
else if (CurrentPlatform.IsUbuntu)
|
||||||
|
{
|
||||||
|
rid = "ubuntu.14.04-x64";
|
||||||
|
}
|
||||||
|
else if (CurrentPlatform.IsCentOS || CurrentPlatform.IsRHEL)
|
||||||
|
{
|
||||||
|
// CentOS runtime is in the runtime.rhel.7-x64... package.
|
||||||
|
rid = "rhel.7-x64";
|
||||||
|
}
|
||||||
|
else if (CurrentPlatform.IsOSX)
|
||||||
|
{
|
||||||
|
rid = "osx.10.10-x64";
|
||||||
|
}
|
||||||
|
else if (CurrentPlatform.IsDebian)
|
||||||
|
{
|
||||||
|
rid = "debian.8-x64";
|
||||||
|
}
|
||||||
|
|
||||||
|
return rid;
|
||||||
|
}
|
||||||
|
|
||||||
public void CrossgenDirectory(BuildTargetContext c, string pathToAssemblies)
|
public void CrossgenDirectory(BuildTargetContext c, string pathToAssemblies)
|
||||||
{
|
{
|
||||||
// Check if we need to skip crossgen
|
// Check if we need to skip crossgen
|
||||||
|
@ -110,6 +151,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
|
|
||||||
IList<string> crossgenArgs = new List<string> {
|
IList<string> crossgenArgs = new List<string> {
|
||||||
"-readytorun", "-in", file, "-out", tempPathName,
|
"-readytorun", "-in", file, "-out", tempPathName,
|
||||||
|
"-JITPath", GetLibCLRJitPathForVersion(),
|
||||||
"-platform_assemblies_paths", platformAssembliesPaths
|
"-platform_assemblies_paths", platformAssembliesPaths
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue