From: Brendan Hansen Date: Tue, 8 Mar 2022 00:48:31 +0000 (-0600) Subject: preparing to try libiwasm X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=fb04b8f1fafeca8197ffcf8550e222c845ef7003;p=onyx.git preparing to try libiwasm --- diff --git a/build.sh b/build.sh index 73da61e1..147040b7 100755 --- a/build.sh +++ b/build.sh @@ -24,6 +24,7 @@ if [ ! -f "$CORE_DIR/lib/libwasmer.so" ]; then sudo mkdir -p "$CORE_DIR/lib" echo "Copying libwasmer to $CORE_DIR/lib (first install)" + # sudo cp "$WASMER_LIBRARY_DIR/libiwasm.so" "$CORE_DIR/lib/libiwasm.so" sudo cp "$WASMER_LIBRARY_DIR/libwasmer.so" "$CORE_DIR/lib/libwasmer.so" sudo cp "$WASMER_LIBRARY_DIR/libwasmer.a" "$CORE_DIR/lib/libwasmer.a" fi diff --git a/src/wasm_runtime.c b/src/wasm_runtime.c index 979f1fc9..ff295b60 100644 --- a/src/wasm_runtime.c +++ b/src/wasm_runtime.c @@ -11,10 +11,10 @@ #include #include #endif - -#ifndef WASMER_VERSION - #error "Currently, building the Onyx compiler with built-in execution support requires the Wasmer library to be compiled and linked." -#endif +// +// #ifndef WASMER_VERSION +// #error "Currently, building the Onyx compiler with built-in execution support requires the Wasmer library to be compiled and linked." +// #endif static wasm_config_t* wasm_config; static wasm_engine_t* wasm_engine; @@ -215,6 +215,9 @@ b32 onyx_run_wasm(bh_buffer wasm_bytes, int argc, char *argv[]) { bh_arr_new(bh_heap_allocator(), linkable_functions, 4); onyx_lookup_and_load_custom_libraries(wasm_bytes); + // void wasm_runtime_init(); + // wasm_runtime_init(); + wasmer_features_t* features = NULL; wasm_trap_t* run_trap = NULL; @@ -249,6 +252,8 @@ b32 onyx_run_wasm(bh_buffer wasm_bytes, int argc, char *argv[]) { wasm_module_imports(wasm_module, &module_imports); wasm_imports = (wasm_extern_vec_t) WASM_EMPTY_VEC; + // wasm_imports.data = malloc(module_imports.size * 64); + // wasm_imports.size = module_imports.size; wasm_extern_vec_new_uninitialized(&wasm_imports, module_imports.size); // @Free fori (i, 0, (i32) module_imports.size) {