From: Swift Kim Date: Thu, 1 Aug 2019 06:10:49 +0000 (+0900) Subject: [Tizen] Add a config knob for importing ibc files X-Git-Tag: accepted/tizen/unified/20221103.165808~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df8122b710b6d9e63f2c3928159d01b8fed6ee7e;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [Tizen] Add a config knob for importing ibc files --- diff --git a/src/coreclr/inc/clrconfigvalues.h b/src/coreclr/inc/clrconfigvalues.h index d069000..fdee15a 100644 --- a/src/coreclr/inc/clrconfigvalues.h +++ b/src/coreclr/inc/clrconfigvalues.h @@ -288,7 +288,7 @@ RETAIL_CONFIG_STRING_INFO(EXTERNAL_GCName, W("GCName"), "") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ConvertIbcData, W("ConvertIbcData"), 1, "Converts between v1 and v2 IBC data") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DisableIBC, W("DisableIBC"), 0, "Disables the use of IBC data") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_UseIBCFile, W("UseIBCFile"), 0, "") - +RETAIL_CONFIG_STRING_INFO(EXTERNAL_IBCFileDir, W("IBCFileDir"), "Directory to search for IBC files") /// /// JIT diff --git a/src/coreclr/zap/zapimage.cpp b/src/coreclr/zap/zapimage.cpp index 6939219..172dd43 100644 --- a/src/coreclr/zap/zapimage.cpp +++ b/src/coreclr/zap/zapimage.cpp @@ -2438,7 +2438,20 @@ HRESULT ZapImage::LocateProfileData() // Couldn't find profile resource--let's see if there's an ibc file to use instead // - SString path(m_pModuleFileName); + SString path; + + LPWSTR ibcDir = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_IBCFileDir); + if (ibcDir != NULL) + { + LPCWSTR moduleFileName = wcsrchr(m_pModuleFileName, DIRECTORY_SEPARATOR_CHAR_W); + path.Set(ibcDir); + path.Append(DIRECTORY_SEPARATOR_CHAR_W); + path.Append(moduleFileName); + } + else + { + path.Set(m_pModuleFileName); // the same directory as the IL dll + } SString::Iterator dot = path.End(); if (path.FindBack(dot, '.'))