diff --git a/CMakeLists.txt b/CMakeLists.txt index a5b94efefc5..0d1ef22b2aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,9 +321,9 @@ set (DEBUG_INFO_FLAGS "-g -gdwarf-4") option(DISABLE_OMIT_FRAME_POINTER "Disable omit frame pointer compiler optimization" OFF) if (DISABLE_OMIT_FRAME_POINTER) - set (CMAKE_CXX_FLAGS_ADD "${CMAKE_CXX_FLAGS_ADD} -fno-omit-frame-pointer") - set (CMAKE_C_FLAGS_ADD "${CMAKE_C_FLAGS_ADD} -fno-omit-frame-pointer") - set (CMAKE_ASM_FLAGS_ADD "${CMAKE_ASM_FLAGS_ADD} -fno-omit-frame-pointer") + set (CMAKE_CXX_FLAGS_ADD "${CMAKE_CXX_FLAGS_ADD} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer") + set (CMAKE_C_FLAGS_ADD "${CMAKE_C_FLAGS_ADD} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer") + set (CMAKE_ASM_FLAGS_ADD "${CMAKE_ASM_FLAGS_ADD} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer") endif() set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} ${CMAKE_CXX_FLAGS_ADD}")