Skip to content

Commit ff1dc95

Browse files
anchaoraiden00pl
authored andcommitted
libc/libcxx: fix failures with GCC 14
CXX: libcxx/libcxx/src/random.cpp In file included from nuttx/include/libcxx/__filesystem/filesystem_error.h:15, from nuttx/include/libcxx/__filesystem/directory_entry.h:20, from nuttx/include/libcxx/filesystem:539, from nuttx/include/libcxx/fstream:192, from libcxx/libcxx/src/ios.instantiations.cpp:10: nuttx/include/libcxx/__filesystem/path.h: In instantiation of 'std::__1::__fs::filesystem::path::_EnableIfPathable<_Source> std::__1::__fs::filesystem::path::append(const _Source&) [with _Source = std::__1::basic_string<char>]': nuttx/include/libcxx/__filesystem/path.h:623:30: error: use of built-in trait '__remove_pointer(typename std::__1::decay<_Tp>::type)' in function signature; use library traits instead 623 | _EnableIfPathable<_Source> append(const _Source& __src) { | ^~~~~~ Pick the change from llvm-project: llvm/llvm-project#92663 Signed-off-by: chao an <anchao.archer@bytedance.com>
1 parent 1d383a2 commit ff1dc95

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From cb7a03b41fff563c0cbb5145eed09f9b17edf9e2 Mon Sep 17 00:00:00 2001
2+
From: Nikolas Klauser <nikolasklauser@berlin.de>
3+
Date: Sat, 1 Jun 2024 12:20:41 +0200
4+
Subject: [PATCH] [libc++] Fix failures with GCC 14 (#92663)
5+
6+
Fixes #91831
7+
8+
Signed-off-by: chao an <anchao.archer@bytedance.com>
9+
10+
---
11+
libcxx/include/__type_traits/remove_pointer.h | 5 +++++
12+
11 files changed, 22 insertions(+), 8 deletions(-)
13+
14+
diff --git libcxx/include/__type_traits/remove_pointer.h b/libcxx/include/__type_traits/remove_pointer.h
15+
index 54390a1939f7..1048f67055a2 100644
16+
--- libcxx/include/__type_traits/remove_pointer.h
17+
+++ libcxx/include/__type_traits/remove_pointer.h
18+
@@ -23,8 +23,13 @@ struct remove_pointer {
19+
using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
20+
};
21+
22+
+# ifdef _LIBCPP_COMPILER_GCC
23+
+template <class _Tp>
24+
+using __remove_pointer_t = typename remove_pointer<_Tp>::type;
25+
+# else
26+
template <class _Tp>
27+
using __remove_pointer_t = __remove_pointer(_Tp);
28+
+# endif
29+
#else
30+
// clang-format off
31+
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;};
32+
33+
--
34+
2.43.0
35+

libs/libxx/libcxx/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ if(CONFIG_LIBCXX)
5252
-p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
5353
${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-fix-ld-errors.patch && patch -p1
5454
-d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
55-
${CMAKE_CURRENT_LIST_DIR}/0001-Fix-build-error-about-__GLIBC__.patch
55+
${CMAKE_CURRENT_LIST_DIR}/0001-Fix-build-error-about-__GLIBC__.patch &&
56+
patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
57+
${CMAKE_CURRENT_LIST_DIR}/0001-libc-Fix-failures-with-GCC-14-92663.patch
5658
DOWNLOAD_NO_PROGRESS true
5759
TIMEOUT 30)
5860

libs/libxx/libcxx/Make.defs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ libcxx/libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz
3636
$(Q) patch -p0 < libcxx/0001-libcxx-remove-mach-time-h.patch -d libcxx
3737
$(Q) patch -p0 < libcxx/0001-libcxx-fix-ld-errors.patch -d libcxx
3838
$(Q) patch -p0 < libcxx/0001-Fix-build-error-about-__GLIBC__.patch -d libcxx
39+
$(Q) patch -p0 < libcxx/0001-libc-Fix-failures-with-GCC-14-92663.patch -d libcxx
3940

4041
endif
4142

0 commit comments

Comments
 (0)