From: Brendan Hansen Date: Sun, 3 Dec 2023 22:53:48 +0000 (-0600) Subject: removed: incorrect magic bytes when runtime is `onyx` X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=eccc564f229b7250e2bcff3c9b4335de7761fe41;p=onyx.git removed: incorrect magic bytes when runtime is `onyx` --- diff --git a/compiler/src/wasm_output.h b/compiler/src/wasm_output.h index a849939e..ee5273ae 100644 --- a/compiler/src/wasm_output.h +++ b/compiler/src/wasm_output.h @@ -21,7 +21,6 @@ typedef i32 vector_func(void*, bh_buffer*); -static const u8 ONYX_MAGIC_STRING[] = "ONYX"; static const u8 WASM_MAGIC_STRING[] = { 0x00, 0x61, 0x73, 0x6D }; static const u8 WASM_VERSION[] = { 0x01, 0x00, 0x00, 0x00 }; @@ -1082,11 +1081,7 @@ static i32 output_ovm_debug_sections(OnyxWasmModule* module, bh_buffer* buff) { void onyx_wasm_module_write_to_buffer(OnyxWasmModule* module, bh_buffer* buffer) { bh_buffer_init(buffer, global_heap_allocator, 128); - if (context.options->runtime == Runtime_Onyx) { - bh_buffer_append(buffer, ONYX_MAGIC_STRING, 4); - } else { - bh_buffer_append(buffer, WASM_MAGIC_STRING, 4); - } + bh_buffer_append(buffer, WASM_MAGIC_STRING, 4); bh_buffer_append(buffer, WASM_VERSION, 4); #ifdef ENABLE_DEBUG_INFO diff --git a/compiler/src/wasm_runtime.c b/compiler/src/wasm_runtime.c index dc3f491e..a5038330 100644 --- a/compiler/src/wasm_runtime.c +++ b/compiler/src/wasm_runtime.c @@ -604,16 +604,6 @@ void onyx_run_initialize(b32 debug_enabled) { b32 onyx_run_wasm(bh_buffer wasm_bytes, int argc, char *argv[]) { runtime = &wasm_runtime; - - if (strncmp(wasm_bytes.data, "ONYX", 4)) { - printf("Bad magic bytes for Onyx binary.\n"); - return 0; - } - - wasm_bytes.data[0] = '\0'; - wasm_bytes.data[1] = 'a'; - wasm_bytes.data[2] = 's'; - wasm_bytes.data[3] = 'm'; wasm_raw_bytes = wasm_bytes; bh_arr(WasmFuncDefinition **) linkable_functions = NULL; diff --git a/settings.sh b/settings.sh index d203f020..b4307b7b 100644 --- a/settings.sh +++ b/settings.sh @@ -8,8 +8,8 @@ export ONYX_CC='gcc' # The architecture of your system. If your not sure, leave this alone. export ONYX_ARCH="$(uname | tr '[:upper:]' '[:lower:]')_$(uname -m)" -export ONYX_RUNTIME_LIBRARY="ovmwasm" -# export ONYX_RUNTIME_LIBRARY="wasmer" +# export ONYX_RUNTIME_LIBRARY="ovmwasm" +export ONYX_RUNTIME_LIBRARY="wasmer" # Enable Dynamic call export ONYX_USE_DYNCALL=1