From: Fadi Hanna Date: Wed, 15 May 2019 19:18:19 +0000 (-0700) Subject: Making crossgen throw when compiling with the PartialNgen flag and no IBC data (... X-Git-Tag: accepted/tizen/unified/20190813.215958~42^2~212 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9bf825258fdaffc9e2af72c9421eabe725245717;p=platform%2Fupstream%2Fcoreclr.git Making crossgen throw when compiling with the PartialNgen flag and no IBC data (#24557) * Making crossgen throw when compiling with the PartialNgen flag and no IBC data * Adding missing m_fPartialNGen check --- diff --git a/src/inc/corerror.xml b/src/inc/corerror.xml index d7121ef..4c6362f 100644 --- a/src/inc/corerror.xml +++ b/src/inc/corerror.xml @@ -2252,6 +2252,12 @@ During a GC initialization, the GCHeapAffinitizeRanges config couldn't be parsed due to its invalid format. + + CLR_E_CROSSGEN_NO_IBC_DATA_FOUND + "Cannot compile using the PartialNgen flag because no IBC data was found." + 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. + + COR_E_UNAUTHORIZEDACCESS 0x80070005 // Access is denied. diff --git a/src/pal/prebuilt/corerror/mscorurt.rc b/src/pal/prebuilt/corerror/mscorurt.rc index 5b0a9e2..ee8ef67 100644 --- a/src/pal/prebuilt/corerror/mscorurt.rc +++ b/src/pal/prebuilt/corerror/mscorurt.rc @@ -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 diff --git a/src/pal/prebuilt/inc/corerror.h b/src/pal/prebuilt/inc/corerror.h index 6e72e49..f8578f1 100644 --- a/src/pal/prebuilt/inc/corerror.h +++ b/src/pal/prebuilt/inc/corerror.h @@ -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 diff --git a/src/zap/zapimage.cpp b/src/zap/zapimage.cpp index 2dce179..a70b710 100644 --- a/src/zap/zapimage.cpp +++ b/src/zap/zapimage.cpp @@ -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.