mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
nuttx: Add LIBSUPCXX_TOOLCHAIN to link the prebuilt library provide by toolchain.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
@@ -79,7 +79,7 @@ if(NOT CONFIG_LIBM)
|
||||
nuttx_find_toolchain_lib(libm.a)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
if(CONFIG_LIBSUPCXX_TOOLCHAIN)
|
||||
nuttx_find_toolchain_lib(libsupc++.a)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -490,7 +490,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ if(NOT CONFIG_LIBM)
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
if(CONFIG_LIBSUPCXX_TOOLCHAIN)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libsupc++.a
|
||||
|
||||
@@ -164,7 +164,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}
|
||||
endif
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}
|
||||
endif
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ if(NOT CONFIG_LIBM)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
if(CONFIG_LIBSUPCXX_TOOLCHAIN)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libsupc++.a
|
||||
|
||||
@@ -401,7 +401,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}
|
||||
endif
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += ${wildcard ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}
|
||||
endif
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ if(CONFIG_LIBM_TOOLCHAIN)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
if(CONFIG_LIBSUPCXX_TOOLCHAIN)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libsupc++.a
|
||||
|
||||
@@ -193,7 +193,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
|
||||
endif
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ elseif(CONFIG_ARCH_ARMV8M) # All ARMv8-M
|
||||
add_subdirectory(armv8-m)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_LIBSUPCXX)
|
||||
if(NOT CONFIG_LIBSUPCXX_TOOLCHAIN)
|
||||
list(APPEND SRCS aeabi_atexit.c)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ else ifeq ($(CONFIG_ARCH_ARMV8M),y) # All ARMv8-M
|
||||
include $(TOPDIR)/libs/libc/machine/arm/armv8-m/Make.defs
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_LIBSUPCXX),y)
|
||||
ifneq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
CSRCS += aeabi_atexit.c
|
||||
endif
|
||||
|
||||
|
||||
+11
-5
@@ -67,11 +67,11 @@ config ETL
|
||||
Implements C++ templates such as containers, string
|
||||
singleton math without C++ STL libraries
|
||||
|
||||
if LIBCXX || UCLIBCXX
|
||||
if !LIBCXXMINI
|
||||
|
||||
choice
|
||||
prompt "C++ low level library select"
|
||||
default LIBSUPCXX
|
||||
default LIBSUPCXX_TOOLCHAIN
|
||||
|
||||
config LIBCXXABI
|
||||
bool "LLVM low level C++ Library"
|
||||
@@ -81,21 +81,27 @@ config LIBCXXABI
|
||||
Select if your use libc++abi as lower level c++ library
|
||||
|
||||
config LIBSUPCXX
|
||||
bool "GNU compile low level libsupc++"
|
||||
---help---
|
||||
Select if your compile libsupc++ and use libsupc++ as lower
|
||||
level c++ library.
|
||||
|
||||
config LIBSUPCXX_TOOLCHAIN
|
||||
bool "GNU low level libsupc++"
|
||||
---help---
|
||||
Select if your toolchain provides libsupc++ and use libsupc++ as lower
|
||||
Select if your toolchain provides libsupc++ and use toolchain libsupc++ as lower
|
||||
level c++ library.
|
||||
|
||||
endchoice
|
||||
|
||||
endif
|
||||
|
||||
config LIBCXXABI_VERSION
|
||||
string "Select libcxxabi version"
|
||||
depends on LIBCXXABI
|
||||
default LIBCXX_VERSION if LIBCXX
|
||||
default "17.0.6" if !LIBCXX
|
||||
|
||||
endif
|
||||
|
||||
config CXX_STANDARD
|
||||
string "Language standard"
|
||||
default "gnu++20" if LIBCXX
|
||||
|
||||
@@ -73,6 +73,10 @@ set_property(
|
||||
PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/include/libcxx)
|
||||
|
||||
add_compile_definitions(_LIBCPP_BUILDING_LIBRARY)
|
||||
if(CONFIG_LIBSUPCXX_TOOLCHAIN)
|
||||
add_compile_definitions(__GLIBCXX__)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
add_compile_definitions(__GLIBCXX__)
|
||||
endif()
|
||||
|
||||
@@ -54,6 +54,10 @@ endif
|
||||
CXXFLAGS += ${DEFINE_PREFIX}_LIBCPP_BUILDING_LIBRARY
|
||||
CXXFLAGS += ${INCDIR_PREFIX}$(CURDIR)/libcxx/src
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
|
||||
CXXFLAGS += ${DEFINE_PREFIX}__GLIBCXX__
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX),y)
|
||||
CXXFLAGS += ${DEFINE_PREFIX}__GLIBCXX__
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user