-
I want to be able to call functions defined in WASM modules from my native library. However is there a way to achieve above even when I am running my WASM module with iwasm? It would seem like iwasm would run in its own process and memory of the WASM module is not directly accessible to native application running in a different process. Is there any documented way to achieve exporting WASM APIs to native with iwasm? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Just so I understand, you have an exported wasm function, something like:
that you could potentially generate from C: #include <stdio.h>
void foo() {
printf("HELLO\n");
} and compile with /opt/wasi-sdk/bin/clang app.c -o app.wasm -Wl,--export=foo and you'd like to run this particular function from ./iwasm --function foo app.wasm Not sure though if that's what you've asked for. |
Beta Was this translation helpful? Give feedback.
Just so I understand, you have an exported wasm function, something like:
that you could potentially generate from C:
and compile with
and you'd like to run this particular function from
iwasm
? If so, there's a--function
parameter that you could use:Not sure though if that's what you've asked for.