Skip to contentSkip to conversation

New: BR2_ENABLE_DEBUG does not have the expected effect for cmake packages

Buildroot bugzilla at busybox.net 1 participant 4 messages Aug 23, 2017

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=10246

Bug ID: 10246
Summary: BR2_ENABLE_DEBUG does not have the expected effect for
cmake packages
Product: buildroot
Version: 2017.05.1
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: joker.eph at gmail.com
CC: buildroot at uclibc.org
Target Milestone: ---

I've been bitten by the option BR2_ENABLE_DEBUG which does not exactly do what the doc describes:

config BR2_ENABLE_DEBUG
bool "build packages with debugging symbols"
help
Build packages with debugging symbols enabled. All libraries and binaries in the 'staging' directory will have debugging symbols, which allows remote debugging even if libraries and binaries are stripped on the target. Whether libraries and binaries are stripped on the target is controlled by the BR2_STRIP_* options below.

For a CMake package, this corresponds to -DCMAKE_BUILD_TYPE=RelWithDebInfo, however currently buildroot will pass -DCMAKE_BUILD_TYPE=Debug which has the effect of generating a *non-optimized* build (i.e. -O0).

I suggest the following patch:

package/pkg-cmake.mk +0 -0
index db78d897d826..0a7bee685096 100644
@@ -257,7 +257,7 @@ $(HOST_DIR)/share/buildroot/toolchainfile.cmake:
                -e 's#@@TARGET_FC@@#$(subst $(HOST_DIR)/,,$(call
qstrip,$(TARGET_FC)))#' \
                -e 's#@@CMAKE_SYSTEM_PROCESSOR@@#$(call
qstrip,$(CMAKE_SYSTEM_PROCESSOR))#' \
                -e 's#@@TOOLCHAIN_HAS_FORTRAN@@#$(if

$(BR2_TOOLCHAIN_HAS_FORTRAN),1,0)#' \
- -e 's#@@CMAKE_BUILD_TYPE@@#$(if
$(BR2_ENABLE_DEBUG),Debug,Release)#' \
+ -e 's#@@CMAKE_BUILD_TYPE@@#$(if

$(BR2_ENABLE_DEBUG),RelWithDebInfo,Release)#' \
                $(TOPDIR)/support/misc/toolchainfile.cmake.in \
                > $@
Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 10246] BR2_ENABLE_DEBUG does not have the expected effect for cmake packages

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10246

Thomas Petazzoni <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #2 from Thomas Petazzoni <[email protected]> --- What you're proposing is to exactly revert
https://git.buildroot.org/buildroot/commit/package/pkg-cmake.mk?id=104bb29e0490bfb487e2e665448dd3ca07fcc2b5,
which already reverted the change you're proposing :)

So, see the commit log of
https://git.buildroot.org/buildroot/commit/package/pkg-cmake.mk?id=104bb29e0490bfb487e2e665448dd3ca07fcc2b5
for the explanation of why we're using the Debug build type and not the RelWithDebInfo build type.

If you disagree, please submit a patch to the mailing list with a precise description of why reverting
https://git.buildroot.org/buildroot/commit/package/pkg-cmake.mk?id=104bb29e0490bfb487e2e665448dd3ca07fcc2b5
is a good idea. Thanks!

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 10246] BR2_ENABLE_DEBUG does not have the expected effect for cmake packages

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10246

--- Comment #3 from Mehdi Amini <[email protected]> --- Thanks for the pointer. The rational in the commit message your pointing to does not make sense to me, will email the mailing-list.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.