aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs
diff options
context:
space:
mode:
authordtorilov <dtorilov@yandex-team.com>2024-03-01 20:44:35 +0300
committerdtorilov <dtorilov@yandex-team.com>2024-03-01 20:56:21 +0300
commitede142833218a848ec5b75819111cff6fc0bc9ca (patch)
tree3a0f1837b5e3819eec3d27c8623843f037fe47fd /contrib/libs
parente3bebc56da615c637dc555747e3f407b6084e393 (diff)
downloadydb-ede142833218a848ec5b75819111cff6fc0bc9ca.tar.gz
WebAssembly support in libunwind
1a4e03374077d0d5405dba1555d2c409f2d115f9
Diffstat (limited to 'contrib/libs')
-rw-r--r--contrib/libs/libunwind/src/Unwind-wasm.c6
-rw-r--r--contrib/libs/libunwind/ya.make39
2 files changed, 30 insertions, 15 deletions
diff --git a/contrib/libs/libunwind/src/Unwind-wasm.c b/contrib/libs/libunwind/src/Unwind-wasm.c
index f7f39d38b5..f1e8a04b80 100644
--- a/contrib/libs/libunwind/src/Unwind-wasm.c
+++ b/contrib/libs/libunwind/src/Unwind-wasm.c
@@ -102,8 +102,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
}
/// Not used in Wasm.
-_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
- uintptr_t value) {}
+_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context __attribute__((unused)),
+ uintptr_t value __attribute__((unused))) {}
/// Called by personality handler to get LSDA for current frame.
_LIBUNWIND_EXPORT uintptr_t
@@ -116,7 +116,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
/// Not used in Wasm.
_LIBUNWIND_EXPORT uintptr_t
-_Unwind_GetRegionStart(struct _Unwind_Context *context) {
+_Unwind_GetRegionStart(struct _Unwind_Context *context __attribute__((unused))) {
return 0;
}
diff --git a/contrib/libs/libunwind/ya.make b/contrib/libs/libunwind/ya.make
index b763d587fa..e21c1bab9d 100644
--- a/contrib/libs/libunwind/ya.make
+++ b/contrib/libs/libunwind/ya.make
@@ -35,7 +35,6 @@ NO_SANITIZE_COVERAGE()
CFLAGS(
GLOBAL -D_libunwind_
- -D_LIBUNWIND_IS_NATIVE_ONLY
-fno-exceptions
-fno-rtti
-funwind-tables
@@ -47,16 +46,32 @@ IF (SANITIZER_TYPE == memory)
)
ENDIF()
-SRCS(
- src/Unwind-EHABI.cpp
- src/Unwind-seh.cpp
- src/Unwind-sjlj.c
- src/Unwind-wasm.c
- src/UnwindLevel1-gcc-ext.c
- src/UnwindLevel1.c
- src/UnwindRegistersRestore.S
- src/UnwindRegistersSave.S
- src/libunwind.cpp
-)
+IF (NOT OS_EMSCRIPTEN)
+ CFLAGS(
+ -D_LIBUNWIND_IS_NATIVE_ONLY
+ )
+ SRCS(
+ src/Unwind-EHABI.cpp
+ src/Unwind-seh.cpp
+ src/Unwind-sjlj.c
+ src/Unwind-wasm.c
+ src/UnwindLevel1-gcc-ext.c
+ src/UnwindLevel1.c
+ src/UnwindRegistersRestore.S
+ src/UnwindRegistersSave.S
+ src/libunwind.cpp
+ )
+ELSEIF (OS_EMSCRIPTEN)
+ PEERDIR(
+ contrib/restricted/emscripten/include
+ )
+ CFLAGS(
+ -D__USING_WASM_EXCEPTIONS__
+ -D_LIBUNWIND_HIDE_SYMBOLS
+ )
+ SRCS(
+ src/Unwind-wasm.c
+ )
+ENDIF()
END()