diff --git a/core/iwasm/common/wasm_c_api.c b/core/iwasm/common/wasm_c_api.c index c41d59ec9..6de885108 100644 --- a/core/iwasm/common/wasm_c_api.c +++ b/core/iwasm/common/wasm_c_api.c @@ -2479,7 +2479,7 @@ wasm_func_call(const wasm_func_t *func, param_count = wasm_func_param_arity(func); result_count = wasm_func_result_arity(func); alloc_count = (param_count > result_count) ? param_count : result_count; - if (alloc_count > sizeof(argv_buf) / sizeof(uint64)) { + if (alloc_count > (size_t)sizeof(argv_buf) / sizeof(uint64)) { if (!(argv = malloc_internal(sizeof(uint64) * alloc_count))) { goto failed; } diff --git a/core/shared/platform/common/posix/posix_thread.c b/core/shared/platform/common/posix/posix_thread.c index 60a13fb61..1544dd200 100644 --- a/core/shared/platform/common/posix/posix_thread.c +++ b/core/shared/platform/common/posix/posix_thread.c @@ -339,8 +339,7 @@ static os_thread_local_attribute uint8 *sigalt_stack_base_addr; #if defined(__clang__) #pragma clang optimize off -#endif -#if defined(__GNUC__) +#elif defined(__GNUC__) #pragma GCC push_options #pragma GCC optimize("O0") __attribute__((no_sanitize_address)) @@ -361,11 +360,10 @@ touch_pages(uint8 *stack_min_addr, uint32 page_size) } return sum; } -#if defined(__GNUC__) -#pragma GCC pop_options -#endif #if defined(__clang__) #pragma clang optimize on +#elif defined(__GNUC__) +#pragma GCC pop_options #endif static bool diff --git a/core/shared/utils/runtime_timer.c b/core/shared/utils/runtime_timer.c index ba495369c..205b92ab9 100644 --- a/core/shared/utils/runtime_timer.c +++ b/core/shared/utils/runtime_timer.c @@ -19,7 +19,7 @@ typedef struct _app_timer { bool is_periodic; } app_timer_t; -typedef struct _timer_ctx { +struct _timer_ctx { app_timer_t *app_timers; app_timer_t *idle_timers; app_timer_t *free_timers; @@ -33,7 +33,7 @@ typedef struct _timer_ctx { timer_callback_f timer_callback; check_timer_expiry_f refresh_checker; -} *timer_ctx_t; +}; uint64 bh_get_tick_ms() diff --git a/wamr-compiler/CMakeLists.txt b/wamr-compiler/CMakeLists.txt index 07a13d45f..ada45cf73 100644 --- a/wamr-compiler/CMakeLists.txt +++ b/wamr-compiler/CMakeLists.txt @@ -50,6 +50,10 @@ if (NOT WAMR_BUILD_TARGET) if (("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32")) set (WAMR_BUILD_TARGET "X86_32") endif() + elseif (WAMR_BUILD_PLATFORM STREQUAL "darwin") + if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64") + set (WAMR_BUILD_TARGET "AARCH64") + endif () endif() endif () @@ -107,17 +111,19 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") endif () # Enable LLVM -set (LLVM_SRC_ROOT "${PROJECT_SOURCE_DIR}/../core/deps/llvm") -if (WAMR_BUILD_PLATFORM STREQUAL "windows") - if (NOT EXISTS "${LLVM_SRC_ROOT}/win32build") - message (FATAL_ERROR "Cannot find LLVM dir: ${LLVM_SRC_ROOT}/win32build") +if (NOT WAMR_BUILD_WITH_CUSTOM_LLVM) + set (LLVM_SRC_ROOT "${PROJECT_SOURCE_DIR}/../core/deps/llvm") + if (WAMR_BUILD_PLATFORM STREQUAL "windows") + if (NOT EXISTS "${LLVM_SRC_ROOT}/win32build") + message (FATAL_ERROR "Cannot find LLVM dir: ${LLVM_SRC_ROOT}/win32build") + endif () + set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/win32build;${CMAKE_PREFIX_PATH}") + else() + if (NOT EXISTS "${LLVM_SRC_ROOT}/build") + message (FATAL_ERROR "Cannot find LLVM dir: ${LLVM_SRC_ROOT}/build") + endif () + set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/build;${CMAKE_PREFIX_PATH}") endif () - set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/win32build;${CMAKE_PREFIX_PATH}") -else() - if (NOT EXISTS "${LLVM_SRC_ROOT}/build") - message (FATAL_ERROR "Cannot find LLVM dir: ${LLVM_SRC_ROOT}/build") - endif () - set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/build;${CMAKE_PREFIX_PATH}") endif () find_package(LLVM REQUIRED CONFIG)