Просмотр исходного кода

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>
Javan 5 лет назад
Родитель
Сommit
f2a63d8623
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      core/iwasm/aot/aot_loader.c

+ 4 - 2
core/iwasm/aot/aot_loader.c

@@ -986,7 +986,8 @@ load_object_data_sections(const uint8 **p_buf, const uint8 *buf_end,
             return false;
             return false;
         }
         }
 #if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
 #if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
-#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS)
+#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS) \
+    && !defined(BH_PLATFORM_DARWIN)
         /* address must be in the first 2 Gigabytes of
         /* address must be in the first 2 Gigabytes of
            the process address space */
            the process address space */
         bh_assert((uintptr_t)data_sections[i].data < INT32_MAX);
         bh_assert((uintptr_t)data_sections[i].data < INT32_MAX);
@@ -1887,7 +1888,8 @@ create_sections(const uint8 *buf, uint32 size,
                         goto fail;
                         goto fail;
                     }
                     }
 #if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
 #if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
-#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS)
+#if !defined(BH_PLATFORM_LINUX_SGX) && !defined(BH_PLATFORM_WINDOWS) \
+    && !defined(BH_PLATFORM_DARWIN)
                     /* address must be in the first 2 Gigabytes of
                     /* address must be in the first 2 Gigabytes of
                        the process address space */
                        the process address space */
                     bh_assert((uintptr_t)aot_text < INT32_MAX);
                     bh_assert((uintptr_t)aot_text < INT32_MAX);