bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.97k stars 625 forks source link

WASM module instantiate failed on Mac #3417

Open spino17 opened 6 months ago

spino17 commented 6 months ago

I installed iwasm using the command: brew install wasm-micro-runtime. Then checked iwasm --version which outputted: iwasm 2.0.0. Now I have a main.wasm which I build from a cpp project using wasi-sdk/bin/clang++. When I am trying iwasm main.wasm, it is giving me below error:

[05:07:05:473 - 1ED737AC0]: warning: failed to link import function (env, _Z5hellov)
[05:07:05:497 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc)
[05:07:05:500 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv)
[05:07:05:503 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_)
[05:07:05:505 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev)
[05:07:05:508 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev)
[05:07:05:510 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc)
[05:07:05:512 - 1ED737AC0]: warning: failed to link import function (env, _ZNKSt3__28ios_base6getlocEv)
[05:07:05:514 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__26localeD1Ev)
[05:07:05:536 - 1ED737AC0]: warning: failed to link import function (env, _ZNKSt3__26locale9use_facetERNS0_2idE)
[05:07:05:540 - 1ED737AC0]: warning: failed to link import function (env, _ZNSt3__28ios_base5clearEj)
WASM module instantiate failed: failed to link import global (env, __stack_pointer)
TianlongLiang commented 6 months ago

Do you have a minimum reproducible sample wasm file? I can take a look to see where goes wrong