-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
The wasm examples under exapmle/seem are written by s-expression(wat). I try to load a wasm file compiled from C but fail to load it.
C source code
#include <stdio.h>
int nonce(int argc, char ** argv)
{
printf("hello text\n");
return 0;
}
emcc 1.c "EXPORTED_FUNCTIONS=['_nonce']" -o 1.wasm
load fail (1c.c refers the exapmle/hello.c and load 1.wasm)
#0 0x55e0cec40ba4 in wasm::Instance::make(wasm::Store*, wasm::Module const*, wasm::Extern const* const*) src/wasm-v8.cc:2147
#1 0x55e0cec415ef in wasm_instance_new src/wasm-c.cc:1008
#2 0x55e0cec038da in main /root/v8/wasm-c-api/1c.c:46
#3 0x7f8559348b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#4 0x55e0cec03579 in _start (/root/v8/wasm-c-api/1-c+0x9f579)
I follow the source wasm::Instance::make code and find the wasm file (1.wasm) compiled from C needs a lot of import even the C source is just a simple function.
Is there such a possibility to load a wasm file compiled from C/C++ whose functions (glibc functions or the custom functions) are defined at the host env ?
For me, I just want some dangerous logic run in virtual machine(V8) for not populating the host env but this logic code may use the function(symbol) from the host env.
Metadata
Metadata
Assignees
Labels
No labels