Skip to content

Commit

Permalink
fix: XCode 16 and LuaJit no dedup workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed Sep 23, 2024
1 parent 18a430d commit ede4378
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Bundle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if(BUNDLE_USE_LUA2C)
MAIN_DEPENDENCY ${source_file}
DEPENDS ${LUA_TARGET}
COMMAND ${BUNDLE_CMD} ARGS
${BUNDLE_CMD_ARGS} lua2c.lua ${BUNDLE_ENABLE_DEBUG} ${source_file} ${generated_file}
${BUNDLE_CMD_ARGS} ${LUA_TARGET_PATH}/lua2c.lua ${BUNDLE_ENABLE_DEBUG} ${source_file} ${generated_file}
COMMENT "${BUNDLE_CMD} ${BUNDLE_CMD_ARGS} lua2c.lua ${BUNDLE_ENABLE_DEBUG} ${source_file} ${generated_file}"
WORKING_DIRECTORY ${LUA_TARGET_PATH})

Expand Down
21 changes: 21 additions & 0 deletions LuaJIT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,27 @@ if(IOS)
set_xcode_property(libluajit IPHONEOS_DEPLOYMENT_TARGET "9.0" "all")
endif()

if(CMAKE_C_COMPILER_ID MATCHES "Clang")
# Any Clang
# Since the assembler part does NOT maintain a frame pointer, it's pointless
# to slow down the C part by not omitting it. Debugging, tracebacks and
# unwinding are not affected -- the assembler part has frame unwind
# information and GCC emits it where needed (x64) or with -g (see CCDEBUG).
add_compile_options(-fomit-frame-pointer)
if(CMAKE_C_COMPILER_ID MATCHES "^AppleClang$")
# Apple Clang only
add_compile_options(
-faligned-allocation
-fasm-blocks
)

# LuaJit + XCode 16 goes blammo
add_link_options(
-Wl,-no_deduplicate
)
endif()
endif()

if("${LJ_TARGET_ARCH}" STREQUAL "x86")
if(CMAKE_COMPILER_IS_CLANGXX OR CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(libluajit PRIVATE
Expand Down

0 comments on commit ede4378

Please sign in to comment.