nuttx-update/libs/libxx/0001-libcxx-fix-ld-errors.patch
cuiziwei 39576af753 libcxxabi: Optimize cxx code size
enable LIBSUPCXX:
text data bss dec hex filename
93080 592 5472 99144 18348 nuttx/nuttx

enable LIBCXXABI:
before:
text data bss dec hex filename
126468 352 5960 132780 206ac nuttx/nuttx

after:
text data bss dec hex filename
68048 352 5960 74360 12278 nuttx/nuttx

Summary:
Optimize text segment code size by about 46%.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-09 01:35:13 +08:00

28 lines
1.1 KiB
Diff

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())
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ && !uncaught_exception()
+#endif
+ )
{
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
diff --git libcxx/src/exception.cpp libcxx/src/exception.cpp
--- 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"
+#elif defined(_LIBCPPABI_VERSION) && defined(_LIBCPP_HAS_NO_EXCEPTIONS)
+#include "include/atomic_support.h"
+#include "support/runtime/exception_pointer_unimplemented.ipp"
#elif defined(_LIBCPPABI_VERSION)
#include "support/runtime/exception_libcxxabi.ipp"
#include "support/runtime/exception_pointer_cxxabi.ipp"