From ad4a6ff8de1c04bf5b55dc87057ad84aeeb2836f Mon Sep 17 00:00:00 2001 From: Mateusz Jakub Fila Date: Sun, 24 Dec 2023 02:38:59 +0100 Subject: [PATCH] added missing gcc unwinder preference option in cmake --- CMakeLists.txt | 5 +++++ cmake/config.h.in | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb78844..9e9b381 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,11 @@ option(gperftools_enable_libunwind set(enable_backtrace ${gperftools_enable_stacktrace_via_backtrace}) set(enable_libunwind ${gperftools_enable_libunwind}) +option(gperftools_enable_libgcc_unwinder_by_default + "Prefer libgcc's _Unwind_Backtrace as default stacktrace capturing method" + OFF) +set(PREFER_LIBGCC_UNWINDER ${gperftools_enable_libgcc_unwinder_by_default}) + set(gperftools_tcmalloc_pagesize ${default_tcmalloc_pagesize} CACHE STRING "Set the tcmalloc internal page size") set(allowed_page_sizes LIST "4;8;16;32;64;128;256") diff --git a/cmake/config.h.in b/cmake/config.h.in index a79aabb..6b61736 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -230,6 +230,9 @@ #endif #endif +/* if libgcc stacktrace method should be default */ +#cmakedefine PREFER_LIBGCC_UNWINDER + /* Mark the systems where we know it's bad if pthreads runs too early before main (before threads are initialized, presumably). */ #ifdef __FreeBSD__