Fix Windows arm64 build by desktop framework support (#1697)
authorMike McLaughlin <mikem@microsoft.com>
Wed, 4 Nov 2020 01:33:18 +0000 (17:33 -0800)
committerGitHub <noreply@github.com>
Wed, 4 Nov 2020 01:33:18 +0000 (17:33 -0800)
src/SOS/Strike/CMakeLists.txt
src/SOS/Strike/hostcoreclr.cpp
src/SOS/Strike/strike.cpp

index 63db0173bd5163622ef73142bec3dce9e24dac18..39ba12e9e8897f688a951d98ff922e7cc2ba9125 100644 (file)
@@ -73,7 +73,6 @@ if(WIN32)
     gchist.cpp
     gcroot.cpp
     hostcoreclr.cpp
-    hostdesktop.cpp
     metadata.cpp
     runtime.cpp
     sigparser.cpp
@@ -111,8 +110,18 @@ if(WIN32)
     advapi32.lib
     psapi.lib
     ntdll.lib
-    mscoree.lib
   )
+
+  if(NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
+    list(APPEND 
+      SOS_LIBRARY 
+        mscoree.lib)
+
+    list(APPEND 
+      SOS_SOURCES 
+        hostdesktop.cpp)
+  endif(NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
+
 else(WIN32)
   add_definitions(-DFEATURE_ENABLE_HARDWARE_EXCEPTIONS)
   add_definitions(-DPAL_STDCPP_COMPAT=1)
index fc9a4501d93a5b022b16fdc3f0e856ed26f2e6c3..3d0f462137c0adf8779b494a656b7b247fc3c30f 100644 (file)
 #define TPALIST_SEPARATOR_STR_A ";"
 #endif
 
-#ifndef FEATURE_PAL
+#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_)
 extern HRESULT InitializeDesktopClrHost();
 extern void UninitializeDesktopClrHost();
+bool g_useDesktopClrHost = true;
 #endif
 
 bool g_dotnetDumpHost = false;
@@ -59,7 +60,6 @@ LPCSTR g_tmpPath = nullptr;
 SOSNetCoreCallbacks g_SOSNetCoreCallbacks;
 
 #ifndef FEATURE_PAL
-bool g_useDesktopClrHost = true;
 HMODULE g_hmoduleSymBinder = nullptr;
 ISymUnmanagedBinder3 *g_pSymBinder = nullptr;
 #endif
@@ -557,7 +557,7 @@ HRESULT InitializeHosting()
         return S_OK;
     }
     HRESULT Status;
-#ifndef FEATURE_PAL
+#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_)
     if (g_useDesktopClrHost)
     {
         Status = InitializeDesktopClrHost();
index 1a52758ae2db1488f110f749a6ec8dff0f5df813..e58433858d423d75e7682aa60725346175a4d73f 100644 (file)
@@ -158,10 +158,13 @@ BOOL ControlC = FALSE;
 WCHAR g_mdName[mdNameLen];
 
 #ifndef FEATURE_PAL
-extern bool g_useDesktopClrHost;
 HMODULE g_hInstance = NULL;
 #endif // !FEATURE_PAL
 
+#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_)
+extern bool g_useDesktopClrHost;
+#endif
+
 #ifdef _MSC_VER
 #pragma warning(disable:4244)   // conversion from 'unsigned int' to 'unsigned short', possible loss of data
 #pragma warning(disable:4189)   // local variable is initialized but not referenced
@@ -10981,7 +10984,7 @@ DECLARE_API(SOSStatus)
     if (g_tmpPath != nullptr) {
         ExtOut("Temp path: %s\n", g_tmpPath);
     }
-#ifndef FEATURE_PAL
+#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_)
     if (g_useDesktopClrHost) {
         ExtOut("Using the desktop .NET Framework to host the managed SOS code\n");
     }
@@ -16522,7 +16525,7 @@ DECLARE_API(SetHostRuntime)
             return E_FAIL;
         }
     }
-#ifndef FEATURE_PAL
+#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_)
     if (bNetCore)
     {
         g_useDesktopClrHost = false;
@@ -16539,11 +16542,11 @@ DECLARE_API(SetHostRuntime)
             free((void*)g_hostRuntimeDirectory);
         }
         g_hostRuntimeDirectory = _strdup(hostRuntimeDirectory.data);
-#ifndef FEATURE_PAL
+#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_)
         g_useDesktopClrHost = false;
 #endif
     }
-#ifndef FEATURE_PAL
+#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_)
     if (g_useDesktopClrHost)
     {
         ExtOut("Using the desktop .NET Framework to host the managed SOS code\n");