Making crossgen throw when compiling with the PartialNgen flag and no IBC data (dotnet/coreclr#24557)

* Making crossgen throw when compiling with the PartialNgen flag and no IBC data

* Adding missing m_fPartialNGen check


Commit migrated from https://github.com/dotnet/coreclr/commit/9bf825258fdaffc9e2af72c9421eabe725245717
This commit is contained in:
Fadi Hanna authored and GitHub committed 2019-05-15 12:18:19 -07:00
1 parent 137c322feb
commit bd068efbca
4 files changed
+15

No files matched your search

+6
View File
@@ -2252,6 +2252,12 @@
<Comment>During a GC initialization, the GCHeapAffinitizeRanges config couldn't be parsed due to its invalid format.</Comment>
</HRESULT>
<HRESULT NumericValue="0x8013200C">
<SymbolicName>CLR_E_CROSSGEN_NO_IBC_DATA_FOUND</SymbolicName>
<Message>"Cannot compile using the PartialNgen flag because no IBC data was found."</Message>
<Comment>During crossgen compilation, the PartialNgen flag was set, but no IBC data was found in the resources section of the input image, and no IBC file was externally provided.</Comment>
</HRESULT>
<HRESULT NumericValue="E_ACCESSDENIED">
<SymbolicName>COR_E_UNAUTHORIZEDACCESS</SymbolicName>
<Comment> 0x80070005 // Access is denied.</Comment>
@@ -327,5 +327,6 @@ BEGIN
MSG_FOR_URT_HR(CLR_E_GC_OOM) "Failfast due to an OOM during a GC"
MSG_FOR_URT_HR(CLR_E_GC_BAD_AFFINITY_CONFIG) "GCHeapAffinitizeMask or GCHeapAffinitizeRanges didn't specify any CPUs the current process is affinitized to."
MSG_FOR_URT_HR(CLR_E_GC_BAD_AFFINITY_CONFIG_FORMAT) "GCHeapAffinitizeRanges configuration string has invalid format."
MSG_FOR_URT_HR(CLR_E_CROSSGEN_NO_IBC_DATA_FOUND) "Cannot compile using the PartialNgen flag because no IBC data was found."
MSG_FOR_URT_HR(COR_E_BADIMAGEFORMAT) "The format of a DLL or executable being loaded is invalid."
END
@@ -394,6 +394,7 @@
#define CLR_E_GC_OOM EMAKEHR(0x2009)
#define CLR_E_GC_BAD_AFFINITY_CONFIG EMAKEHR(0x200a)
#define CLR_E_GC_BAD_AFFINITY_CONFIG_FORMAT EMAKEHR(0x200b)
#define CLR_E_CROSSGEN_NO_IBC_DATA_FOUND EMAKEHR(0x200c)
#define COR_E_UNAUTHORIZEDACCESS E_ACCESSDENIED
#define COR_E_ARGUMENT E_INVALIDARG
#define COR_E_INVALIDCAST E_NOINTERFACE
+7
View File
@@ -3378,6 +3378,13 @@ void ZapImage::LoadProfileData()
m_zapper->Warning(W("Warning: Invalid profile data was ignored for %s\n"), m_pModuleFileName);
}
}
#ifdef CROSSGEN_COMPILE
if (m_zapper->m_pOpt->m_fPartialNGen && (m_pRawProfileData == NULL || m_cRawProfileData == 0))
{
ThrowHR(CLR_E_CROSSGEN_NO_IBC_DATA_FOUND);
}
#endif
}
// Initializes our form of the profile data stored in the assembly.