diff options
author | thegeorg <thegeorg@yandex-team.com> | 2025-01-17 19:56:24 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2025-01-17 21:13:11 +0300 |
commit | 6dd49974b4e1bac699c68922f109876f98afc655 (patch) | |
tree | f33b4fd6c2d0abd01fd489a43bd1ea14d7c34b07 /contrib | |
parent | 25f2cba9762d208eaa6283429ce74be5f212a0c9 (diff) | |
download | ydb-6dd49974b4e1bac699c68922f109876f98afc655.tar.gz |
Revert more NOEXCEPT patches following emscripten upstream
This continues the cleanup started in rXXXXXX and follows the changes revert in emscripten upstream, see [PR #20170](https://github.com/emscripten-core/emscripten/pull/20170).
commit_hash:5e0d13c167c177e2af71371d6bb0cf565a1066a0
Diffstat (limited to 'contrib')
3 files changed, 7 insertions, 253 deletions
diff --git a/contrib/libs/cxxsupp/libcxxabi/include/cxxabi.h b/contrib/libs/cxxsupp/libcxxabi/include/cxxabi.h index b91e4a804c..292bac3b32 100644 --- a/contrib/libs/cxxsupp/libcxxabi/include/cxxabi.h +++ b/contrib/libs/cxxsupp/libcxxabi/include/cxxabi.h @@ -154,36 +154,17 @@ extern _LIBCXXABI_FUNC_VIS char *__cxa_demangle(const char *mangled_name, // Apple additions to support C++ 0x exception_ptr class // These are primitives to wrap a smart pointer around an exception object -#ifndef __EMSCRIPTEN__ extern _LIBCXXABI_FUNC_VIS void *__cxa_current_primary_exception() throw(); -#else -extern _LIBCXXABI_FUNC_VIS void *__cxa_current_primary_exception() _NOEXCEPT; -#endif extern _LIBCXXABI_FUNC_VIS void __cxa_rethrow_primary_exception(void *primary_exception); -#ifndef __EMSCRIPTEN__ extern _LIBCXXABI_FUNC_VIS void __cxa_increment_exception_refcount(void *primary_exception) throw(); -#else -extern _LIBCXXABI_FUNC_VIS void -__cxa_increment_exception_refcount(void *primary_exception) _NOEXCEPT; -#endif -#ifndef __EMSCRIPTEN__ extern _LIBCXXABI_FUNC_VIS void __cxa_decrement_exception_refcount(void *primary_exception) throw(); -#else -extern _LIBCXXABI_FUNC_VIS void -__cxa_decrement_exception_refcount(void *primary_exception) _NOEXCEPT; -#endif // Apple extension to support std::uncaught_exception() -#ifndef __EMSCRIPTEN__ extern _LIBCXXABI_FUNC_VIS bool __cxa_uncaught_exception() throw(); extern _LIBCXXABI_FUNC_VIS unsigned int __cxa_uncaught_exceptions() throw(); -#else -extern _LIBCXXABI_FUNC_VIS bool __cxa_uncaught_exception() _NOEXCEPT; -extern _LIBCXXABI_FUNC_VIS unsigned int __cxa_uncaught_exceptions() _NOEXCEPT; -#endif #if defined(__linux__) || defined(__Fuchsia__) // Linux and Fuchsia TLS support. Not yet an official part of the Itanium ABI. diff --git a/contrib/libs/cxxsupp/libcxxabi/patches/01-commit-e0e82fc-initial.patch b/contrib/libs/cxxsupp/libcxxabi/patches/01-commit-e0e82fc-initial.patch index 17801a86d3..aa2fe9e33d 100644 --- a/contrib/libs/cxxsupp/libcxxabi/patches/01-commit-e0e82fc-initial.patch +++ b/contrib/libs/cxxsupp/libcxxabi/patches/01-commit-e0e82fc-initial.patch @@ -17,43 +17,6 @@ diff --git a/include/cxxabi.h b/include/cxxabi.h __cxa_throw(void *thrown_exception, std::type_info *tinfo, void (_LIBCXXABI_DTOR_FUNC *dest)(void *)); +#endif -@@ -148,17 +171,36 @@ extern _LIBCXXABI_FUNC_VIS char *__cxa_demangle(const char *mangled_name, - - // Apple additions to support C++ 0x exception_ptr class - // These are primitives to wrap a smart pointer around an exception object -+#ifndef __EMSCRIPTEN__ - extern _LIBCXXABI_FUNC_VIS void *__cxa_current_primary_exception() throw(); -+#else -+extern _LIBCXXABI_FUNC_VIS void *__cxa_current_primary_exception() _NOEXCEPT; -+#endif - extern _LIBCXXABI_FUNC_VIS void - __cxa_rethrow_primary_exception(void *primary_exception); -+#ifndef __EMSCRIPTEN__ - extern _LIBCXXABI_FUNC_VIS void - __cxa_increment_exception_refcount(void *primary_exception) throw(); -+#else -+extern _LIBCXXABI_FUNC_VIS void -+__cxa_increment_exception_refcount(void *primary_exception) _NOEXCEPT; -+#endif -+#ifndef __EMSCRIPTEN__ - extern _LIBCXXABI_FUNC_VIS void - __cxa_decrement_exception_refcount(void *primary_exception) throw(); -+#else -+extern _LIBCXXABI_FUNC_VIS void -+__cxa_decrement_exception_refcount(void *primary_exception) _NOEXCEPT; -+#endif - - // Apple extension to support std::uncaught_exception() -+#ifndef __EMSCRIPTEN__ - extern _LIBCXXABI_FUNC_VIS bool __cxa_uncaught_exception() throw(); - extern _LIBCXXABI_FUNC_VIS unsigned int __cxa_uncaught_exceptions() throw(); -+#else -+extern _LIBCXXABI_FUNC_VIS bool __cxa_uncaught_exception() _NOEXCEPT; -+extern _LIBCXXABI_FUNC_VIS unsigned int __cxa_uncaught_exceptions() _NOEXCEPT; -+#endif - - #if defined(__linux__) || defined(__Fuchsia__) - // Linux and Fuchsia TLS support. Not yet an official part of the Itanium ABI. diff --git a/src/abort_message.cpp b/src/abort_message.cpp --- a/src/abort_message.cpp +++ b/src/abort_message.cpp @@ -82,34 +45,6 @@ diff --git a/src/abort_message.cpp b/src/abort_message.cpp diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp --- a/src/cxa_exception.cpp +++ b/src/cxa_exception.cpp -@@ -180,7 +180,12 @@ extern "C" { - // object. Zero-fill the object. If memory can't be allocated, call - // std::terminate. Return a pointer to the memory to be used for the - // user's exception object. --void *__cxa_allocate_exception(size_t thrown_size) throw() { -+#ifndef __EMSCRIPTEN__ -+void *__cxa_allocate_exception(size_t thrown_size) throw() -+#else -+void *__cxa_allocate_exception(size_t thrown_size) _NOEXCEPT -+#endif -+{ - size_t actual_size = cxa_exception_size_from_exception_thrown_size(thrown_size); - - // Allocate extra space before the __cxa_exception header to ensure the -@@ -198,7 +203,12 @@ void *__cxa_allocate_exception(size_t thrown_size) throw() { - - - // Free a __cxa_exception object allocated with __cxa_allocate_exception. --void __cxa_free_exception(void *thrown_object) throw() { -+#ifndef __EMSCRIPTEN__ -+void __cxa_free_exception(void *thrown_object) throw() -+#else -+void __cxa_free_exception(void *thrown_object) _NOEXCEPT -+#endif -+{ - // Compute the size of the padding before the header. - size_t header_offset = get_cxa_exception_offset(); - char *raw_buffer = @@ -254,7 +264,13 @@ will call terminate, assuming that there was no handler for the exception. */ @@ -125,116 +60,6 @@ diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp __cxa_eh_globals *globals = __cxa_get_globals(); __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); -@@ -292,7 +308,12 @@ The adjusted pointer is computed by the personality routine during phase 1 - - Requires: exception is native - */ --void *__cxa_get_exception_ptr(void *unwind_exception) throw() { -+#ifndef __EMSCRIPTEN__ -+void *__cxa_get_exception_ptr(void *unwind_exception) throw() -+#else -+void *__cxa_get_exception_ptr(void *unwind_exception) _NOEXCEPT -+#endif -+{ - #if defined(_LIBCXXABI_ARM_EHABI) - return reinterpret_cast<void*>( - static_cast<_Unwind_Control_Block*>(unwind_exception)->barrier_cache.bitpattern[0]); -@@ -307,7 +328,12 @@ void *__cxa_get_exception_ptr(void *unwind_exception) throw() { - The routine to be called before the cleanup. This will save __cxa_exception in - __cxa_eh_globals, so that __cxa_end_cleanup() can recover later. - */ --bool __cxa_begin_cleanup(void *unwind_arg) throw() { -+#ifndef __EMSCRIPTEN__ -+bool __cxa_begin_cleanup(void *unwind_arg) throw() -+#else -+bool __cxa_begin_cleanup(void *unwind_arg) _NOEXCEPT -+#endif -+{ - _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg); - __cxa_eh_globals* globals = __cxa_get_globals(); - __cxa_exception* exception_header = -@@ -430,8 +456,13 @@ to terminate or unexpected during unwinding. - * If we haven't terminated, assume the exception object is just past the - _Unwind_Exception and return a pointer to that. - */ -+#ifndef __EMSCRIPTEN__ - void* - __cxa_begin_catch(void* unwind_arg) throw() -+#else -+void* -+__cxa_begin_catch(void* unwind_arg) _NOEXCEPT -+#endif - { - _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg); - bool native_exception = __isOurExceptionClass(unwind_exception); -@@ -646,8 +677,14 @@ void __cxa_rethrow() { - - Requires: If thrown_object is not NULL, it is a native exception. - */ -+#ifndef __EMSCRIPTEN__ - void --__cxa_increment_exception_refcount(void *thrown_object) throw() { -+__cxa_increment_exception_refcount(void *thrown_object) throw() -+#else -+void -+__cxa_increment_exception_refcount(void *thrown_object) _NOEXCEPT -+#endif -+{ - if (thrown_object != NULL ) - { - __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); -@@ -663,8 +700,14 @@ __cxa_increment_exception_refcount(void *thrown_object) throw() { - - Requires: If thrown_object is not NULL, it is a native exception. - */ -+#ifndef __EMSCRIPTEN__ - _LIBCXXABI_NO_CFI --void __cxa_decrement_exception_refcount(void *thrown_object) throw() { -+void __cxa_decrement_exception_refcount(void *thrown_object) throw() -+#else -+_LIBCXXABI_NO_CFI -+void __cxa_decrement_exception_refcount(void *thrown_object) _NOEXCEPT -+#endif -+{ - if (thrown_object != NULL ) - { - __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); -@@ -687,7 +730,12 @@ void __cxa_decrement_exception_refcount(void *thrown_object) throw() { - been no exceptions thrown, ever, on this thread, we can return NULL without - the need to allocate the exception-handling globals. - */ --void *__cxa_current_primary_exception() throw() { -+#ifndef __EMSCRIPTEN__ -+void *__cxa_current_primary_exception() throw() -+#else -+void *__cxa_current_primary_exception() _NOEXCEPT -+#endif -+{ - // get the current exception - __cxa_eh_globals* globals = __cxa_get_globals_fast(); - if (NULL == globals) -@@ -758,11 +806,21 @@ __cxa_rethrow_primary_exception(void* thrown_object) - // If we return client will call terminate() - } - -+#ifndef __EMSCRIPTEN__ - bool - __cxa_uncaught_exception() throw() { return __cxa_uncaught_exceptions() != 0; } -+#else -+bool -+__cxa_uncaught_exception() _NOEXCEPT { return __cxa_uncaught_exceptions() != 0; } -+#endif - -+#ifndef __EMSCRIPTEN__ - unsigned int - __cxa_uncaught_exceptions() throw() -+#else -+unsigned int -+__cxa_uncaught_exceptions() _NOEXCEPT -+#endif - { - // This does not report foreign exceptions in flight - __cxa_eh_globals* globals = __cxa_get_globals_fast(); diff --git a/src/cxa_exception.h b/src/cxa_exception.h --- a/src/cxa_exception.h +++ b/src/cxa_exception.h diff --git a/contrib/libs/cxxsupp/libcxxabi/src/cxa_exception.cpp b/contrib/libs/cxxsupp/libcxxabi/src/cxa_exception.cpp index 6c6732b9cf..19c333d9c0 100644 --- a/contrib/libs/cxxsupp/libcxxabi/src/cxa_exception.cpp +++ b/contrib/libs/cxxsupp/libcxxabi/src/cxa_exception.cpp @@ -180,12 +180,7 @@ extern "C" { // object. Zero-fill the object. If memory can't be allocated, call // std::terminate. Return a pointer to the memory to be used for the // user's exception object. -#ifndef __EMSCRIPTEN__ -void *__cxa_allocate_exception(size_t thrown_size) throw() -#else -void *__cxa_allocate_exception(size_t thrown_size) _NOEXCEPT -#endif -{ +void *__cxa_allocate_exception(size_t thrown_size) throw() { size_t actual_size = cxa_exception_size_from_exception_thrown_size(thrown_size); // Allocate extra space before the __cxa_exception header to ensure the @@ -203,12 +198,7 @@ void *__cxa_allocate_exception(size_t thrown_size) _NOEXCEPT // Free a __cxa_exception object allocated with __cxa_allocate_exception. -#ifndef __EMSCRIPTEN__ -void __cxa_free_exception(void *thrown_object) throw() -#else -void __cxa_free_exception(void *thrown_object) _NOEXCEPT -#endif -{ +void __cxa_free_exception(void *thrown_object) throw() { // Compute the size of the padding before the header. size_t header_offset = get_cxa_exception_offset(); char *raw_buffer = @@ -331,12 +321,7 @@ The adjusted pointer is computed by the personality routine during phase 1 Requires: exception is native */ -#ifndef __EMSCRIPTEN__ -void *__cxa_get_exception_ptr(void *unwind_exception) throw() -#else -void *__cxa_get_exception_ptr(void *unwind_exception) _NOEXCEPT -#endif -{ +void *__cxa_get_exception_ptr(void *unwind_exception) throw() { #if defined(_LIBCXXABI_ARM_EHABI) return reinterpret_cast<void*>( static_cast<_Unwind_Control_Block*>(unwind_exception)->barrier_cache.bitpattern[0]); @@ -351,12 +336,7 @@ void *__cxa_get_exception_ptr(void *unwind_exception) _NOEXCEPT The routine to be called before the cleanup. This will save __cxa_exception in __cxa_eh_globals, so that __cxa_end_cleanup() can recover later. */ -#ifndef __EMSCRIPTEN__ -bool __cxa_begin_cleanup(void *unwind_arg) throw() -#else -bool __cxa_begin_cleanup(void *unwind_arg) _NOEXCEPT -#endif -{ +bool __cxa_begin_cleanup(void *unwind_arg) throw() { _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg); __cxa_eh_globals* globals = __cxa_get_globals(); __cxa_exception* exception_header = @@ -479,13 +459,8 @@ to terminate or unexpected during unwinding. * If we haven't terminated, assume the exception object is just past the _Unwind_Exception and return a pointer to that. */ -#ifndef __EMSCRIPTEN__ void* __cxa_begin_catch(void* unwind_arg) throw() -#else -void* -__cxa_begin_catch(void* unwind_arg) _NOEXCEPT -#endif { _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg); bool native_exception = __isOurExceptionClass(unwind_exception); @@ -700,14 +675,8 @@ void __cxa_rethrow() { Requires: If thrown_object is not NULL, it is a native exception. */ -#ifndef __EMSCRIPTEN__ -void -__cxa_increment_exception_refcount(void *thrown_object) throw() -#else void -__cxa_increment_exception_refcount(void *thrown_object) _NOEXCEPT -#endif -{ +__cxa_increment_exception_refcount(void *thrown_object) throw() { if (thrown_object != NULL ) { __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); @@ -723,14 +692,8 @@ __cxa_increment_exception_refcount(void *thrown_object) _NOEXCEPT Requires: If thrown_object is not NULL, it is a native exception. */ -#ifndef __EMSCRIPTEN__ -_LIBCXXABI_NO_CFI -void __cxa_decrement_exception_refcount(void *thrown_object) throw() -#else _LIBCXXABI_NO_CFI -void __cxa_decrement_exception_refcount(void *thrown_object) _NOEXCEPT -#endif -{ +void __cxa_decrement_exception_refcount(void *thrown_object) throw() { if (thrown_object != NULL ) { __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); @@ -753,12 +716,7 @@ void __cxa_decrement_exception_refcount(void *thrown_object) _NOEXCEPT been no exceptions thrown, ever, on this thread, we can return NULL without the need to allocate the exception-handling globals. */ -#ifndef __EMSCRIPTEN__ -void *__cxa_current_primary_exception() throw() -#else -void *__cxa_current_primary_exception() _NOEXCEPT -#endif -{ +void *__cxa_current_primary_exception() throw() { // get the current exception __cxa_eh_globals* globals = __cxa_get_globals_fast(); if (NULL == globals) @@ -829,21 +787,11 @@ __cxa_rethrow_primary_exception(void* thrown_object) // If we return client will call terminate() } -#ifndef __EMSCRIPTEN__ bool __cxa_uncaught_exception() throw() { return __cxa_uncaught_exceptions() != 0; } -#else -bool -__cxa_uncaught_exception() _NOEXCEPT { return __cxa_uncaught_exceptions() != 0; } -#endif -#ifndef __EMSCRIPTEN__ unsigned int __cxa_uncaught_exceptions() throw() -#else -unsigned int -__cxa_uncaught_exceptions() _NOEXCEPT -#endif { // This does not report foreign exceptions in flight __cxa_eh_globals* globals = __cxa_get_globals_fast(); |