From: Daniel Bevenius Date: Thu, 8 May 2025 14:58:34 +0000 (+0200) Subject: stream.wasm : add HEAPU8 to exported runtime methods (#3130) X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=b6f3fa4059d6108988eaeb104988b949d596aae3;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp stream.wasm : add HEAPU8 to exported runtime methods (#3130) * stream.wasm : add HEAPU8 to exported runtime methods This commit adds HEAPU8 to the list of exported methods for stream.wasm. The motivation for this is that without it HEAPUD8 will be undefined and when its 'buffer' attribute is accessed this will cause error as reported in the referenced issue. Note that to test this make sure that the web browsers caches is cleared first. Resolves: https://github.com/ggml-org/whisper.cpp/issues/3123 * command.wasm : add HEAPU8 to exported runtime methods --- diff --git a/examples/command.wasm/CMakeLists.txt b/examples/command.wasm/CMakeLists.txt index 3117e166..7c2c4293 100644 --- a/examples/command.wasm/CMakeLists.txt +++ b/examples/command.wasm/CMakeLists.txt @@ -36,7 +36,7 @@ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \ -s INITIAL_MEMORY=1024MB \ -s TOTAL_MEMORY=1024MB \ -s FORCE_FILESYSTEM=1 \ - -s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap']\" \ + -s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap', 'HEAPU8']\" \ ${EXTRA_FLAGS} \ ") diff --git a/examples/stream.wasm/CMakeLists.txt b/examples/stream.wasm/CMakeLists.txt index 9774062e..47b0b6b3 100644 --- a/examples/stream.wasm/CMakeLists.txt +++ b/examples/stream.wasm/CMakeLists.txt @@ -35,7 +35,7 @@ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \ -s INITIAL_MEMORY=1024MB \ -s TOTAL_MEMORY=1024MB \ -s FORCE_FILESYSTEM=1 \ - -s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap']\" \ + -s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap', 'HEAPU8']\" \ ${EXTRA_FLAGS} \ ")