nuttx/arch/arm64/src/cmake
trns1997 219a5ce09e build/cmake/stdlib: guard include/cxx by LIBMINIABI, fix div_t conflict
include/cxx contains NuttX's mini C++ ABI shims and must only be added
to the include path when CONFIG_LIBMINIABI is selected.  tools/Config.mk
was adding it unconditionally for every non-LIBCXX/non-UCLIBCXX build,
and the platform.cmake files for arm, arm64, risc-v, x86_64 and tricore
were adding it inside the CONFIG_LIBCXXTOOLCHAIN block.

With an unpatched downloaded ARM GNU Toolchain, <cstdlib> uses
newlib's stdlib.h, defining div_t as an anonymous struct.  A later
inclusion of NuttX's stdlib.h via <cstdio>->stdio.h->kmalloc.h then
redefines div_t with struct tag div_s, causing a conflicting declaration
error.

Guard the div_t/ldiv_t/lldiv_t definitions in stdlib.h with
redefinitions when a toolchain stdlib.h was already processed.

Also fix lldiv_s members typed as long instead of long long.

Signed-off-by: trns1997 <trns1997@gmail.com>
2026-03-29 16:45:29 -03:00
..
clang.cmake Kconfig: Add configurable Stack Canaries protection levels. 2025-09-11 19:56:42 +08:00
elf.cmake cmake(enhance):cmake support DYNLIB build 2026-01-19 14:45:37 +08:00
gcc.cmake arm64/cmake: fix typo in CMAKE_STRIP flag 2026-02-26 12:12:35 +01:00
platform.cmake build/cmake/stdlib: guard include/cxx by LIBMINIABI, fix div_t conflict 2026-03-29 16:45:29 -03:00
Toolchain.cmake arm64/cmake: support clang compile 2025-06-27 20:44:41 +08:00