[Build] fixed build with CoreClr > 3.x
authorKirill Frolov <k.frolov@samsung.com>
Thu, 1 Oct 2020 07:56:42 +0000 (10:56 +0300)
committerAlexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Tue, 17 Nov 2020 11:58:58 +0000 (14:58 +0300)
Detailed changes description:

1) In CoreCLR's PAL macro was renamed: BIT64 => HOST_64BIT;

2) Directory layout has changed (in CoreCLR's sources);

3) Definition (not declaration) of IID_IUnknown isn't available from PAL
   anymore: so need to link libuuid (unwanted dependency) or define
   IID_IUnknown in source (as it was made).

platformdefinitions.cmake
src/debug/netcoredbg/CMakeLists.txt
src/debug/netcoredbg/manageddebugger.cpp

index d5a4996b5936867de2a228df7ab4c914f1b43ba2..ed3d9f6195bada128cfc67ef9aa1fa5ed3e676d7 100644 (file)
@@ -5,7 +5,8 @@ if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
   add_definitions(-D_AMD64_)
   add_definitions(-D_WIN64)
   add_definitions(-DAMD64)
-  add_definitions(-DBIT64=1)
+  add_definitions(-DBIT64=1)          # CoreClr <= 3.x
+  add_definitions(-DHOST_64BIT=1)     # CoreClr > 3.x
 elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
   add_definitions(-D_X86_)
 elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
@@ -15,7 +16,8 @@ elseif (CLR_CMAKE_PLATFORM_ARCH_ARM64)
   add_definitions(-D_ARM64_)
   add_definitions(-DARM64)
   add_definitions(-D_WIN64)
-  add_definitions(-DBIT64=1)
+  add_definitions(-DBIT64=1)          # CoreClr <= 3.x
+  add_definitions(-DHOST_64BIT=1)     # CoreClr > 3.x
 else ()
   clr_unknown_arch()
 endif ()
index a9e3313a86948fe5e4f808248fbc3b6d6458075d..8b48c26bedcec8f099946f29b2038c0db1cba3c5 100644 (file)
@@ -29,7 +29,10 @@ include_directories(${CORECLR_DIR}/src/inc)
 include_directories(${CORECLR_DIR}/src/debug/inc)
 include_directories(${CORECLR_DIR}/src/debug/shim)
 include_directories(${CORECLR_DIR}/src/dlls/dbgshim)
+# for CoreCLR <= 3.x
 include_directories(${CORECLR_DIR}/src/coreclr/hosts/inc)
+# for dotnet-runtime (> 3.x)
+include_directories(${CORECLR_DIR}/src/hosts/inc)
 
 # Build native part of the debugger
 
index 8e9abcc835854a6f5d59239e0f008f2af1808082..c4707e9e6611e307b2bfba6e803a43425c8bdb40 100644 (file)
@@ -30,6 +30,11 @@ using std::map;
 #ifdef FEATURE_PAL
 #include <dlfcn.h>
 
+// as alternative, libuuid should be linked...
+// (the problem is, that in CoreClr > 3.x, in pal/inc/rt/rpc.h,
+// MIDL_INTERFACE uses DECLSPEC_UUID, which has empty definition.
+extern "C" const IID IID_IUnknown = { 0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }};
+
 namespace {
 namespace hook {