File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 17
17
set (CMAKE_C_COMPILER /opt/wasi-sdk/bin/clang )
18
18
set (CMAKE_CXX_COMPILER /opt/wasi-sdk/bin/clang++ )
19
19
20
- add_compile_definitions (CATCH_CONFIG_NO_POSIX_SIGNALS CATCH_CONFIG_DISABLE_EXCEPTIONS JSON_HAS_FILESYSTEM=0 )
20
+ add_compile_definitions (CATCH_CONFIG_NO_POSIX_SIGNALS JSON_HAS_FILESYSTEM=0 )
21
21
22
22
include (${CMAKE_CURRENT_LIST_DIR} /cxx20.cmake )
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ find_package(magic_enum REQUIRED)
20
20
# Silkworm Core Tests
21
21
file (GLOB_RECURSE SILKWORM_CORE_TESTS CONFIGURE_DEPENDS "${SILKWORM_MAIN_SRC_DIR} /core/*_test.cpp" )
22
22
if (SILKWORM_WASM_API )
23
+ # Stub clang exception handlers on WASM after Catch2 3.x due to https://github.com/WebAssembly/wasi-sdk/issues/329
23
24
add_executable (core_test "${SILKWORM_MAIN_SRC_DIR} /wasm/exception_handling_stub.cpp" ${SILKWORM_CORE_TESTS} )
24
25
# Skip generation of RPATH linker option for wasm-ld present by default after building Catch2 v3.6.0 from sources
25
26
set_target_properties (core_test PROPERTIES SKIP_BUILD_RPATH TRUE )
Original file line number Diff line number Diff line change 16
16
17
17
#include < cstdlib>
18
18
19
+ // Stubs for clang exception handlers on WASM after upgrading Catch2 to version 3.x
20
+ // This avoids undefined symbols at linking: https://github.com/WebAssembly/wasi-sdk/issues/329
21
+
19
22
extern " C" {
23
+
20
24
void __cxa_allocate_exception () {
21
25
std::abort ();
22
26
}
23
27
24
28
void __cxa_throw () {
25
29
std::abort ();
26
30
}
31
+
27
32
}
You can’t perform that action at this time.
0 commit comments