Bug 13627 - Align setting of NDEBUG define in build system classes
Summary: Align setting of NDEBUG define in build system classes
Status: RESOLVED WONTFIX
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 4.99
Assignee: Changqing Li
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-11-15 08:48 UTC by Martin
Modified: 2022-11-03 15:29 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2019-11-15 08:48:37 UTC
Noticed that assert() behaviour is different between the cmake.bbclass (passes -DNDEBUG in release [1]) and meson.bbclass (does not pass -DNDEBUG [2]). It also looks to me like the autotools.bbclass does not pass -DNDEBUG but I have not tried to verify this.

Does it make sense to align the different classes so that -DNDEBUG is passed in release builds for all build systems?


[1] http://cgit.openembedded.org/openembedded-core/tree/meta/classes/cmake.bbclass?id=3f91512ffc8c1c3374b3a67df5f86e884c78d7a1#n47

[2] Tested building a Meson project on thud and could trigger an assert(). It does not look like it has changed on master: http://cgit.openembedded.org/openembedded-core/tree/meta/classes/meson.bbclass?id=3f91512ffc8c1c3374b3a67df5f86e884c78d7a1
Comment 1 Changqing Li 2019-12-04 07:11:41 UTC
I think we don't have to align the different class. 
1. the build system class is used by different recipes, and they can have different configuration. 
2. we have different build system,  they have different default usage about this.


for cmake.bbclass and meson.bbclass, they have similar mechanism,  NDEBUG can be set to switch by buildtype by some options


for autotools, I think  need to set this in configure.ac per recipe. 


another one for distutils, seems enable DNDEBUG by default.
Comment 2 Randy MacLeod 2022-11-03 15:29:40 UTC
RP agrees that this should be system specific as Changqing stated.
-- From: YP bug review meeting