From 9b9c245549cf7bab23e62989951eaf74efed10b1 Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Wed, 17 May 2017 23:37:01 +0900 Subject: [PATCH] Fix CreateDump-related undefined reference on non-AMD64/Linux platforms (#11635) --- src/ToolBox/SOS/Strike/CMakeLists.txt | 1 + src/ToolBox/SOS/Strike/strike.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ToolBox/SOS/Strike/CMakeLists.txt b/src/ToolBox/SOS/Strike/CMakeLists.txt index ff5f864..65c3f95 100644 --- a/src/ToolBox/SOS/Strike/CMakeLists.txt +++ b/src/ToolBox/SOS/Strike/CMakeLists.txt @@ -150,6 +150,7 @@ if(CLR_CMAKE_PLATFORM_ARCH_AMD64) SOS_LIBRARY createdump_lib ) + add_definitions(-DCREATE_DUMP_SUPPORTED) endif(CLR_CMAKE_PLATFORM_LINUX) set(SOS_SOURCES_ARCH disasmX86.cpp diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp index 1fff17f..7e01635 100644 --- a/src/ToolBox/SOS/Strike/strike.cpp +++ b/src/ToolBox/SOS/Strike/strike.cpp @@ -14370,17 +14370,17 @@ _EFN_GetManagedObjectFieldInfo( #ifdef FEATURE_PAL -#ifdef __linux__ +#ifdef CREATE_DUMP_SUPPORTED #include #include "datatarget.h" extern bool CreateDumpForSOS(const char* programPath, const char* dumpPathTemplate, pid_t pid, MINIDUMP_TYPE minidumpType, ICLRDataTarget* dataTarget); extern bool g_diagnostics; -#endif // __linux__ +#endif // CREATE_DUMP_SUPPORTED DECLARE_API(CreateDump) { INIT_API(); -#ifdef __linux__ +#ifdef CREATE_DUMP_SUPPORTED StringHolder sFileName; BOOL normal = FALSE; BOOL withHeap = FALSE; @@ -14440,9 +14440,9 @@ DECLARE_API(CreateDump) { Status = E_FAIL; } -#else // __linux__ +#else // CREATE_DUMP_SUPPORTED ExtErr("CreateDump not supported on this platform\n"); -#endif // __linux__ +#endif // CREATE_DUMP_SUPPORTED return Status; } -- 2.7.4