Skip to content

Commit dfd2a5b

Browse files
authored
Fix AOT compilation on MacOS (#3102)
After #2995, AOT may stop working properly on arm MacOS: ```bash wasm-micro-runtime/core/iwasm/common/wasm_runtime_common.c, line 1270, WASM module load failed AOT module load failed: mmap memory failed ``` That's because, without `#include <TargetConditionals.h>`, `TARGET_OS_OSX` is undefined, since it's definition is in that header file.
1 parent 51e25ef commit dfd2a5b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

core/shared/platform/common/posix/posix_memmap.c

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#if defined(__APPLE__) || defined(__MACH__)
99
#include <libkern/OSCacheControl.h>
10+
#include <TargetConditionals.h>
1011
#endif
1112

1213
#ifndef BH_ENABLE_TRACE_MMAP

core/shared/platform/common/posix/posix_thread.c

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "platform_api_vmcore.h"
1010
#include "platform_api_extension.h"
1111

12+
#if defined(__APPLE__) || defined(__MACH__)
13+
#include <TargetConditionals.h>
14+
#endif
15+
1216
typedef struct {
1317
thread_start_routine_t start;
1418
void *arg;

0 commit comments

Comments
 (0)