Skip to content

Commit f2a63d8

Browse files
JavanZhuwenyongh
andauthored
Fix aot bh_assert failed issue on darwin platform x86_64 target (#476) (#488)
Modify the macro control sentences as darwin platform doesn't support mmap with MAP_32BIT flag to put the mapping address into 0-2G range. Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
1 parent 6c967b7 commit f2a63d8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

core/iwasm/aot/aot_loader.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,8 @@ load_object_data_sections(const uint8 **p_buf, const uint8 *buf_end,
986986
return false;
987987
}
988988
#if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
989-
#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS)
989+
#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS) \
990+
&& !defined(BH_PLATFORM_DARWIN)
990991
/* address must be in the first 2 Gigabytes of
991992
the process address space */
992993
bh_assert((uintptr_t)data_sections[i].data < INT32_MAX);
@@ -1887,7 +1888,8 @@ create_sections(const uint8 *buf, uint32 size,
18871888
goto fail;
18881889
}
18891890
#if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
1890-
#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS)
1891+
#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS) \
1892+
&& !defined(BH_PLATFORM_DARWIN)
18911893
/* address must be in the first 2 Gigabytes of
18921894
the process address space */
18931895
bh_assert((uintptr_t)aot_text < INT32_MAX);

0 commit comments

Comments
 (0)