Browse Source

core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set

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 <thomas.de_schampheleire@nokia.com>
Reviewed-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Thomas De Schampheleire 4 years ago
parent
commit
5a8c50fe05
1 changed files with 3 additions and 0 deletions
  1. 3 0
      package/Makefile.in

+ 3 - 0
package/Makefile.in

@@ -148,6 +148,9 @@ endif
 ifeq ($(BR2_DEBUG_3),y)
 ifeq ($(BR2_DEBUG_3),y)
 TARGET_DEBUGGING = -g3
 TARGET_DEBUGGING = -g3
 endif
 endif
+ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),)
+TARGET_DEBUGGING += -DNDEBUG
+endif
 
 
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))