-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(c): set -g3 in debug/relwithdebuginfo builds #1609
Conversation
Packaging builds being fixed by #1612 |
c/cmake_modules/AdbcDefines.cmake
Outdated
string(APPEND C_RELWITHDEBINFO_FLAGS " -Og -ggdb") | ||
string(APPEND CXX_RELWITHDEBINFO_FLAGS " -Og -ggdb") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about removing -Og
here because RelWithDebInfo
is one of optimization builds?
c/cmake_modules/AdbcDefines.cmake
Outdated
string(APPEND C_DEBUG_FLAGS " -Og -ggdb") | ||
string(APPEND CXX_DEBUG_FLAGS " -Og -ggdb") | ||
string(APPEND C_RELWITHDEBINFO_FLAGS " -Og -ggdb") | ||
string(APPEND CXX_RELWITHDEBINFO_FLAGS " -Og -ggdb") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using -g3
instead of -ggdb
?
-g3
provides more debug information than -ggdb
.
For example, we can use expand macro in gdb with -g3
.
c/cmake_modules/AdbcDefines.cmake
Outdated
|
||
if("${_lower_build_type}" STREQUAL "debug" AND "${CMAKE_CXX_FLAGS}" MATCHES "-O2") | ||
# Activate scripts for Conda compilers set CXXFLAGS etc. with -O2. | ||
message(WARNING "This is a debug build, but your CXXFLAGS have -O2. This is common in Conda environments.\nReset your CFLAGS, CPPFLAGS, and CXXFLAGS to -Og for debugging." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: Users can use -DCMAKE_C_FLAGS_DEBUG=-Og -DCMAKE_CXX_FLAGS_DEBUG=-Og
instead of resetting CFLAGS
/CXXFLAGS
.
Here are my related tries on apache/arrow:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give this a shot, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.
Ah, I think this is what I was not understanding earlier.
8b08a1c
to
4c2e832
Compare
Fixes #1608.