From 5735ef13c72bac000ab1b402cbc4ce7bdd2b353a Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 20 Aug 2023 04:04:00 +0400 Subject: [PATCH] Use -fno-omit-frame-pointer for better backtraces --- external/dispatch/CMakeLists.txt | 4 ++-- external/jemalloc/CMakeLists.txt | 4 ++-- options_linux.cmake | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/external/dispatch/CMakeLists.txt b/external/dispatch/CMakeLists.txt index 5d6dd62..91f5b45 100644 --- a/external/dispatch/CMakeLists.txt +++ b/external/dispatch/CMakeLists.txt @@ -17,8 +17,8 @@ if (NOT DESKTOP_APP_DISPATCH_LIBRARIES OR NOT DESKTOP_APP_DISPATCH_INCLUDE_DIRS) if (NOT DESKTOP_APP_USE_PACKAGED OR DESKTOP_APP_SPECIAL_TARGET) set(dispatch_extra_args -DCMAKE_BUILD_TYPE=Release - "-DCMAKE_C_FLAGS=-g -pipe -fPIC -fstack-protector-all -fstack-clash-protection -fcf-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" - "-DCMAKE_CXX_FLAGS=-g -pipe -fPIC -fstack-protector-all -fstack-clash-protection -fcf-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" + "-DCMAKE_C_FLAGS=-g -pipe -fPIC -fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" + "-DCMAKE_CXX_FLAGS=-g -pipe -fPIC -fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS" ) elseif (DEFINED CMAKE_BUILD_TYPE) set(dispatch_extra_args diff --git a/external/jemalloc/CMakeLists.txt b/external/jemalloc/CMakeLists.txt index 70f2f1b..9b87c00 100644 --- a/external/jemalloc/CMakeLists.txt +++ b/external/jemalloc/CMakeLists.txt @@ -39,8 +39,8 @@ ExternalProject_Add(jemalloc CONFIGURE_COMMAND env CC=clang CXX=clang++ - "$>,$>,EXTRA_CFLAGS=-fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" - "$>,$>,EXTRA_CXXFLAGS=-fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" + "$>,$>,EXTRA_CFLAGS=-fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" + "$>,$>,EXTRA_CXXFLAGS=-fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS,=>" ./autogen.sh --disable-shared BUILD_COMMAND make $<$>:-j${N}> BUILD_IN_SOURCE 1 diff --git a/options_linux.cmake b/options_linux.cmake index 2d5d65e..f43d7d2 100644 --- a/options_linux.cmake +++ b/options_linux.cmake @@ -80,6 +80,7 @@ endif() if (NOT DESKTOP_APP_USE_PACKAGED OR DESKTOP_APP_SPECIAL_TARGET) target_compile_options_if_exists(common_options INTERFACE + -fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection