1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Work around LuaJIT issues on aarch64 (#9614)

- Move the text segment below the 47-bit limit, needed for script_exception_wrapper which must be lightuserdata
- Replace CUSTOM_RIDX_SCRIPTAPI with full userdata
This commit is contained in:
sfan5 2020-04-08 20:14:08 +02:00 committed by GitHub
parent de73f989eb
commit 659245acc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 4 deletions

View file

@ -661,7 +661,7 @@ endif()
# Set some optimizations and tweaks
include(CheckCXXCompilerFlag)
include(CheckCSourceCompiles)
if(MSVC)
# Visual Studio
@ -695,13 +695,19 @@ else()
else()
set(RELEASE_WARNING_FLAGS "")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(WARNING_FLAGS "${WARNING_FLAGS} -Wsign-compare")
endif()
if(APPLE AND USE_LUAJIT)
# required per http://luajit.org/install.html
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
elseif(UNIX AND USE_LUAJIT)
check_c_source_compiles("#ifndef __aarch64__\n#error\n#endif\nint main(){}" IS_AARCH64)
if(IS_AARCH64)
# Move text segment below LuaJIT's 47-bit limit (see issue #9367)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Ttext-segment=0x200000000")
endif()
endif()
if(MINGW)