From 6b938bfcc4c9b1d8c1b627c73cacda45b2be512d Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Sat, 27 Feb 2021 23:15:46 +0200 Subject: [PATCH] Cleanup --- CMakeLists.txt | 4 ++++ platforms/wm_w600/Makefile | 3 ++- platforms/wm_w600/main.c | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c75c102..42a902f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,10 @@ elseif(WASIENV) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Dd_m3HasTracer") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -Wfatal-errors -fomit-frame-pointer -fno-stack-check -fno-stack-protector") + if(WASM_EXT) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mbulk-memory -mnontrapping-fptoint -msign-ext -mtail-call") + endif() + # TODO: LTO breaks wasm imports currently: # https://www.mail-archive.com/llvm-bugs@lists.llvm.org/msg36273.html diff --git a/platforms/wm_w600/Makefile b/platforms/wm_w600/Makefile index aa6bf31..5218513 100644 --- a/platforms/wm_w600/Makefile +++ b/platforms/wm_w600/Makefile @@ -90,7 +90,8 @@ endif # for a subtree within the makefile rooted therein # -DEFINES = -DWM_W600 -Os -flto -Wfatal-errors +DEFINES = -DWM_W600 -Os -flto -Wfatal-errors \ + -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers # -Dd_m3FixedHeap=8192 # -fno-optimize-sibling-calls diff --git a/platforms/wm_w600/main.c b/platforms/wm_w600/main.c index 3bb444b..299833c 100644 --- a/platforms/wm_w600/main.c +++ b/platforms/wm_w600/main.c @@ -52,7 +52,7 @@ void run_wasm() result = m3_GetResultsV (f, &value); if (result) FATAL("m3_GetResults: %s", result); - printf("Result: %lld\n", value); + printf("Result: %ld\n", value); } @@ -65,9 +65,9 @@ void wasm3_task(void *data) { printf("\nWasm3 v" M3_VERSION " on W600, build " __DATE__ " " __TIME__ "\n"); - u32 start = millis(); + uint32_t start = millis(); run_wasm(); - u32 end = millis(); + uint32_t end = millis(); printf("Elapsed: %ld ms\n", (end - start)); }