From: Andreu Huguet Date: Tue, 2 Jan 2024 16:50:04 +0000 (+0100) Subject: examples : fix WASM Stack Overflow (#1713) X-Git-Tag: upstream/1.7.4~1187 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=f39f9690ecbd806369e0792b013b6939234d49b4;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp examples : fix WASM Stack Overflow (#1713) Fix for problem: """ RuntimeError: Aborted(Stack overflow! Stack cookie has been overwritten at 0x12be2b10, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x00000000 0x00000000) """ That appears when executing the WASM example with the newer versions. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 801c5cf2..8b338cbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,8 +344,8 @@ else() endif() else() if (EMSCRIPTEN) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -s TOTAL_STACK=5242880") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -s TOTAL_STACK=5242880") else() if(NOT WHISPER_NO_AVX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")