ENABLE_DEBUG_INFO=1
C_FILES="onyx astnodes builtins checker clone doc entities errors lex parser symres types utils wasm_emit wasm_runtime "
-LIBS="-L$CORE_DIR/lib -l$RUNTIME_LIBRARY -Wl,-rpath=$CORE_DIR/lib:./ -lpthread -ldl -lm -ldyncall_s"
+LIBS="-L$CORE_DIR/lib -l$RUNTIME_LIBRARY -Wl,-rpath=$CORE_DIR/lib:./ -lpthread -ldl -lm -l:libdyncall_s.a"
INCLUDES="-I./include -I../shared/include -I../shared/include/dyncall"
WARNINGS='-Wimplicit -Wmisleading-indentation -Wparentheses -Wsequence-point -Wreturn-type -Wshift-negative-value -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wmaybe-uninitialized -Wsign-compare -Wstrict-overflow -Wduplicated-branches -Wduplicated-cond -Wtrigraphs -Waddress -Wlogical-op'
FLAGS="$FLAGS -DENABLE_DEBUG_INFO"
fi
-FLAGS="$FLAGS -DENABLE_RUN_WITH_WASMER"
+FLAGS="$FLAGS -DENABLE_RUN_WITH_WASMER -DUSE_DYNCALL"
sudo mkdir -p "$BIN_DIR"
#include "onyx_library.h"
#include "dyncall.h"
+#ifdef USE_DYNCALL
+ #include "dyncall.h"
+ static DCCallVM *dcCallVM;
+#endif
+
#ifndef USE_OVM_DEBUGGER
#include "wasmer.h"
#endif
wasm_module_t* wasm_module;
wasm_memory_t* wasm_memory;
-// @Temporary
-static DCCallVM *dcCallVM;
-
OnyxRuntime wasm_runtime;
b32 wasm_name_equals(const wasm_name_t* name1, const wasm_name_t* name2) {
}
+#ifdef USE_DYNCALL
+
typedef struct DynCallContext {
void (*func)();
char types[64];
return wasm_func;
}
+#endif // USE_DYNCALL
+
static void onyx_print_trap(wasm_trap_t* trap) {
wasm_message_t msg;
wasm_trap_message(trap, &msg);
}
}
+#ifdef USE_DYNCALL
if (wasm_name_starts_with(module_name, "dyncall:")) {
wasm_name_t library_name = *module_name;
library_name.data += 8;
import = wasm_func_as_extern(wasm_func);
goto import_found;
}
+#endif
bh_arr_each(WasmFuncDefinition **, library_funcs, linkable_functions) {
WasmFuncDefinition **pcurrent_function = *library_funcs;