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.
This commit is contained in:
Tae Won Ha
2020-07-11 14:35:12 +02:00
committed by James McCoy
parent 12709c475b
commit 27ddaa39db

View File

@@ -352,8 +352,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_definitions(-D_GNU_SOURCE) add_definitions(-D_GNU_SOURCE)
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8) 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. # Required for luajit < 2.1.0-beta3.
set(CMAKE_EXE_LINKER_FLAGS set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000") "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
set(CMAKE_SHARED_LINKER_FLAGS set(CMAKE_SHARED_LINKER_FLAGS