Stream: general

Topic: WAMR compiled for the web with Emscripten


view this post on Zulip Jordan Werthman (Aug 12 2025 at 23:31):

I am working on a small hobby project which intends to run WAMR on an ESP32 exposing a small set of custom native functions for applications to work with on the ESP32. I would also like to build a small web front-end to demo applications and test... to that end I was hoping to build the exact same runtime (WAMR) on both the ESP32 and for the Web (using Emscripten) with the same native functions wired up in both environments. Cross-compiling to Emscripten does not work out of the box but #if 0/#endif out the contents of platform_wasi_types.h and selecting WAMR_BUILD_INVOKE_NATIVE_GENERAL in CMake does make everything compile.. unfortunately it does not work when run.

I suspect that the general invokeNative does not work for Emscripten but am at a bit of a loss on how I could make it work with the JS runtime... any advice would be greatly appreciated. I have experience with embedded systems but not much with WASM.

P.S. I am only trying to run in interpreted mode right now.


Last updated: Dec 06 2025 at 05:03 UTC