xiaoxiang781216 commented on code in PR #18096:
URL: https://github.com/apache/nuttx/pull/18096#discussion_r2717298946


##########
libs/libxx/libcxx/Make.defs:
##########
@@ -32,11 +32,12 @@ libcxx/libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz
                 --exclude libcxx-$(LIBCXX_VERSION).src/test/std/pstl
        $(Q) mv libcxx-$(LIBCXX_VERSION).src $@
        $(Q) patch -p0 < libcxx/0001_fix_stdatomic_h_miss_typedef.patch -d 
libcxx
-       $(Q) patch -p2 < libcxx/mbstate_t.patch -d libcxx
        $(Q) patch -p0 < libcxx/0001-libcxx-remove-mach-time-h.patch -d libcxx
        $(Q) patch -p0 < libcxx/0001-libcxx-fix-ld-errors.patch -d libcxx
        $(Q) patch -p0 < libcxx/0001-Fix-build-error-about-__GLIBC__.patch -d 
libcxx
-       $(Q) patch -p0 < libcxx/0001-libc-Fix-failures-with-GCC-14-92663.patch 
-d libcxx
+       $(Q) patch -p0 < libcxx/0002-libcxx-decay-and-tzdb-fixes.patch -d libcxx
+       $(Q) patch -p0 < libcxx/mbstate_t.patch -d libcxx
+       $(Q) cp $(CURDIR)/__assertion_handler 
libcxx/libcxx/include/__assertion_handler

Review Comment:
   why need overwrite __assertion_handler



##########
libs/libxx/libcxx/0002-libcxx-decay-and-tzdb-fixes.patch:
##########
@@ -0,0 +1,49 @@
+--- libcxx/include/__type_traits/decay.h
++++ libcxx/include/__type_traits/decay.h
+@@ -25,7 +25,7 @@
+
+ _LIBCPP_BEGIN_NAMESPACE_STD
+
+-#if __has_builtin(__decay)
++#if __has_builtin(__decay) && !defined(_LIBCPP_DISABLE_DECAY_BUILTIN)
+ template <class _Tp>
+ using __decay_t _LIBCPP_NODEBUG = __decay(_Tp);
+
+--- libcxx/src/experimental/tzdb.cpp
++++ libcxx/src/experimental/tzdb.cpp
+@@ -50,6 +50,8 @@
+ _LIBCPP_WEAK string_view __libcpp_tzdb_directory() {
+ #if defined(__linux__)
+   return "/usr/share/zoneinfo/";
++#elif defined(CONFIG_LIBC_TZDIR)
++  return CONFIG_LIBC_TZDIR "/";
+ #else
+-#  error "unknown path to the IANA Time Zone Database"
++  return string_view{};
+ #endif
+
+--- libcxx/src/include/overridable_function.h
++++ libcxx/src/include/overridable_function.h
+@@ -96,7 +96,7 @@
+ }
+ _LIBCPP_END_NAMESPACE_STD
+
+-#elif defined(_LIBCPP_OBJECT_FORMAT_ELF)
++#elif defined(_LIBCPP_OBJECT_FORMAT_ELF) && 
!defined(CONFIG_ESPRESSIF_CHIP_SERIES)

Review Comment:
   why check CONFIG_ESPRESSIF_CHIP_SERIES in the common code



##########
libs/libxx/libcxx/0002-libcxx-decay-and-tzdb-fixes.patch:
##########
@@ -0,0 +1,49 @@
+--- libcxx/include/__type_traits/decay.h
++++ libcxx/include/__type_traits/decay.h
+@@ -25,7 +25,7 @@
+
+ _LIBCPP_BEGIN_NAMESPACE_STD
+
+-#if __has_builtin(__decay)
++#if __has_builtin(__decay) && !defined(_LIBCPP_DISABLE_DECAY_BUILTIN)
+ template <class _Tp>
+ using __decay_t _LIBCPP_NODEBUG = __decay(_Tp);
+
+--- libcxx/src/experimental/tzdb.cpp
++++ libcxx/src/experimental/tzdb.cpp
+@@ -50,6 +50,8 @@
+ _LIBCPP_WEAK string_view __libcpp_tzdb_directory() {
+ #if defined(__linux__)
+   return "/usr/share/zoneinfo/";
++#elif defined(CONFIG_LIBC_TZDIR)
++  return CONFIG_LIBC_TZDIR "/";
+ #else
+-#  error "unknown path to the IANA Time Zone Database"
++  return string_view{};
+ #endif
+
+--- libcxx/src/include/overridable_function.h
++++ libcxx/src/include/overridable_function.h
+@@ -96,7 +96,7 @@
+ }
+ _LIBCPP_END_NAMESPACE_STD
+
+-#elif defined(_LIBCPP_OBJECT_FORMAT_ELF)
++#elif defined(_LIBCPP_OBJECT_FORMAT_ELF) && 
!defined(CONFIG_ESPRESSIF_CHIP_SERIES)
+
+ #  define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
+ #  define _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE 
__attribute__((__section__("__lcxx_override")))
+@@ -121,6 +121,13 @@
+
+ #else
+
++#  ifdef CONFIG_ESPRESSIF_CHIP_SERIES

