From f72388c1c677c43167eef58a8edcfab71d233fb3 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 20 Jun 2016 19:20:14 +0100 Subject: [PATCH 1/2] CMakeLists: fix build without libunwind --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09ca449d..f9110250 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,6 +249,7 @@ if(LIBUNWIND_FOUND) add_definitions("-DHAVE_LIBUNWIND") else() message(STATUS "Stack traces disabled") + set(LIBUNWIND_LIBRARIES "") endif() if (UNIX AND NOT APPLE) From 15c2b69db7dbdfafd9f9b6cc8c4f14e3952a353b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 20 Jun 2016 19:23:32 +0100 Subject: [PATCH 2/2] common: fix build without libunwind --- src/common/stack_trace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/stack_trace.cpp b/src/common/stack_trace.cpp index 1a65ca65..2805e760 100644 --- a/src/common/stack_trace.cpp +++ b/src/common/stack_trace.cpp @@ -28,8 +28,10 @@ #include "common/stack_trace.h" #include "misc_log_ex.h" +#ifdef HAVE_LIBUNWIND #define UNW_LOCAL_ONLY #include +#endif #include #include @@ -112,8 +114,6 @@ void log_stack_trace(const char *msg) LOG_PRINT2(log, " " << std::setw(4) << level << std::setbase(16) << std::setw(20) << "0x" << ip << " " << (!status && dsym ? dsym : sym) << " + " << "0x" << off, LOG_LEVEL_0); free(dsym); } -#else -#warning libunwind disabled, no stack traces #endif }