diff --git a/build-scripts/build_llvm.py b/build-scripts/build_llvm.py index e48f4e25..a4b92b05 100755 --- a/build-scripts/build_llvm.py +++ b/build-scripts/build_llvm.py @@ -55,8 +55,6 @@ def build_llvm(llvm_dir, platform, backends, projects, use_clang=False, extra_fl "-DLLVM_APPEND_VC_REV:BOOL=ON", "-DLLVM_BUILD_EXAMPLES:BOOL=OFF", "-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF", - "-DLLVM_BUILD_TESTS:BOOL=OFF", - "-DLLVM_CCACHE_BUILD:BOOL=ON", "-DLLVM_ENABLE_BINDINGS:BOOL=OFF", "-DLLVM_ENABLE_IDE:BOOL=OFF", "-DLLVM_ENABLE_LIBEDIT=OFF", @@ -68,9 +66,13 @@ def build_llvm(llvm_dir, platform, backends, projects, use_clang=False, extra_fl "-DLLVM_INCLUDE_UTILS:BOOL=OFF", "-DLLVM_INCLUDE_TESTS:BOOL=OFF", "-DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON", - "-DLLVM_USE_PERF:BOOL=ON", ] + # ccache and perf support are not available on Windows + if not "windows" == platform: + LLVM_COMPILE_OPTIONS.append("-DLLVM_CCACHE_BUILD:BOOL=ON") + LLVM_COMPILE_OPTIONS.append("-DLLVM_USE_PERF:BOOL=ON") + # use clang/clang++/lld. but macos doesn't support lld if not sys.platform.startswith("darwin") and use_clang: if shutil.which("clang") and shutil.which("clang++") and shutil.which("lld"): diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index adfc1d0b..bbf16f55 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -658,7 +658,8 @@ aot_add_llvm_func(AOTCompContext *comp_ctx, LLVMModuleRef module, const char *key = "frame-pointer"; const char *val = "all"; LLVMAttributeRef no_omit_fp = LLVMCreateStringAttribute( - comp_ctx->context, key, strlen(key), val, strlen(val)); + comp_ctx->context, key, (unsigned)strlen(key), val, + (unsigned)strlen(val)); if (!no_omit_fp) { aot_set_last_error("create LLVM attribute (frame-pointer) failed."); goto fail; diff --git a/core/shared/utils/bh_bitmap.h b/core/shared/utils/bh_bitmap.h index fe725148..c0e56cb9 100644 --- a/core/shared/utils/bh_bitmap.h +++ b/core/shared/utils/bh_bitmap.h @@ -58,7 +58,7 @@ bh_bitmap_delete(bh_bitmap *bitmap) * @return true if the index is in range, false otherwise */ static inline bool -bh_bitmap_is_in_range(bh_bitmap *bitmap, unsigned n) +bh_bitmap_is_in_range(bh_bitmap *bitmap, uintptr_t n) { return n >= bitmap->begin_index && n < bitmap->end_index; } @@ -72,9 +72,9 @@ bh_bitmap_is_in_range(bh_bitmap *bitmap, unsigned n) * @return value of the bit */ static inline int -bh_bitmap_get_bit(bh_bitmap *bitmap, unsigned n) +bh_bitmap_get_bit(bh_bitmap *bitmap, uintptr_t n) { - unsigned idx = n - bitmap->begin_index; + uintptr_t idx = n - bitmap->begin_index; bh_assert(n >= bitmap->begin_index && n < bitmap->end_index); return (bitmap->map[idx / 8] >> (idx % 8)) & 1; } @@ -86,9 +86,9 @@ bh_bitmap_get_bit(bh_bitmap *bitmap, unsigned n) * @param n the n-th bit to be set */ static inline void -bh_bitmap_set_bit(bh_bitmap *bitmap, unsigned n) +bh_bitmap_set_bit(bh_bitmap *bitmap, uintptr_t n) { - unsigned idx = n - bitmap->begin_index; + uintptr_t idx = n - bitmap->begin_index; bh_assert(n >= bitmap->begin_index && n < bitmap->end_index); bitmap->map[idx / 8] |= 1 << (idx % 8); } @@ -100,9 +100,9 @@ bh_bitmap_set_bit(bh_bitmap *bitmap, unsigned n) * @param n the n-th bit to be cleared */ static inline void -bh_bitmap_clear_bit(bh_bitmap *bitmap, unsigned n) +bh_bitmap_clear_bit(bh_bitmap *bitmap, uintptr_t n) { - unsigned idx = n - bitmap->begin_index; + uintptr_t idx = n - bitmap->begin_index; bh_assert(n >= bitmap->begin_index && n < bitmap->end_index); bitmap->map[idx / 8] &= ~(1 << (idx % 8)); }