From 27ddaa39db6ae18c2a6e4c1b816f3ee35466d05c Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sat, 11 Jul 2020 14:35:12 +0200 Subject: Do not set pagezero_size and image_base for LuaJIT >= 2.1.0-beta3 This is properly handled in LuaJIT now and setting causes "Malformed Mach-o file" error when running the resulting binary on arm64 Macs. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b34639d32..e3c67c55cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,8 +352,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") add_definitions(-D_GNU_SOURCE) endif() -if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8) - # Required for luajit. +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT PREFER_LUA AND LUAJIT_VERSION LESS "2.1.0-beta3") + # Required for luajit < 2.1.0-beta3. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000") set(CMAKE_SHARED_LINKER_FLAGS -- cgit