mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 06:55:07 +00:00
Enable to build wamrc with custom llvm and fix some compile warnings (#672)
Enable to build wamrc with custom llvm, enable to auto detect processor on apple silicon, and fix some compile warnings. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
parent
28f104036c
commit
586752735b
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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,6 +111,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||
endif ()
|
||||
|
||||
# Enable LLVM
|
||||
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")
|
||||
|
@ -119,6 +124,7 @@ else()
|
|||
endif ()
|
||||
set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/build;${CMAKE_PREFIX_PATH}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
find_package(LLVM REQUIRED CONFIG)
|
||||
include_directories(${LLVM_INCLUDE_DIRS})
|
||||
|
|
Loading…
Reference in New Issue
Block a user