From 8fa32fe4532cbeb2256bfc6c7cdd7eebdbe9739a Mon Sep 17 00:00:00 2001 From: Mamta Shukla Date: Sat, 15 Jul 2023 16:58:21 +0200 Subject: [PATCH 1/4] Makefile.uk: Upgrade to 15.0.0 Signed-off-by: Mamta Shukla --- Makefile.uk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.uk b/Makefile.uk index 9939c6c..ba7e812 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -50,7 +50,7 @@ endif ################################################################################ # Sources ################################################################################ -LIBCXX_VERSION=14.0.6 +LIBCXX_VERSION=15.0.0 LIBCXX_URL=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXX_VERSION)/libcxx-$(LIBCXX_VERSION).src.tar.xz LIBCXX_PATCHDIR=$(LIBCXX_BASE)/patches $(eval $(call fetch,libcxx,$(LIBCXX_URL))) From 5f43369e27d3257efc67ca2b0fc6810473fe18d1 Mon Sep 17 00:00:00 2001 From: Mamta Shukla Date: Sat, 15 Jul 2023 19:35:54 +0200 Subject: [PATCH 2/4] patches: Add patch to remove abi-tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ABI_TAG was introduced in upstream: https://github.com/llvm/llvm-project/commit/67b0b02ec9f2bbc57bf8f0550828d97f460ac11f These ABI_TAG leads to error: build/libcxx/origin/libcxx-15.0.0.src/include/__support/musl/xlocale.h:38:74: error: ‘abi_tag’ attribute applied to extern "C" declaration ‘long long int wcstoll_’ 38 | wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) { Signed-off-by: Mamta Shukla --- patches/0001-Remove-ABI-tag.patch | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 patches/0001-Remove-ABI-tag.patch diff --git a/patches/0001-Remove-ABI-tag.patch b/patches/0001-Remove-ABI-tag.patch new file mode 100644 index 0000000..8abad25 --- /dev/null +++ b/patches/0001-Remove-ABI-tag.patch @@ -0,0 +1,50 @@ +From 316e4eee534e9474e34f928d5451032556377853 Mon Sep 17 00:00:00 2001 +From: Mamta Shukla +Date: Sun, 6 Aug 2023 22:49:45 +0200 +Subject: [PATCH] Remove ABI tag + +Signed-off-by: Mamta Shukla +--- + include/__support/musl/xlocale.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/include/__support/musl/xlocale.h b/include/__support/musl/xlocale.h +index f564c87..97b4876 100644 +--- a/include/__support/musl/xlocale.h ++++ b/include/__support/musl/xlocale.h +@@ -24,27 +24,27 @@ + extern "C" { + #endif + +-inline _LIBCPP_HIDE_FROM_ABI long long ++inline long long + strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) { + return ::strtoll(__nptr, __endptr, __base); + } + +-inline _LIBCPP_HIDE_FROM_ABI unsigned long long ++inline unsigned long long + strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) { + return ::strtoull(__nptr, __endptr, __base); + } + +-inline _LIBCPP_HIDE_FROM_ABI long long ++inline long long + wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) { + return ::wcstoll(__nptr, __endptr, __base); + } + +-inline _LIBCPP_HIDE_FROM_ABI long long ++inline long long + wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) { + return ::wcstoull(__nptr, __endptr, __base); + } + +-inline _LIBCPP_HIDE_FROM_ABI long double ++inline long double + wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) { + return ::wcstold(__nptr, __endptr); + } +-- +2.25.1 + From 079f3b581cfa4bab852b6aee01ab00d023718756 Mon Sep 17 00:00:00 2001 From: Mamta Shukla Date: Sat, 15 Jul 2023 19:48:56 +0200 Subject: [PATCH 3/4] patches: Remove patch for __is_convertible __is_convertible patch does not applies to 15.0.0 version. It is possible to compile libcxx without this patch. Tested for gcc-11. This reverts the commit: 4dd2450604: patches: Backport upstream fix for __is_convertible Signed-off-by: Mamta Shukla --- ..._convertible-built-in-when-available.patch | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 patches/0001-Use-__is_convertible-built-in-when-available.patch diff --git a/patches/0001-Use-__is_convertible-built-in-when-available.patch b/patches/0001-Use-__is_convertible-built-in-when-available.patch deleted file mode 100644 index faf471c..0000000 --- a/patches/0001-Use-__is_convertible-built-in-when-available.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits -index 3391999675..ab126d000d 100644 ---- a/include/type_traits -+++ b/include/type_traits -@@ -1659,11 +1659,18 @@ struct __is_core_convertible<_Tp, _Up, decltype( - - // is_convertible - --#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) -+#if __has_builtin(__is_convertible) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) -+ -+template -+struct _LIBCPP_TEMPLATE_VIS is_convertible : public integral_constant {}; -+ -+#elif __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) - - template struct _LIBCPP_TEMPLATE_VIS is_convertible - : public integral_constant {}; - -+// TODO: Remove this fallback when GCC < 13 support is no longer required. -+// GCC 13 has the __is_convertible built-in. - #else // __has_feature(is_convertible_to) - - namespace __is_convertible_imp From 1b01d7ca19962771b4dce0c9c2e2310ee82f8de4 Mon Sep 17 00:00:00 2001 From: Mamta Shukla Date: Tue, 15 Aug 2023 21:42:03 +0200 Subject: [PATCH 4/4] Makefile.uk: Use -fpermissive flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use -fpermissive flag to allow compiler-rt build note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) build/libcxx/origin/libcxx-15.0.0.src/include/__type_traits/is_same.h:22:72: error: template argument 1 is invalid 22 | struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { }; Signed-off-by: Mamta Shukla --- Makefile.uk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.uk b/Makefile.uk index ba7e812..e44aaf6 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -102,7 +102,7 @@ LIBCXX_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-maybe-uninitialized LIBCXX_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-unknown-pragmas LIBCXX_CFLAGS-y += $(LIBCXX_CONFIG_FLAGS) -LIBCXX_CXXFLAGS-y += $(LIBCXX_CONFIG_FLAGS) -std=c++2a +LIBCXX_CXXFLAGS-y += $(LIBCXX_CONFIG_FLAGS) -std=c++2a -fpermissive LIBCXX_CXXFLAGS-$(call have_gcc) += -Wno-literal-suffix LIBCXX_CXXFLAGS-$(call have_gcc) += -Wno-dangling-reference