From 4f7986ce1d448c3ff6a4b8245fcce1b4a7aec250 Mon Sep 17 00:00:00 2001 From: ThomasNS Date: Fri, 1 Dec 2023 14:25:59 +0100 Subject: [PATCH] upgrade llvm version to 17.0.6 and set default nuttx math lib as default --- libs/libm/Kconfig | 1 + libs/libxx/Kconfig | 4 ++-- libs/libxx/__config_site | 24 +++++++++----------- libs/libxx/libcxx.defs | 48 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 15 deletions(-) diff --git a/libs/libm/Kconfig b/libs/libm/Kconfig index ef183a653a136..aa4487ac05b4b 100644 --- a/libs/libm/Kconfig +++ b/libs/libm/Kconfig @@ -7,6 +7,7 @@ choice prompt "Select math library" default LIBM_NONE if DEFAULT_SMALL default LIBM_TOOLCHAIN if !DEFAULT_SMALL + default LIBM if LIBCXX config LIBM bool "Math library from NuttX" diff --git a/libs/libxx/Kconfig b/libs/libxx/Kconfig index 87c8689e96937..4e52b2f1473cf 100644 --- a/libs/libxx/Kconfig +++ b/libs/libxx/Kconfig @@ -84,7 +84,7 @@ config LIBCXXABI_VERSION string "Select libcxxabi version" depends on LIBCXXABI default LIBCXX_VERSION if LIBCXX - default "15.0.7" if !LIBCXX + default "17.0.6" if !LIBCXX endif @@ -117,6 +117,6 @@ endif config LIBCXX_VERSION string "Select libcxx version" depends on LIBCXX - default "15.0.7" + default "17.0.6" endif diff --git a/libs/libxx/__config_site b/libs/libxx/__config_site index 8662a132f0ac2..a47da19c95fa2 100644 --- a/libs/libxx/__config_site +++ b/libs/libxx/__config_site @@ -9,32 +9,30 @@ #ifndef _LIBCPP___CONFIG_SITE #define _LIBCPP___CONFIG_SITE -/* The following is generated from include/__config_site.in - * in Ubunutu 22.0.4 with g++ 11.3.0. - */ - #define _LIBCPP_ABI_VERSION 1 #define _LIBCPP_ABI_NAMESPACE __1 /* #undef _LIBCPP_ABI_FORCE_ITANIUM */ -/* #undef _LIBCPP_ABI_FORCE_MICROSOFT */ -/* #undef _LIBCPP_HAS_NO_THREADS */ -/* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */ -/* #undef _LIBCPP_HAS_MUSL_LIBC */ /* #undef _LIBCPP_HAS_THREAD_API_PTHREAD */ /* #undef _LIBCPP_HAS_THREAD_API_EXTERNAL */ /* #undef _LIBCPP_HAS_THREAD_API_WIN32 */ -/* #undef _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL */ /* #undef _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS */ #define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS /* #undef _LIBCPP_NO_VCRUNTIME */ /* #undef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION */ -/* #undef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY */ -/* #undef _LIBCPP_HAS_PARALLEL_ALGORITHMS */ +/* #undef _LIBCPP_HAS_NO_FILESYSTEM */ /* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */ /* #undef _LIBCPP_HAS_NO_LOCALIZATION */ /* #undef _LIBCPP_HAS_NO_WIDE_CHARACTERS */ -#define _LIBCPP_ENABLE_ASSERTIONS_DEFAULT 0 -/* #undef _LIBCPP_ENABLE_DEBUG_MODE */ +#define _LIBCPP_HAS_NO_STD_MODULES +/* #undef _LIBCPP_HAS_NO_TIME_ZONE_DATABASE */ + +// PSTL backends +#define _LIBCPP_PSTL_CPU_BACKEND_SERIAL +/* #undef _LIBCPP_PSTL_CPU_BACKEND_THREAD */ +/* #undef _LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH */ + +// Hardening. +#define _LIBCPP_HARDENING_MODE_DEFAULT 2 // __USE_MINGW_ANSI_STDIO gets redefined on MinGW #ifdef __clang__ diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs index 9d5922ff9356a..84197a745e684 100644 --- a/libs/libxx/libcxx.defs +++ b/libs/libxx/libcxx.defs @@ -46,6 +46,11 @@ ifeq ($(wildcard libcxx/.git),) endif CXXFLAGS += ${DEFINE_PREFIX}_LIBCPP_BUILDING_LIBRARY + +CXXFLAGS += ${DEFINE_PREFIX}__STDC_CONSTANT_MACROS +CXXFLAGS += ${DEFINE_PREFIX}__STDC_FORMAT_MACROS +CXXFLAGS += ${DEFINE_PREFIX}__STDC_LIMIT_MACROS + CXXFLAGS += ${INCDIR_PREFIX}$(CURDIR)/libcxx/src ifeq ($(CONFIG_LIBSUPCXX), y) @@ -135,7 +140,50 @@ ifeq ($(GCCVER),12) libcxx/src/locale.cpp_CXXFLAGS += -Wno-attributes endif +# warning on gcc >= 12.3.Rel1 +# libcxx/src/string.cpp:58:33: warning: 'template struct std::__1::char_traits' is deprecated: char_traits for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Wdeprecated-declarations] +# 58 | template string operator+, allocator>(char const*, string const&); +ifeq ($(shell expr $(GCCVER) \>= 12), 1) + libcxx/src/string.cpp_CXXFLAGS += -Wno-deprecated-declarations +endif + +# warning on gcc >= 12.3.Rel1 +# libcxx/src/filesystem/path.cpp:14: +# libcxx/src/filesystem/path_parser.h: In constructor 'std::__1::__fs::filesystem::parser::PathParser::PathParser(std::__1::__fs::filesystem::parser::string_view_t, ParserState)': +# libcxx/src/filesystem/path_parser.h:58:43: warning: declaration of 'State' shadows a member of 'std::__1::__fs::filesystem::parser::PathParser' [-Wshadow] +# 58 | PathParser(string_view_t P, ParserState State) noexcept : Path(P), +# | ~~~~~~~~~~~~^~~~~ +# libcxx/src/filesystem/path_parser.h:55:15: note: shadowed declaration is here +# 55 | ParserState State; +# | ^~~~~ +# libcxx/src/filesystem/path_parser.h: In constructor 'std::__1::__fs::filesystem::parser::PathParser::PathParser(std::__1::__fs::filesystem::parser::string_view_t, ParserState)': +# libcxx/src/filesystem/path_parser.h:58:43: warning: declaration of 'State' shadows a member of 'std::__1::__fs::filesystem::parser::PathParser' [-Wshadow] +# 58 | PathParser(string_view_t P, ParserState State) noexcept : Path(P), +# | ~~~~~~~~~~~~^~~~~ +# libcxx/src/filesystem/path_parser.h:55:15: note: shadowed declaration is here +# 55 | ParserState State; +# | ^~~~~ +# libcxx/src/filesystem/path_parser.h: In constructor 'std::__1::__fs::filesystem::parser::PathParser::PathParser(std::__1::__fs::filesystem::parser::string_view_t, ParserState)': +# libcxx/src/filesystem/path_parser.h:58:43: warning: declaration of 'State' shadows a member of 'std::__1::__fs::filesystem::parser::PathParser' [-Wshadow] +# 58 | PathParser(string_view_t P, ParserState State) noexcept : Path(P), +# | ~~~~~~~~~~~~^~~~~ +# libcxx/src/filesystem/path_parser.h:55:15: note: shadowed declaration is here +# 55 | ParserState State; +# | ^~~~~ +ifeq ($(shell expr $(GCCVER) \>= 12), 1) + libcxx/src/filesystem/path.cpp_CXXFLAGS += -Wno-shadow +endif + +# warning on gcc >= 12.3.Rel1 +# libcxx/src/ryu/d2s.cpp:490:31: warning: '_Trailing_zero_bits' may be used uninitialized [-Wmaybe-uninitialized] +# 490 | _Trailing_zero_bits += 32; +# | ~~~~~~~~~~~~~~~~~~~~^~~~~ +ifeq ($(shell expr $(GCCVER) \>= 12), 1) + libcxx/src/ryu/d2s.cpp_CXXFLAGS += -Wno-maybe-uninitialized +endif + CPPSRCS += $(wildcard libcxx/src/*.cpp) CPPSRCS += $(wildcard libcxx/src/experimental/*.cpp) CPPSRCS += $(wildcard libcxx/src/filesystem/*.cpp) +CPPSRCS += $(wildcard libcxx/src/ryu/*.cpp)