From: Thomas De Schampheleire Date: Tue, 1 Jun 2021 14:34:07 +0000 (+0200) Subject: core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a8c50fe05afacc3cbe8e7347e238da9f242fab0;p=buildroot.git 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 Reviewed-by: Yann E. MORIN Signed-off-by: Yann E. MORIN --- 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))