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
[C++] RelWithDebInfo builds disable optimizations #35850
Comments
@felipecrv Would you like to take a look at this quickly? |
@raulcd This could be 12.0.1 material if we can integrate a fix quickly. |
Also cc @mapleFU |
I guess we might force using |
No, we should fix this bug. |
Oh, sorry. Does this work? diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index 827e0fa4e..2daaabb97 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -642,8 +642,8 @@ if(NOT MSVC)
string(APPEND CMAKE_CXX_FLAGS_RELEASE "${CXX_RELEASE_FLAGS}")
string(APPEND CMAKE_C_FLAGS_DEBUG "${DEBUG_FLAGS}")
string(APPEND CMAKE_CXX_FLAGS_DEBUG "${DEBUG_FLAGS}")
- string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO "${C_RELEASE_FLAGS} ${DEBUG_FLAGS}")
- string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CXX_RELEASE_FLAGS} ${DEBUG_FLAGS}")
+ string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO "${DEBUG_FLAGS} ${C_RELEASE_FLAGS}")
+ string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO "${DEBUG_FLAGS} ${CXX_RELEASE_FLAGS}")
endif()
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}") |
kou
added a commit
to kou/arrow
that referenced
this issue
May 31, 2023
I've opened a pull request for easy to try: #35856 |
pitrou
pushed a commit
that referenced
this issue
Jun 1, 2023
### Rationale for this change We should not disable optimization with RelWithDebInfo. We just add debug information with RelWithDebInfo. ### What changes are included in this PR? This change prioritizes optimization flags over debug flags. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: #35850 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
raulcd
pushed a commit
that referenced
this issue
Jun 1, 2023
### Rationale for this change We should not disable optimization with RelWithDebInfo. We just add debug information with RelWithDebInfo. ### What changes are included in this PR? This change prioritizes optimization flags over debug flags. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: #35850 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug, including details regarding any error messages, version, and platform.
RelWithDebInfo builds add
-O0
to compiler flags, effectively disabling optimizations.This seems to be caused by #15022
Component(s)
C++
The text was updated successfully, but these errors were encountered: