wasm-micro-runtime
wasm-micro-runtime copied to clipboard
What command do you use to generate the the AOT file
I'm using WAMR-1.2.3. How do you generate the WAMR's AOT code found in the test_wasm.h. I have an ESP32-C3, and when I save the wasm file, compile it (wamrc "-o" "sample.aot" --target=riscv32 --target-abi=ilp32 sample.wasm --cpu-features=+i,+m,+c) and then convert it to a C header (using xxd -i but I add __aligned(4)), I cannot free memory (unload wasm module) since it tries to free 0xc, which is outside the heap (I suspect memory corruption somewhere).
When I use the AOT provided, everything works fine.
Does the team have the original command used to generate test_wasm.h?
If need be, I can try uploading the POC header file.
Hi, we usually use the binarydump tool to generate the test_wasm.h:
cd <wamr_root>/test-tools/binarydump-tool
mkdir build && cd build
cmake .. && make
Refer to below for more details: https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/product-mini/app-samples/hello-world/build.sh