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 <moura.fmo@gmail.com>
Assisted-by: Claude:claude-sonnet-5
This commit is contained in:
Felipe Moura 2026-09-15 20:30:30 -03:00 • committed by Xiang Xiao
parent b6bb99c951
commit 0e2e851f50

View file

@ -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