From: Baruch Siach Date: Thu, 3 Jun 2021 12:22:33 +0000 (+0300) Subject: package/daemon: fix build without BR2_ENABLE_RUNTIME_DEBUG X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea02ac3e061b36da1bfc0277b1f84126cd96328f;p=buildroot.git package/daemon: fix build without BR2_ENABLE_RUNTIME_DEBUG Since commit 5a8c50fe05afa ("core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set"), NDEBUG is defined in compile flags when BR2_ENABLE_RUNTIME_DEBUG is not enabled. Add a patch to make the daemon package build with NDEBUG as it should. Fixes: http://autobuild.buildroot.net/results/995ef1b5d9fce05881b2a41025916fa45b68a9bc/ http://autobuild.buildroot.net/results/98cd9fb348d6cfe676667205b1f79ec2cd1490de/ http://autobuild.buildroot.net/results/a7c51e6f59656d8c1e1c82a7129a670a68eb8a62/ Signed-off-by: Baruch Siach Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- diff --git a/package/daemon/0002-Fix-build-with-NDEBUG-defined.patch b/package/daemon/0002-Fix-build-with-NDEBUG-defined.patch new file mode 100644 index 0000000000..e99e9d8ed7 --- /dev/null +++ b/package/daemon/0002-Fix-build-with-NDEBUG-defined.patch @@ -0,0 +1,46 @@ +From fc84d8d572ffcecb533fd6d6d025abea12ce027e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Baruch Siach +Date: Thu, 3 Jun 2021 15:01:10 +0300 +Subject: [PATCH] Fix build with NDEBUG defined + +Build with NDEBUG fails because the debug() macro becomes empty. This +creates invalid syntax with the debug() call is the only statement in +the body of a 'for' loop. + +This fixes build failures like: + +daemon.c: In function 'show': +daemon.c:3607:2: error: expected expression before '}' token + } + ^ + +Signed-off-by: Baruch Siach +--- +Upstream status: https://github.com/raforg/daemon/pull/3 + + libslack/err.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libslack/err.h b/libslack/err.h +index 106bdb01e074..7acfbe46d60a 100644 +--- a/libslack/err.h ++++ b/libslack/err.h +@@ -40,10 +40,10 @@ + #undef check + + #ifdef NDEBUG +-#define debug(args) +-#define vdebug(args) +-#define debugsys(args) +-#define vdebugsys(args) ++#define debug(args) do {} while (0); ++#define vdebug(args) do {} while (0); ++#define debugsys(args) do {} while (0); ++#define vdebugsys(args) do {} while (0); + #define check(cond, mesg) (void_cast(0)) + #else + #define debug(args) debugf args; +-- +2.30.2 +