nuttx/arch/arm64
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
..
include imx9: imx95 fix uSDHC IRQ naming to match NuttX USDHC convention 2026-03-24 15:39:07 +08:00
src build/cmake/stdlib: guard include/cxx by LIBMINIABI, fix div_t conflict 2026-03-29 16:45:29 -03:00
CMakeLists.txt arch/arm64: migrate to SPDX identifier 2024-12-02 22:43:23 +08:00
Kconfig arch/armv8-r64: userspace PMU access 2026-01-27 21:57:37 +08:00