From: Daniel Bevenius Date: Sun, 20 Apr 2025 17:40:25 +0000 (+0200) Subject: examples : add HEAPU8 to exported runtime methods (#3062) X-Git-Tag: upstream/1.7.5+105~80 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3a88f1e50405417ad4272c576b0081075ed6d0ef;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp examples : add HEAPU8 to exported runtime methods (#3062) This commit adds `HEAPU8` to the list of exported methods. The motivation for this commit is that currently this is causing an error on Window systems where HEAPU8 in undefined, which results in the following error message in the web console: ```console main.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'buffer') at __emval_get_property (main.js:1:1363125) at 003a453a:0xc4a47 at 003a453a:0xc51cd at Object.full_default (eval at craftInvokerFunction (main.js:1:1347011), :9:10) at whisper.cpp/:647:42 ``` Resolves: https://github.com/ggml-org/whisper.cpp/issues/3059 --- diff --git a/examples/whisper.wasm/CMakeLists.txt b/examples/whisper.wasm/CMakeLists.txt index 10e503fd..00d19c68 100644 --- a/examples/whisper.wasm/CMakeLists.txt +++ b/examples/whisper.wasm/CMakeLists.txt @@ -36,7 +36,7 @@ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \ -s MAXIMUM_MEMORY=2000MB \ -s ALLOW_MEMORY_GROWTH=1 \ -s FORCE_FILESYSTEM=1 \ - -s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap']\" \ + -s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap', 'HEAPU8']\" \ ${EXTRA_FLAGS} \ ")