[Buildroot] [git commit] core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set

From: Yann E. MORIN <hidden>
Date: 2021-06-01 20:39:26
Subsystem: the rest · Maintainer: Linus Torvalds

commit: https://git.buildroot.net/buildroot/commit/?id=5a8c50fe05afacc3cbe8e7347e238da9f242fab0
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

The 'assert' statement in glibc honors the 'NDEBUG' preprocessor macro: if
it is set, then the assert statement is compiled away.

Define this 'NDEBUG' macro when BR2_ENABLE_RUNTIME_DEBUG is disabled (the
default case).

Signed-off-by: Thomas De Schampheleire <redacted>
Reviewed-by: Yann E. MORIN <redacted>
Signed-off-by: Yann E. MORIN <redacted>
---
 package/Makefile.in | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/package/Makefile.in b/package/Makefile.in
index 86db62ba5b..955e6a8e8c 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -148,6 +148,9 @@ endif
 ifeq ($(BR2_DEBUG_3),y)
 TARGET_DEBUGGING = -g3
 endif
+ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),)
+TARGET_DEBUGGING += -DNDEBUG
+endif
 
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help