build/cmake: Add toolchain C++ library linking for all platforms.

Extend CONFIG_LIBCXXTOOLCHAIN support to all remaining platforms
in CMake builds by explicitly locating and linking libstdc++.a
from the toolchain. This prevents build failures caused by STL
header/library mismatches where toolchain headers are included
without the corresponding library.
* Adds nuttx_find_toolchain_lib() calls for all platforms.
* Aligns CMake behavior with Make build system.

Signed-off-by: trns1997 <trns1997@gmail.com>
This commit is contained in:
trns1997
2026-01-16 09:40:49 +01:00
committed by GUIDINGLI
parent b82ad5c495
commit 9159f6e353
16 changed files with 85 additions and 90 deletions
+4
View File
@@ -132,6 +132,10 @@ ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
endif
ifeq ($(CONFIG_LIBCXXTOOLCHAIN),y)
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libstdc++.a))
endif
# Loadable module definitions
CMODULEFLAGS = $(CFLAGS) -fvisibility=hidden
+4
View File
@@ -80,6 +80,10 @@ ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
endif
ifeq ($(CONFIG_LIBCXXTOOLCHAIN),y)
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libstdc++.a))
endif
# Loadable module definitions
CMODULEFLAGS = $(CFLAGS) -fvisibility=hidden