Prepare memory 64 support

This commit is contained in:
momo5502
2025-07-09 17:37:03 +02:00
parent 7bf7c2f388
commit adb94f37bd
4 changed files with 18 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ option(MOMO_ENABLE_AVX2 "Enable AVX2 support" ON)
option(MOMO_ENABLE_SANITIZER "Enable sanitizer" OFF)
option(MOMO_ENABLE_CLANG_TIDY "Enable clang-tidy checks" OFF)
option(MOMO_ENABLE_RUST_CODE "Enable code parts written in rust" ON)
option(MOMO_EMSCRIPTEN_MEMORY64 "Enable memory 64 support for emscripten builds" OFF)
option(MOMO_EMSCRIPTEN_SUPPORT_NODEJS "Enable Node.js filesystem for emscripten compilation" OFF)
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the emulator as a shared library (without the samples and tests)" OFF)

View File

@@ -123,12 +123,26 @@ if(CMAKE_SYSTEM_NAME MATCHES "Emscripten")
$<$<CONFIG:Debug>:-sASSERTIONS>
-sWASM_BIGINT
-sUSE_OFFSET_CONVERTER
-sMAXIMUM_MEMORY=4gb
#-sEXCEPTION_CATCHING_ALLOWED=[..]
-sEXIT_RUNTIME
-sASYNCIFY
)
if(MOMO_EMSCRIPTEN_MEMORY64)
momo_add_c_and_cxx_compile_options(
-sMEMORY64
)
add_link_options(
-sMAXIMUM_MEMORY=8gb
-sMEMORY64
)
else()
add_link_options(
-sMAXIMUM_MEMORY=4gb
)
endif()
if(MOMO_EMSCRIPTEN_SUPPORT_NODEJS)
add_link_options(
-lnodefs.js -sNODERAWFS=1

2
deps/unicorn vendored

View File

@@ -33,7 +33,7 @@ namespace debugger
var message = getMessageFromQueue();
if (!message || message.length == 0)
{
return null;
return 0;
}
const length = lengthBytesUTF8(message) + 1;