set COMPlus_UseWindowsX86CoreLegacyJit=1
)
- echo "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%" /out "%__BinDir%\System.Private.CoreLib.ni.dll" "%__BinDir%\System.Private.CoreLib.dll"
- "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%" /out "%__BinDir%\System.Private.CoreLib.ni.dll" "%__BinDir%\System.Private.CoreLib.dll" > "%__CrossGenCoreLibLog%" 2>&1
+ echo "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%"\IL /out "%__BinDir%\System.Private.CoreLib.dll" "%__BinDir%\IL\System.Private.CoreLib.dll"
+ "%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%"\IL /out "%__BinDir%\System.Private.CoreLib.dll" "%__BinDir%\IL\System.Private.CoreLib.dll" > "%__CrossGenCoreLibLog%" 2>&1
if NOT !errorlevel! == 0 (
echo %__MsgPrefix%Error: CrossGen System.Private.CoreLib build failed. Refer to %__CrossGenCoreLibLog%
:: Put it in the same log, helpful for Jenkins
type %__CrossGenCoreLibLog%
goto CrossgenFailure
)
- "%__CrossgenExe%" /Platform_Assemblies_Paths "%__BinDir%" /CreatePdb "%__BinDir%\PDB" "%__BinDir%\System.Private.CoreLib.ni.dll" >> "%__CrossGenCoreLibLog%" 2>&1
+ "%__CrossgenExe%" /Platform_Assemblies_Paths "%__BinDir%" /CreatePdb "%__BinDir%\PDB" "%__BinDir%\System.Private.CoreLib.dll" >> "%__CrossGenCoreLibLog%" 2>&1
if NOT !errorlevel! == 0 (
echo %__MsgPrefix%Error: CrossGen /CreatePdb System.Private.CoreLib build failed. Refer to %__CrossGenCoreLibLog%
:: Put it in the same log, helpful for Jenkins
{
if [ $__SkipCoreCLR == 0 -a -e $__BinDir/crossgen ]; then
echo "Generating native image for System.Private.CoreLib."
- $__BinDir/crossgen $__IbcTuning $__BinDir/System.Private.CoreLib.dll
+ $__BinDir/crossgen /Platform_Assemblies_Paths $__BinDir/IL $__IbcTuning /out $__BinDir/System.Private.CoreLib.dll $__BinDir/IL/System.Private.CoreLib.dll
if [ $? -ne 0 ]; then
echo "Failed to generate native image for System.Private.CoreLib."
exit 1
if [ "$__BuildOS" == "Linux" ]; then
echo "Generating symbol file for System.Private.CoreLib."
- $__BinDir/crossgen /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.ni.dll
+ $__BinDir/crossgen /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.dll
if [ $? -ne 0 ]; then
echo "Failed to generate symbol file for System.Private.CoreLib."
exit 1
<NativeBinary Include="$(BinDir)libsosplugin.so" />
<NativeBinary Include="$(BinDir)System.Globalization.Native.so" />
<NativeBinary Include="$(BinDir)sosdocsunix.txt" />
- <NativeBinary Condition="'$(_PlatformDoesNotSupportNiFiles)' != 'true'" Include="$(BinDir)System.Private.CoreLib.ni.dll" />
<ArchitectureSpecificLibFile Include="$(BinDir)System.Private.CoreLib.dll" />
<ArchitectureSpecificLibFile Include="$(BinDir)SOS.NETCore.dll" />
<ArchitectureSpecificToolFile Include="$(BinDir)crossgen" />
<NativeBinary Include="$(BinDir)libsos.dylib" />
<NativeBinary Include="$(BinDir)System.Globalization.Native.dylib" />
<NativeBinary Include="$(BinDir)sosdocsunix.txt" />
- <NativeBinary Include="$(BinDir)System.Private.CoreLib.ni.dll" />
<ArchitectureSpecificLibFile Include="$(BinDir)System.Private.CoreLib.dll" />
<ArchitectureSpecificLibFile Include="$(BinDir)SOS.NETCore.dll" />
<ArchitectureSpecificToolFile Include="$(BinDir)crossgen" />
<NativeBinary Include="$(BinDir)mscorrc.debug.dll" />
<NativeBinary Include="$(BinDir)mscorrc.dll" />
<NativeBinary Include="$(BinDir)sos.dll" />
- <NativeBinary Include="$(BinDir)System.Private.CoreLib.ni.dll" />
<NativeBinary Include="$(UniversalCRTSDKDir)Redist\ucrt\DLLs\$(BuildArch)\*.dll" Condition="'$(BuildType)'=='Release' AND '$(BuildArch)' != 'arm64'" />
<ArchitectureSpecificLibFile Include="$(BinDir)System.Private.CoreLib.dll" />
<ArchitectureSpecificLibFile Include="$(BinDir)SOS.NETCore.dll" />
StackSString sCoreLib;
- // At run-time, System.Private.CoreLib.ni.dll is typically always available, and
- // System.Private.CoreLib.dll is typically not. So check for the NI first.
+ // At run-time, System.Private.CoreLib.dll is expected to be the NI image.
sCoreLib = sCoreLibDir;
- sCoreLib.Append(CoreLibName_NI_W);
- if (!fBindToNativeImage || FAILED(AssemblyBinder::GetAssembly(sCoreLib,
- FALSE /* fInspectionOnly */,
- TRUE /* fIsInGAC */,
- TRUE /* fExplicitBindToNativeImage */,
- &pSystemAssembly)))
- {
- // If System.Private.CoreLib.ni.dll is unavailable, look for System.Private.CoreLib.dll instead
- sCoreLib = sCoreLibDir;
- sCoreLib.Append(CoreLibName_IL_W);
- IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib,
+ sCoreLib.Append(CoreLibName_IL_W);
+ BOOL fExplicitBindToNativeImage = (fBindToNativeImage == true)? TRUE:FALSE;
+#if defined(FEATURE_PAL) && !defined(_TARGET_AMD64_)
+ // Non-Amd64 platforms on non-Windows do not support generating the NI image
+ // as CoreLib.dll. For those, we will bind as IL.
+ fExplicitBindToNativeImage = FALSE;
+#endif // defined(FEATURE_PAL) && !defined(_TARGET_AMD64_)
+ IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib,
FALSE /* fInspectionOnly */,
TRUE /* fIsInGAC */,
- FALSE /* fExplicitBindToNativeImage */,
+ fExplicitBindToNativeImage,
&pSystemAssembly));
- }
-
+
*ppSystemAssembly = pSystemAssembly.Extract();
Exit:
</Target>
<ItemGroup>
+ <ILToCopy Include="$(BinDir)System.Private.CoreLib.dll"/>
<PDBSToMove Include="$(BinDir)System.Private.CoreLib.pdb"/>
</ItemGroup>
<PropertyGroup>
+ <CoreLibPath>$(BinDir)System.Private.CoreLib.dll</CoreLibPath>
<CoreLibPDBPath>$(BinDir)System.Private.CoreLib.pdb</CoreLibPDBPath>
</PropertyGroup>
+ <Target Name="CopyCoreLib" AfterTargets="Build">
+ <Copy Condition="Exists($(CoreLibPath))"
+ SourceFiles="@(ILToCopy)"
+ DestinationFolder="$(BinDir)IL" />
+ </Target>
+
<Target Name="MovePDB" AfterTargets="Build">
<Move Condition="Exists($(CoreLibPDBPath))"
SourceFiles="@(PDBSToMove)"
bool fAddDelimiter = (refTPAList.GetCount() > 0)?true:false;
bool fAddFileToTPAList = true;
LPCWSTR pwszFilename = folderEnumerator.GetFileName();
- if (fCompilingMscorlib)
+
+ // No NIs are supported when creating NI images (other than NI of System.Private.CoreLib.dll).
+ if (!fCreatePDB)
{
- // When compiling CoreLib, no ".ni.dll" should be on the TPAList.
+ // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-mscorlib assemblies.
if (StringEndsWith((LPWSTR)pwszFilename, W(".ni.dll")))
{
fAddFileToTPAList = false;
}
}
- else
- {
- // When creating PDBs, we must ensure that .ni.dlls are in the TPAList
- if (!fCreatePDB)
- {
- // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-mscorlib assemblies.
- if (StringEndsWith((LPWSTR)pwszFilename, W(".ni.dll")))
- {
- if (!StringEndsWith((LPWSTR)pwszFilename, CoreLibName_NI_W))
- {
- fAddFileToTPAList = false;
- }
- }
- }
-
- // Ensure that CoreLib's IL version is also not on the TPAlist for this case.
- if (StringEndsWith((LPWSTR)pwszFilename, CoreLibName_IL_W))
- {
- fAddFileToTPAList = false;
- }
- }
if (fAddFileToTPAList)
{