Skip to content

Commit

Permalink
ORC-1021: Add -fno-omit-frame-pointer in DEBUG and RELWITHDEBINFO bui…
Browse files Browse the repository at this point in the history
…lds (#932)

### What changes were proposed in this pull request?

This PR adds -fno-omit-frame-pointer gcc option in DEBUG and RELWITHDEBINFO builds, which helps to generate stacktrace in debugging and profiling. Refs:
https://www.brendangregg.com/perf.html#StackTraces
https://issues.apache.org/jira/browse/IMPALA-4132

### Why are the changes needed?

Described as above.

### How was this patch tested?

Built in ubuntu16.04 with gcc 8.4.0.

(cherry picked from commit 4b9c45c)
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
stiga-huang authored and dongjoon-hyun committed Dec 16, 2021
1 parent 0fbfa66 commit a0bb4ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ endif ()
# Compiler specific flags
#
if (NOT MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
endif ()
message(STATUS "compiler ${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION}")
Expand Down

0 comments on commit a0bb4ad

Please sign in to comment.