This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 0e2e851f5 fsutils/libtinycbor: fix build on picolibc/newlib
0e2e851f5 is described below
commit 0e2e851f50b362a1c9065151970f004dbccf7a53
Author: Felipe Moura <[email protected]>
AuthorDate: Tue Sep 15 20:30:30 2026 -0300
fsutils/libtinycbor: fix build on picolibc/newlib
CONFIG_FSUTILS_TINYCBOR_LIB fails to build on toolchains with their own
<memory.h> (picolibc, newlib): cbortojson.c does "#include <memory.h>"
meaning TinyCBOR's own (where cbor_malloc/cbor_realloc/cbor_free are
declared), but only the parent directory was on the include path, so
the toolchain's own <memory.h> wins instead, leaving those symbols
implicitly declared.
Fix: also put the unpacked tinycbor/ subdirectory (Make.defs' own
TINYCBOR_UNPACKNAME) on the include path.
Signed-off-by: Felipe Moura <[email protected]>
Assisted-by: Claude:claude-sonnet-5
---
fsutils/libtinycbor/Make.defs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fsutils/libtinycbor/Make.defs b/fsutils/libtinycbor/Make.defs
index 4465760a3..bdb96285c 100644
--- a/fsutils/libtinycbor/Make.defs
+++ b/fsutils/libtinycbor/Make.defs
@@ -23,4 +23,9 @@
ifneq ($(CONFIG_FSUTILS_TINYCBOR_LIB),)
CONFIGURED_APPS += $(APPDIR)/fsutils/libtinycbor
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/fsutils/libtinycbor
+
+# cbortojson.c's "#include <memory.h>" means TinyCBOR's own, not the
+# toolchain's; without this on the path picolibc/newlib's wins instead.
+
+CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/fsutils/libtinycbor/tinycbor
endif