Review Comment:
   ditto



##########
libs/libxx/libcxx/0001-libcxx-fix-ld-errors.patch:
##########
@@ -1,28 +1,27 @@
-diff --git libcxx/include/ostream libcxx/include/ostream
---- libcxx/include/ostream
-+++ libcxx/include/ostream
-@@ -320,7 +320,10 @@ template <class _CharT, class _Traits>
- basic_ostream<_CharT, _Traits>::sentry::~sentry()
- {
-     if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
--                      && !uncaught_exception())
+--- libcxx/include/__ostream/basic_ostream.h
++++ libcxx/include/__ostream/basic_ostream.h
+@@ -152,7 +152,11 @@
+
+ template <class _CharT, class _Traits>
+ basic_ostream<_CharT, _Traits>::sentry::~sentry() {
+-  if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf) && 
!uncaught_exception()) {
++  if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
 +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-+                      && !uncaught_exception()
++      && !uncaught_exception()
 +#endif
-+       ) 
-     {
++  ) {
  #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-         try
-diff --git libcxx/src/exception.cpp libcxx/src/exception.cpp
+     try {
+ #endif // _LIBCPP_HAS_NO_EXCEPTIONS
 --- libcxx/src/exception.cpp
 +++ libcxx/src/exception.cpp
 @@ -19,6 +19,9 @@
  #if defined(_LIBCPP_ABI_MICROSOFT)
- #include "support/runtime/exception_msvc.ipp"
- #include "support/runtime/exception_pointer_msvc.ipp"
+ #  include "support/runtime/exception_msvc.ipp"

Review Comment:
   libcxx doesn't require indent



##########
libs/libxx/libcxx/0001-libcxx-remove-mach-time-h.patch:
##########
@@ -1,11 +1,11 @@
 --- libcxx/src/chrono.cpp
 +++ libcxx/src/chrono.cpp
-@@ -48,10 +48,6 @@
+@@ -50,10 +50,6 @@
  #  include <zircon/syscalls.h>
  #endif
- 
+
 -#if __has_include(<mach/mach_time.h>)

Review Comment:
   why  need change



##########
libs/libxx/libcxx/nuttx_string_instantiations.cpp:
##########
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// Force emission of the std::__1::basic_string destructors for the
+// character sets that NuttX enables.  The upstream libc++ headers declare
+// the relevant template instantiations as "extern", so without providing
+// explicit definitions the linker cannot resolve references coming from
+// locale-heavy translation units such as locale.cpp.
+
+#include <string>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Emit the full char specialization so all key functions (including dtors)
+// are visible from libxx.a instead of remaining TU-local.
+template class _LIBCPP_EXPORTED_FROM_ABI basic_string<char>;

Review Comment:
   why need explicit template instantiation



##########
libs/libxx/libcxx/0002-libcxx-decay-and-tzdb-fixes.patch:
##########
@@ -0,0 +1,49 @@
+--- libcxx/include/__type_traits/decay.h
++++ libcxx/include/__type_traits/decay.h
+@@ -25,7 +25,7 @@
+
+ _LIBCPP_BEGIN_NAMESPACE_STD
+
+-#if __has_builtin(__decay)
++#if __has_builtin(__decay) && !defined(_LIBCPP_DISABLE_DECAY_BUILTIN)

Review Comment:
   why need



##########
libs/libxx/libcxx/0001_fix_stdatomic_h_miss_typedef.patch:
##########
@@ -1,11 +1,11 @@
---- libcxx/include/stdatomic.h.old     2023-12-06 21:01:46.168049453 +0800
-+++ libcxx/include/stdatomic.h 2023-12-06 21:01:55.056057032 +0800
+--- libcxx/include/stdatomic.h
++++ libcxx/include/stdatomic.h
 @@ -220,7 +220,7 @@
  using std::atomic_signal_fence _LIBCPP_USING_IF_EXISTS;
  using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
- 
+
 -#elif defined(_LIBCPP_COMPILER_CLANG_BASED)

Review Comment:
   why need change



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to