Skip to content

Commit

Permalink
XCode 16 and LuaJit no dedup workaround (#7793)
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul authored Sep 21, 2024
1 parent e4f6f84 commit 86c8ec7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
-faligned-allocation
-fasm-blocks
)

# LuaJit + XCode 16 goes blammo
add_link_options(
-Wl,-no_deduplicate
)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^GNU$")
# GCC only
Expand Down
4 changes: 2 additions & 2 deletions libs/luajitlib/build-macos-luajit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ cd "${SD}/LuaJIT" || error=1
export MACOSX_DEPLOYMENT_TARGET=10.9

# Pipe output to /dev/null to suppress linker errors
make amalg -j HOST_CC="clang -target `uname -m`-apple-macos10.9" TARGET_CC="xcrun --toolchain arm64 clang -target arm64-apply-macos10.9 -isysroot $(xcrun --sdk macosx --show-sdk-path) -fvisibility=hidden -fvisibility-inlines-hidden" TARGET_CFLAGS="-O3" > /dev/null 2>&1
make amalg -j HOST_CC="clang -target `uname -m`-apple-macos10.9" TARGET_CC="xcrun --toolchain arm64 clang -target arm64-apply-macos10.9 -isysroot $(xcrun --sdk macosx --show-sdk-path) -fvisibility=hidden -fvisibility-inlines-hidden" TARGET_LDFLAGS="-Wl,-no_deduplicate" TARGET_CFLAGS="-O3" > /dev/null 2>&1
cp src/lib*a "${OD}/arm64" || error=1

make clean || error=1
make amalg -j HOST_CC="clang -target `uname -m`-apple-macos10.9" TARGET_CC="xcrun --toolchain x86_64 clang -target x86_64-apply-macos10.9 -isysroot $(xcrun --sdk macosx --show-sdk-path) -fvisibility=hidden -fvisibility-inlines-hidden" TARGET_CFLAGS="-O3" > /dev/null 2>&1
make amalg -j HOST_CC="clang -target `uname -m`-apple-macos10.9" TARGET_CC="xcrun --toolchain x86_64 clang -target x86_64-apply-macos10.9 -isysroot $(xcrun --sdk macosx --show-sdk-path) -fvisibility=hidden -fvisibility-inlines-hidden" TARGET_LDFLAGS="-Wl,-no_deduplicate" TARGET_CFLAGS="-O3" > /dev/null 2>&1
cp src/lib*a "${OD}/x86_64" || error=1

lipo -create -arch arm64 "${OD}/arm64/libluajit.a" -arch x86_64 "${OD}/x86_64/libluajit.a" -output "${OD}/libluajit.a" || error=1
Expand Down

0 comments on commit 86c8ec7

Please sign in to comment.