summaryrefslogtreecommitdiff
path: root/src/binder
diff options
context:
space:
mode:
authorGaurav Khanna <gkhanna@microsoft.com>2017-04-27 10:46:47 -0700
committerGitHub <noreply@github.com>2017-04-27 10:46:47 -0700
commitc983bb86ddf46916206efc7cd5bc942ec8b834cb (patch)
tree9d3898bc06cabae6fd7207ccf197ce76892b7b38 /src/binder
parent368ee30f34fda812d8d936dff4d59b91270453c1 (diff)
downloadcoreclr-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.cpp27
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: