mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-31 05:57:27 +00:00
Fix compilation error on iOS due to macOS-specific API (#2995)
`pthread_jit_write_protect_np` is only available on macOS, and `sys_icache_invalidate` is available on both iOS and macOS and has no restrictions on ARM architecture.
This commit is contained in:
parent
ff25110840
commit
03a2af5095
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "platform_api_vmcore.h"
|
#include "platform_api_vmcore.h"
|
||||||
|
|
||||||
#if (defined(__APPLE__) || defined(__MACH__)) && defined(__arm64__)
|
#if defined(__APPLE__) || defined(__MACH__)
|
||||||
#include <libkern/OSCacheControl.h>
|
#include <libkern/OSCacheControl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@ void *
|
||||||
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
||||||
{
|
{
|
||||||
int map_prot = PROT_NONE;
|
int map_prot = PROT_NONE;
|
||||||
#if (defined(__APPLE__) || defined(__MACH__)) && defined(__arm64__)
|
#if (defined(__APPLE__) || defined(__MACH__)) && defined(__arm64__) \
|
||||||
|
&& defined(TARGET_OS_OSX) && TARGET_OS_OSX != 0
|
||||||
int map_flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_JIT;
|
int map_flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_JIT;
|
||||||
#else
|
#else
|
||||||
int map_flags = MAP_ANONYMOUS | MAP_PRIVATE;
|
int map_flags = MAP_ANONYMOUS | MAP_PRIVATE;
|
||||||
|
@ -275,7 +276,7 @@ os_dcache_flush(void)
|
||||||
void
|
void
|
||||||
os_icache_flush(void *start, size_t len)
|
os_icache_flush(void *start, size_t len)
|
||||||
{
|
{
|
||||||
#if (defined(__APPLE__) || defined(__MACH__)) && defined(__arm64__)
|
#if defined(__APPLE__) || defined(__MACH__)
|
||||||
sys_icache_invalidate(start, len);
|
sys_icache_invalidate(start, len);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -476,7 +476,8 @@ os_thread_get_stack_boundary()
|
||||||
void
|
void
|
||||||
os_thread_jit_write_protect_np(bool enabled)
|
os_thread_jit_write_protect_np(bool enabled)
|
||||||
{
|
{
|
||||||
#if (defined(__APPLE__) || defined(__MACH__)) && defined(__arm64__)
|
#if (defined(__APPLE__) || defined(__MACH__)) && defined(__arm64__) \
|
||||||
|
&& defined(TARGET_OS_OSX) && TARGET_OS_OSX != 0
|
||||||
pthread_jit_write_protect_np(enabled);
|
pthread_jit_write_protect_np(enabled);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user