From: Kirill Frolov Date: Thu, 1 Oct 2020 07:56:42 +0000 (+0300) Subject: [Build] fixed build with CoreClr > 3.x X-Git-Tag: submit/tizen/20210120.035625~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7002d141de3eaa6c9d52941fb77eb2d1684dbc64;p=sdk%2Ftools%2Fnetcoredbg.git [Build] fixed build with CoreClr > 3.x 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). --- diff --git a/platformdefinitions.cmake b/platformdefinitions.cmake index d5a4996..ed3d9f6 100644 --- a/platformdefinitions.cmake +++ b/platformdefinitions.cmake @@ -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 () diff --git a/src/debug/netcoredbg/CMakeLists.txt b/src/debug/netcoredbg/CMakeLists.txt index a9e3313..8b48c26 100644 --- a/src/debug/netcoredbg/CMakeLists.txt +++ b/src/debug/netcoredbg/CMakeLists.txt @@ -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 diff --git a/src/debug/netcoredbg/manageddebugger.cpp b/src/debug/netcoredbg/manageddebugger.cpp index 8e9abcc..c4707e9 100644 --- a/src/debug/netcoredbg/manageddebugger.cpp +++ b/src/debug/netcoredbg/manageddebugger.cpp @@ -30,6 +30,11 @@ using std::map; #ifdef FEATURE_PAL #include +// 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 {