Index: libunwind/CMakeLists.txt =================================================================== --- libunwind/CMakeLists.txt +++ libunwind/CMakeLists.txt @@ -287,6 +287,9 @@ unwind_append_if(LIBUNWIND_C_FLAGS LIBUNWIND_HAS_FUNWIND_TABLES -funwind-tables) +# Ensure that we don't depend on C++ standard library. +unwind_append_if(LIBUNWIND_CXX_FLAGS LIBUNWIND_HAS_NOSTDINCXX_FLAG -nostdinc++) + # Assert string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) if (LIBUNWIND_ENABLE_ASSERTIONS) @@ -355,14 +358,6 @@ set(LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}") endif() -set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT}" CACHE PATH - "Paths to C++ header directories separated by ';'.") - -if (NOT LIBUNWIND_CXX_INCLUDE_PATHS STREQUAL "") - list(APPEND LIBUNWIND_CXX_FLAGS -nostdinc++) - include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}") -endif() - add_subdirectory(src) if (LIBUNWIND_INCLUDE_DOCS) Index: libunwind/src/UnwindCursor.hpp =================================================================== --- libunwind/src/UnwindCursor.hpp +++ libunwind/src/UnwindCursor.hpp @@ -11,7 +11,6 @@ #ifndef __UNWINDCURSOR_HPP__ #define __UNWINDCURSOR_HPP__ -#include #include #include #include Index: libunwind/src/libunwind.cpp =================================================================== --- libunwind/src/libunwind.cpp +++ libunwind/src/libunwind.cpp @@ -11,10 +11,6 @@ #include -#ifndef NDEBUG -#include // getenv -#endif - #include "libunwind_ext.h" #include "config.h" @@ -27,6 +23,10 @@ using namespace libunwind; +// libunwind does not and should not dependent on C++ library which means that +// we need our own definition of inline placement new that's used in this file. +inline void* operator new(size_t, void* __p) { return __p; } + /// internal object to represent this processes address space LocalAddressSpace LocalAddressSpace::sThisAddressSpace;