aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs
diff options
context:
space:
mode:
authorvchigrin <vchigrin@yandex-team.com>2025-03-06 20:13:34 +0300
committervchigrin <vchigrin@yandex-team.com>2025-03-06 20:58:07 +0300
commitd24c0a7b912871b026df923c1a685bfff950b1f7 (patch)
tree46a8b3cadab190aefb53dbda2ec011d803a62003 /contrib/libs
parent4b3fb6ff8e1b1b65f1f676016017b00d3fe0607b (diff)
downloadydb-d24c0a7b912871b026df923c1a685bfff950b1f7.tar.gz
feat envoy: Patch libunwind to fix linking errors in standalone WASM binaries in debug mode.
Debug build of cxa_exception.cpp from libcxxabi uses __throw_exception_with_stack_trace function instead of _Unwind_RaiseException. That function was not defined for standalone WSM binaries. commit_hash:2fc1beb522f3a6e63fae895e24c1ef2be1166c51
Diffstat (limited to 'contrib/libs')
-rw-r--r--contrib/libs/libunwind/patches/04-wasm-exceptions.patch8
-rw-r--r--contrib/libs/libunwind/src/Unwind-wasm.c6
2 files changed, 13 insertions, 1 deletions
diff --git a/contrib/libs/libunwind/patches/04-wasm-exceptions.patch b/contrib/libs/libunwind/patches/04-wasm-exceptions.patch
index 167b0a5d783..969f8c32835 100644
--- a/contrib/libs/libunwind/patches/04-wasm-exceptions.patch
+++ b/contrib/libs/libunwind/patches/04-wasm-exceptions.patch
@@ -12,7 +12,7 @@
#include <threads.h>
_Unwind_Reason_Code __gxx_personality_wasm0(int version, _Unwind_Action actions,
-@@ -120,4 +121,12 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context __attribute__((unused)))
+@@ -120,4 +121,18 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context __attribute__((unused)))
return 0;
}
@@ -24,4 +24,10 @@
+_Unwind_RaiseException(_Unwind_Exception *exception_object __attribute__((unused))) {
+ abort();
+}
++
++#if !defined(NDEBUG) && defined(STANDALONE_WASM)
++void __throw_exception_with_stack_trace(_Unwind_Exception* ex) {
++ _Unwind_RaiseException(ex);
++}
++#endif
#endif // defined(__WASM_EXCEPTIONS__)
diff --git a/contrib/libs/libunwind/src/Unwind-wasm.c b/contrib/libs/libunwind/src/Unwind-wasm.c
index f1fa0fd25f0..0442a206e6b 100644
--- a/contrib/libs/libunwind/src/Unwind-wasm.c
+++ b/contrib/libs/libunwind/src/Unwind-wasm.c
@@ -129,4 +129,10 @@ _LIBUNWIND_EXPORT _Unwind_Reason_Code
_Unwind_RaiseException(_Unwind_Exception *exception_object __attribute__((unused))) {
abort();
}
+
+#if !defined(NDEBUG) && defined(STANDALONE_WASM)
+void __throw_exception_with_stack_trace(_Unwind_Exception* ex) {
+ _Unwind_RaiseException(ex);
+}
+#endif
#endif // defined(__WASM_EXCEPTIONS__)