Skip to content

Commit 3981749

Browse files
committed
wasi compilation fixed
1 parent ddf32ad commit 3981749

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

CMakeLists.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ if(NOT DEFINED SNMALLOC_ONLY_HEADER_LIBRARY)
189189
endif()
190190
if(SNMALLOC_CI_BUILD OR (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
191191
# Get better stack traces in CI and Debug.
192-
target_link_libraries(snmalloc_lib INTERFACE "-rdynamic")
192+
# target_link_libraries(snmalloc_lib INTERFACE "-rdynamic") #not supported in wasi
193193
endif()
194194

195195
if(SNMALLOC_OPTIMISE_FOR_CURRENT_MACHINE)
@@ -254,14 +254,6 @@ if(NOT DEFINED SNMALLOC_ONLY_HEADER_LIBRARY)
254254
SNMALLOC_STATIC_LIBRARY_PREFIX=${SNMALLOC_STATIC_LIBRARY_PREFIX})
255255
endif ()
256256

257-
if(NOT WIN32)
258-
set(SHARED_FILES src/override/new.cc src/override/malloc.cc)
259-
add_shim(snmallocshim SHARED ${SHARED_FILES})
260-
add_shim(snmallocshim-1mib SHARED ${SHARED_FILES})
261-
target_compile_definitions(snmallocshim-1mib PRIVATE IS_ADDRESS_SPACE_CONSTRAINED)
262-
# Build a shim with some settings from oe.
263-
add_shim(snmallocshim-oe SHARED ${SHARED_FILES})
264-
endif()
265257

266258

267259
endif()

src/pal/pal_wasi.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <array>
88
#ifdef WASM_ENV //wasi-libc/libc-bottom-half/headers/public/__header_*
99
extern "C" void *memset(void *dst, int c, size_t n);
10-
extern "C" [[noreturn]] void abort();
10+
extern "C" [[noreturn]] void w_abort();
1111

1212
// this pal uses wasi libc bottom half & wasm linear memory (wlm)
1313
namespace snmalloc
@@ -45,7 +45,7 @@ namespace snmalloc
4545
[[noreturn]] static void error(const char* const str)
4646
{
4747
UNUSED(str);
48-
abort();
48+
w_abort();
4949
}
5050

5151
static std::pair<void*, size_t>

0 commit comments

Comments
 (0)