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