nuttx/arch/arm/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
..
arm.cmake arch/arm: migrate to SPDX identifier 2024-12-06 09:25:23 +08:00
armclang.cmake Kconfig: Add configurable Stack Canaries protection levels. 2025-09-11 19:56:42 +08:00
armv6-m.cmake arch/arm: Add LLVM configuration to CMake 2025-01-10 16:58:01 +08:00
armv7-a.cmake arch/arm: Add LLVM configuration to CMake 2025-01-10 16:58:01 +08:00
armv7-m.cmake arch/arm: Add LLVM configuration to CMake 2025-01-10 16:58:01 +08:00
armv7-m_armclang.cmake arch/arm: migrate to SPDX identifier 2024-12-06 09:25:23 +08:00
armv7-m_clang.cmake arch/arm: migrate to SPDX identifier 2024-12-06 09:25:23 +08:00
armv7-m_gcc.cmake arch/arm: migrate to SPDX identifier 2024-12-06 09:25:23 +08:00
armv7-m_ghs.cmake ghs: change the vfpv3 to vfpv5 2026-01-14 09:41:49 +08:00
armv7-r.cmake arch/arm: migrate to SPDX identifier 2024-12-06 09:25:23 +08:00
armv8-m.cmake toolchain/arm/clang:Update clang compilation specifications 2026-02-04 02:33:36 +08:00
armv8-r.cmake arch/armv8-r: use -mfpu=fpv5-sp-d16 for SP-only Cortex-R52 targets 2025-12-08 21:09:05 +08:00
clang.cmake toolchain/arm/clang:Update clang compilation specifications 2026-02-04 02:33:36 +08:00
elf.cmake elf(bugfix):fix elf compile link error when enable LTO 2026-01-19 14:45:37 +08:00
gcc.cmake Kconfig: Add configurable Stack Canaries protection levels. 2025-09-11 19:56:42 +08:00
ghs.cmake ghs: update the compile option to recommended options 2026-01-16 21:57:00 +08: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 arch/arm: migrate to SPDX identifier 2024-12-06 09:25:23 +08:00