Skip to content

Commit 58a6a0e

Browse files
committed
remove unnecessary compiler definition
add comments
1 parent a3fdb77 commit 58a6a0e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

cmake/toolchain/wasi.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
set(CMAKE_C_COMPILER /opt/wasi-sdk/bin/clang)
1818
set(CMAKE_CXX_COMPILER /opt/wasi-sdk/bin/clang++)
1919

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)
2121

2222
include(${CMAKE_CURRENT_LIST_DIR}/cxx20.cmake)

cmd/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ find_package(magic_enum REQUIRED)
2020
# Silkworm Core Tests
2121
file(GLOB_RECURSE SILKWORM_CORE_TESTS CONFIGURE_DEPENDS "${SILKWORM_MAIN_SRC_DIR}/core/*_test.cpp")
2222
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
2324
add_executable(core_test "${SILKWORM_MAIN_SRC_DIR}/wasm/exception_handling_stub.cpp" ${SILKWORM_CORE_TESTS})
2425
# Skip generation of RPATH linker option for wasm-ld present by default after building Catch2 v3.6.0 from sources
2526
set_target_properties(core_test PROPERTIES SKIP_BUILD_RPATH TRUE)

silkworm/wasm/exception_handling_stub.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@
1616

1717
#include <cstdlib>
1818

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+
1922
extern "C" {
23+
2024
void __cxa_allocate_exception() {
2125
std::abort();
2226
}
2327

2428
void __cxa_throw() {
2529
std::abort();
2630
}
31+
2732
}

0 commit comments

Comments
 (0)