From dd0d71b18fdf5e72085b2fec3eeb9c509bad9be4 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 1 Apr 2019 12:48:13 -0700 Subject: [PATCH] Fix name name mangling of WASI functions in the JS polyfill. Emscripten prefixes C functions with '_', so these functions end up having 3 leading underscores. --- wasmtime-wasi/js-polyfill/wasi.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wasmtime-wasi/js-polyfill/wasi.js b/wasmtime-wasi/js-polyfill/wasi.js index 11dfc82b59..ea11a92e97 100644 --- a/wasmtime-wasi/js-polyfill/wasi.js +++ b/wasmtime-wasi/js-polyfill/wasi.js @@ -452,13 +452,13 @@ proc_raise: function(sig) { random_get: function(buf, buf_len) { let host_buf = _malloc(buf_len); - let ret = __wasi_random_get(host_buf, buf_len); + let ret = ___wasi_random_get(host_buf, buf_len); copyout_bytes(buf, host_buf, buf_len); return ret; }, sched_yield: function() { - return __wasi_sched_yield(); + return ___wasi_sched_yield(); }, sock_recv: function(sock, ri_data, ri_data_len, ri_flags, ro_datalen, ro_flags) { @@ -480,7 +480,7 @@ sock_send: function(sock, si_data, si_data_len, si_flags, so_datalen) { }, sock_shutdown: function(sock, how) { - return __wasi_sock_shutdown(sock, how); + return ___wasi_sock_shutdown(sock, how); } };