diff options
author | Gaurav Khanna <gkhanna@microsoft.com> | 2017-04-27 10:46:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-27 10:46:47 -0700 |
commit | c983bb86ddf46916206efc7cd5bc942ec8b834cb (patch) | |
tree | 9d3898bc06cabae6fd7207ccf197ce76892b7b38 /src/binder | |
parent | 368ee30f34fda812d8d936dff4d59b91270453c1 (diff) | |
download | coreclr-c983bb86ddf46916206efc7cd5bc942ec8b834cb.tar.gz coreclr-c983bb86ddf46916206efc7cd5bc942ec8b834cb.tar.bz2 coreclr-c983bb86ddf46916206efc7cd5bc942ec8b834cb.zip |
[WIP] Enable binding to CoreLib as NI image (#11040)
Enable binding to CoreLib as NI image
Diffstat (limited to 'src/binder')
-rw-r--r-- | src/binder/assemblybinder.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/binder/assemblybinder.cpp b/src/binder/assemblybinder.cpp index a73f79fb65..bd5dd18cc9 100644 --- a/src/binder/assemblybinder.cpp +++ b/src/binder/assemblybinder.cpp @@ -685,26 +685,21 @@ namespace BINDER_SPACE 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: |