diff options
| author | mikhnenko <[email protected]> | 2024-12-18 19:08:08 +0300 |
|---|---|---|
| committer | mikhnenko <[email protected]> | 2024-12-18 19:29:26 +0300 |
| commit | 7ed76959e6c06dbc4c249ce0f3b930463a6b65db (patch) | |
| tree | 0e9528cb7261812a5ae7ed177048721eaebf8ed0 /contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch | |
| parent | 4c8e7f015711b5175d63e1a87cbd40c49ce7aa70 (diff) | |
libc++: Run clang-format from upstream and update to 9783f28cbb155e4a8d49c12e1c60ce14dcfaf0c7
commit_hash:ca4954fe054e5a7190ad11ab71bfc7ca0965bca2
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch')
| -rw-r--r-- | contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch | 84 |
1 files changed, 44 insertions, 40 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch b/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch index 63a02613148..e8a62bc984a 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch @@ -1,51 +1,55 @@ diff --git a/include/__config b/include/__config -index 7f66042..ac4a6d8 100644 +index adff13e..51463fc 100644 --- a/include/__config +++ b/include/__config @@ -127,7 +127,12 @@ // Previously libc++ used "unsigned int" exclusively. # define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION // Unstable attempt to provide a more optimized std::function -+#ifdef __EMSCRIPTEN__ +-# define _LIBCPP_ABI_OPTIMIZED_FUNCTION ++# ifdef __EMSCRIPTEN__ +// XXX EMSCRIPTEN https://github.com/emscripten-core/emscripten/issues/11022 -+//# define _LIBCPP_ABI_OPTIMIZED_FUNCTION -+#else - # define _LIBCPP_ABI_OPTIMIZED_FUNCTION -+#endif ++// # define _LIBCPP_ABI_OPTIMIZED_FUNCTION ++# else ++# define _LIBCPP_ABI_OPTIMIZED_FUNCTION ++# endif // All the regex constants must be distinct and nonzero. # define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO // Re-worked external template instantiations for std::string with a focus on diff --git a/include/typeinfo b/include/typeinfo -index e8b7573..265e322 100644 +index 39a9067..ed89a4f 100644 --- a/include/typeinfo +++ b/include/typeinfo -@@ -103,6 +103,11 @@ public: +@@ -98,7 +98,13 @@ public: - size_t hash_code() const _NOEXCEPT; + size_t hash_code() const _NOEXCEPT; -+#ifdef __EMSCRIPTEN__ -+ // XXX Emscripten: adding `always_inline` fixes -+ // https://github.com/emscripten-core/emscripten/issues/13330 -+ __attribute__((always_inline)) -+#endif - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 - bool operator==(const type_info& __arg) const _NOEXCEPT { - // When evaluated in a constant expression, both type infos simply can't come +- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const type_info& __arg) const _NOEXCEPT { ++# ifdef __EMSCRIPTEN__ ++ // XXX Emscripten: adding `always_inline` fixes ++ // https://github.com/emscripten-core/emscripten/issues/13330 ++ __attribute__((always_inline)) ++# endif ++ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool ++ operator==(const type_info& __arg) const _NOEXCEPT { + // When evaluated in a constant expression, both type infos simply can't come + // from different translation units, so it is sufficient to compare their addresses. + if (__libcpp_is_constant_evaluated()) { diff --git a/src/filesystem/operations.cpp b/src/filesystem/operations.cpp -index 63a119a..61f2cc5 100644 +index 6bee340..1b9f260 100644 --- a/src/filesystem/operations.cpp +++ b/src/filesystem/operations.cpp @@ -37,7 +37,7 @@ - #include <time.h> #include <fcntl.h> /* values for fchmodat */ + #include <time.h> -#if __has_include(<sys/sendfile.h>) +#if __has_include(<sys/sendfile.h>) && !defined(__EMSCRIPTEN__) - # include <sys/sendfile.h> - # define _LIBCPP_FILESYSTEM_USE_SENDFILE + # include <sys/sendfile.h> + # define _LIBCPP_FILESYSTEM_USE_SENDFILE #elif defined(__APPLE__) || __has_include(<copyfile.h>) diff --git a/src/new.cpp b/src/new.cpp -index 033bba5..318b062 100644 +index 033bba5..e9a4adc 100644 --- a/src/new.cpp +++ b/src/new.cpp @@ -41,6 +41,16 @@ _LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC { @@ -55,30 +59,30 @@ index 033bba5..318b062 100644 +# else +# ifdef __EMSCRIPTEN__ + if (p == nullptr) -+ // Abort here so that when exceptions are disabled, we do not just -+ // return 0 when malloc returns 0. -+ // We could also do this with set_new_handler, but that adds a -+ // global constructor and a table entry, overhead that we can avoid -+ // by doing it this way. -+ abort(); ++ // Abort here so that when exceptions are disabled, we do not just ++ // return 0 when malloc returns 0. ++ // We could also do this with set_new_handler, but that adds a ++ // global constructor and a table entry, overhead that we can avoid ++ // by doing it this way. ++ abort(); +# endif # endif return p; } diff --git a/src/support/runtime/exception_fallback.ipp b/src/support/runtime/exception_fallback.ipp -index 3b2716d..c14c375 100644 +index 18ff4b8..d54a9a5 100644 --- a/src/support/runtime/exception_fallback.ipp +++ b/src/support/runtime/exception_fallback.ipp -@@ -47,6 +47,7 @@ get_terminate() noexcept - return __libcpp_atomic_load(&__terminate_handler); - } +@@ -33,6 +33,7 @@ terminate_handler set_terminate(terminate_handler func) noexcept { + + terminate_handler get_terminate() noexcept { return __libcpp_atomic_load(&__terminate_handler); } +#ifndef __EMSCRIPTEN__ // We provide this in JS - _LIBCPP_NORETURN - void - terminate() noexcept -@@ -69,7 +70,9 @@ terminate() noexcept - } + _LIBCPP_NORETURN void terminate() noexcept { + #ifndef _LIBCPP_HAS_NO_EXCEPTIONS + try { +@@ -49,7 +50,9 @@ _LIBCPP_NORETURN void terminate() noexcept { + } #endif // _LIBCPP_HAS_NO_EXCEPTIONS } +#endif // !__EMSCRIPTEN__ @@ -86,12 +90,12 @@ index 3b2716d..c14c375 100644 +#if !defined(__EMSCRIPTEN__) bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; } - int uncaught_exceptions() noexcept -@@ -78,6 +81,7 @@ int uncaught_exceptions() noexcept + int uncaught_exceptions() noexcept { +@@ -57,6 +60,7 @@ int uncaught_exceptions() noexcept { fprintf(stderr, "uncaught_exceptions not yet implemented\n"); ::abort(); } +#endif // !__EMSCRIPTEN__ + exception::~exception() noexcept {} - exception::~exception() noexcept |
