From: Brendan Hansen Date: Tue, 5 Jul 2022 14:23:55 +0000 (-0500) Subject: changes for testing debugger X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=1f55e885dca289f822bcee8cec6f840cd19e07d9;p=onyx.git changes for testing debugger --- diff --git a/build.sh b/build.sh index 6a3694fe..68bae2ff 100755 --- a/build.sh +++ b/build.sh @@ -16,6 +16,8 @@ CC='gcc' # The architecture of your system. If your not sure, leave this alone. ARCH="$(uname -m)" +RUNTIME_LIBRARY="wasmer" + # Comment this line if you do not want the Wamser libraries installed, # and do not with to have the Onyx runtime. ENABLE_BUNDLING_WASMER=1 @@ -58,17 +60,18 @@ fi if [ ! -z "$ENABLE_BUNDLING_WASMER" ]; then C_FILES="$C_FILES wasm_runtime" FLAGS="$FLAGS -DENABLE_RUN_WITH_WASMER" - LIBS="$LIBS -L$CORE_DIR/lib -lwasmer -Wl,-rpath=$CORE_DIR/lib:./ -lpthread -ldl" + LIBS="$LIBS -L$CORE_DIR/lib -l$RUNTIME_LIBRARY -Wl,-rpath=$CORE_DIR/lib:./ -lpthread -ldl -lm" INCLUDES="$INCLUDES -I$WASMER_INCLUDE_DIR" - if [ ! -f "$CORE_DIR/lib/libwasmer.so" ]; then - echo "Copying libwasmer to $CORE_DIR/lib (first install)" + if [ ! -f "$CORE_DIR/lib/lib$RUNTIME_LIBRARY.so" ] || true; then + echo "Copying lib$RUNTIME_LIBRARY to $CORE_DIR/lib (first install)" sudo mkdir -p "$CORE_DIR/lib" sudo mkdir -p "$CORE_DIR/include" # 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.so" "$CORE_DIR/lib/libwasmer.so" + sudo cp "$WASMER_LIBRARY_DIR/lib$RUNTIME_LIBRARY.so" "$CORE_DIR/lib/lib$RUNTIME_LIBRARY.so" sudo cp "include/onyx_library.h" "$CORE_DIR/include/onyx_library.h" sudo cp "lib/common/include/wasm.h" "$CORE_DIR/include/wasm.h" diff --git a/core/intrinsics/wasm.onyx b/core/intrinsics/wasm.onyx index 0d2d115d..c33ebf6a 100644 --- a/core/intrinsics/wasm.onyx +++ b/core/intrinsics/wasm.onyx @@ -1,7 +1,7 @@ package core.intrinsics.wasm -memory_size :: () -> i32 #intrinsic --- -memory_grow :: (val: i32) -> i32 #intrinsic --- +memory_size :: () -> u32 #intrinsic --- +memory_grow :: (val: u32) -> i32 #intrinsic --- memory_copy :: (dst: rawptr, src: rawptr, count: i32) -> void #intrinsic --- memory_fill :: (dst: rawptr, byte: u8, count: i32) -> void #intrinsic --- diff --git a/src/wasm_runtime.c b/src/wasm_runtime.c index 28cc229b..88ca522b 100644 --- a/src/wasm_runtime.c +++ b/src/wasm_runtime.c @@ -228,9 +228,6 @@ 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; diff --git a/tests/aoc-2021/day15.onyx b/tests/aoc-2021/day15.onyx index c7c0ed6c..4fc704ab 100644 --- a/tests/aoc-2021/day15.onyx +++ b/tests/aoc-2021/day15.onyx @@ -86,4 +86,4 @@ main :: (args) => { printf("Part 2: {}\n", result); */ } -} \ No newline at end of file +}