From 71a048ebfb3afe5540c8f2928a0281ea5d14d0e0 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 20 Mar 2025 09:07:37 -0700 Subject: [PATCH] Pass -fno-omit-frame-pointer on Linux --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0d46e43cc..da372ef7d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,11 @@ add_compile_definitions( if(CMAKE_SYSTEM_NAME STREQUAL Linux) check_symbol_exists(sched_getaffinity "sched.h" HAVE_SCHED_GETAFFINITY) add_compile_definitions($<$:HAVE_SCHED_GETAFFINITY>) + + # Pass -fno-omit-frame-pointer while compiling for better backtraces + add_compile_options( + "$<$:SHELL:-Xcc -fno-omit-frame-pointer>" + "$<$:-fno-omit-frame-pointer>") endif() # Precompute module triple for installation