Open loloRvz opened 3 years ago
would you mind sharing both .wasm file?
In this case there's just one wasm file which includes two functions, sum() and callcallback(). Here is the module written in c, converted to .wasm and compiled to .aot
would you mind trying with iwasm
likes, and past the output here
$ somewhere/iwasm mod.aot
I am currently trying to write a program which can load and execute functions from AoT compiled wasm module using the wasm-c-api. Keeping the wasm modules and their functions simple (e.g int sum(int a,intb){return a+b;} ) my program works perfectly. It's when I do callbacks or use stdlib (eg. printf) that I get the following errors respectively when compiling the module:
For context: I am not running it on Linux, but rather on a SabreLITE 6quad board (armv7a arch) running NuttX. The program is a custom NuttX app I'm writing in C. I pass the precompiled wasm modules (.aot) to my development board and then run the program. I tested this program on my machine using Linux already and it works perfectly.
I realise this is confusing and I am not doing a great job explaining my problem, here's my procedure:
I wrote my wasm module in C (module.c):
I convert it to wasm and then precompile it with wamrc targeting the correct architecture:
I then pass mod.aot to my developement board and run the following app:
I tried debugging this issue for a week now and have gotten nowhere, since gdb doesn't work well with NuttX. Does anybody might know what might cause this problem?