wasm-micro-runtime icon indicating copy to clipboard operation
wasm-micro-runtime copied to clipboard

How can i get an aot file from a wasm file for esp32 family?

Open laldana73 opened this issue 2 years ago • 1 comments

I think is necesary to build wamrc with llvm_xtensa, but when i try ... ./build_llvm_xtensa.sh mkdir build && cd build cmake .. make

throw the following errors.

[ 77%] Building C object CMakeFiles/aotclib.dir/home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm.c.o [ 78%] Building CXX object CMakeFiles/aotclib.dir/home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm_extra.cpp.o /home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm_extra.cpp:297:1: error: ‘LLVMOrcJITTargetMachineBuilderRef’ does not name a type 297 | LLVMOrcJITTargetMachineBuilderRef | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm_extra.cpp:300:1: error: ‘LLVMOrcJITTargetMachineBuilderRef’ does not name a type 300 | LLVMOrcJITTargetMachineBuilderRef | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm_extra.cpp: In function ‘void aot_apply_llvm_new_pass_manager(AOTCompContext*)’: /home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm_extra.cpp:462:60: error: no matching function for call to ‘llvm::PassBuilder::buildLTODefaultPipeline(llvm::PassBuilder::OptimizationLevel&, NULL)’ 462 | MPM.addPass(PB.buildLTODefaultPipeline(OL, NULL)); | ^ In file included from /home/leonardo/wasm-micro-runtime/core/deps/llvm/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h:22, from /home/leonardo/wasm-micro-runtime/core/deps/llvm/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h:22, from /home/leonardo/wasm-micro-runtime/core/deps/llvm/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h:25, from /home/leonardo/wasm-micro-runtime/core/deps/llvm/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:16, from /home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm_extra.cpp:21: /home/leonardo/wasm-micro-runtime/core/deps/llvm/llvm/include/llvm/Passes/PassBuilder.h:442:21: note: candidate: ‘llvm::ModulePassManager llvm::PassBuilder::buildLTODefaultPipeline(llvm::PassBuilder::OptimizationLevel, bool, llvm::ModuleSummaryIndex*)’ 442 | ModulePassManager buildLTODefaultPipeline(OptimizationLevel Level, | ^~~~~~~~~~~~~~~~~~~~~~~ /home/leonardo/wasm-micro-runtime/core/deps/llvm/llvm/include/llvm/Passes/PassBuilder.h:442:21: note: candidate expects 3 arguments, 2 provided make[2]: *** [CMakeFiles/aotclib.dir/build.make:286: CMakeFiles/aotclib.dir/home/leonardo/wasm-micro-runtime/core/iwasm/compilation/aot_llvm_extra.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:194: CMakeFiles/aotclib.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

i am using ubuntu 20-04

laldana73 avatar Apr 20 '22 04:04 laldana73

@laldana73 Thanks for reporting the issue! I submitted PR #1109 to fix it, could you please try again? Thanks.

wenyongh avatar Apr 20 '22 05:04 wenyongh