diff --git a/CMakeLists.txt b/CMakeLists.txt index c7689772659..f8a66f5ea2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,11 +141,6 @@ 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 diff --git a/libs/luajitlib/LuaJIT b/libs/luajitlib/LuaJIT index 04dca7911ea..f73e649a954 160000 --- a/libs/luajitlib/LuaJIT +++ b/libs/luajitlib/LuaJIT @@ -1 +1 @@ -Subproject commit 04dca7911ea255f37be799c18d74c305b921c1a6 +Subproject commit f73e649a954b599fc184726c376476e7a5c439ca diff --git a/libs/luajitlib/README.md b/libs/luajitlib/README.md index 6186df449c4..015580fcf36 100644 --- a/libs/luajitlib/README.md +++ b/libs/luajitlib/README.md @@ -4,11 +4,11 @@ luajitlib is a collection of scripts and a CMake configuration that attempts to ## Troubleshooting -CMake should output a series of debug messages and a general error message when a build fails and examining these messages is the first step to troubleshoot the problem. See the sections below for more information on specific use scenarios and platforms and refer to the LuaJIT documentation [here](https://luajit.org/install.html) for more information. The `build-[platform]-luajit.*` scripts in the luajitlib directory can also be ran manually by adding a `"[builddir]"` parameter to test without CMake. +CMake should output a series of debug messages and a general error message when a build fails and examining these messages is the first step to troubleshoot the problem. See the sections below for more information on specific use scenarios and platforms and refer to the LuaJIT documentation [here](https://luajit.org/install.html) for more information. The `build-[platform]-luajit.*` scripts in the luajitlib directory can also be run manually by adding a `"[builddir]"` parameter to test without CMake. Alternatively, a pre-built statically linked library can be placed directly in the build output directory at `[builddir]/libs/luajitlib/bin` with the header files in `[builddir]/libs/luajitlib/include`. If named either `libluajit.a` or `lua51.lib`, it should be automatically detected and used instead of compiling LuaJIT from source during the CMake configuration process. -Finally, if all other options fail, Lua support can be disabled altogether by adding `-DSURGE_SKIP_LUA=TRUE` in the CMake configuration options. +Finally, if all other options fail, Lua support can be disabled altogether by adding `-DSURGE_SKIP_LUA=TRUE` to the CMake configuration options. ### Cross-compiling @@ -20,7 +20,7 @@ The macOS build script attempts to build both `arm64` and `x86_64` binaries usin ### *nix -On Unix-like platforms (including macOS), the default is to use the `amalg` build target, which allows for better optimization at the cost of increased memory use during the compiling process. Removing the `amalg` option in the build scripts could help prevent memory use related issues on some systems. +On Unix-like platforms (including macOS), the default is to use the `amalg` build target, which allows for better optimization at the cost of increased memory use during the compiling process. Removing the `amalg` option in the build scripts could help prevent memory usage related issues on some systems. ### Windows + MSVC diff --git a/libs/luajitlib/build-macos-luajit.sh b/libs/luajitlib/build-macos-luajit.sh index 93af206b491..87cb9eb16a1 100755 --- a/libs/luajitlib/build-macos-luajit.sh +++ b/libs/luajitlib/build-macos-luajit.sh @@ -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_LDFLAGS="-Wl,-no_deduplicate" 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_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_LDFLAGS="-Wl,-no_deduplicate" 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_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 diff --git a/libs/luajitlib/msvcbuild.bat b/libs/luajitlib/msvcbuild.bat index 45837f578e7..28710aa256b 100644 --- a/libs/luajitlib/msvcbuild.bat +++ b/libs/luajitlib/msvcbuild.bat @@ -106,7 +106,7 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if "%1"=="static" goto :STATIC %LJCOMPILE% %LJDYNBUILD% lj_*.c lib_*.c @if errorlevel 1 goto :BAD -%LJLINK% /DLL /out:%LJDLLNAME% lj_*.obj lib_*.obj +%LJLINK% /DLL /OUT:%LJDLLNAME% lj_*.obj lib_*.obj @if errorlevel 1 goto :BAD @goto :MTDLL :STATIC @@ -116,9 +116,16 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c @if errorlevel 1 goto :BAD @goto :MTDLL :AMALGDLL +@if "%2"=="static" goto :AMALGSTATIC %LJCOMPILE% %LJDYNBUILD% ljamalg.c @if errorlevel 1 goto :BAD -%LJLINK% /DLL /out:%LJDLLNAME% ljamalg.obj lj_vm.obj +%LJLINK% /DLL /OUT:%LJDLLNAME% ljamalg.obj lj_vm.obj +@if errorlevel 1 goto :BAD +@goto :MTDLL +:AMALGSTATIC +%LJCOMPILE% ljamalg.c +@if errorlevel 1 goto :BAD +%LJLINK% /OUT:%LJDLLNAME% ljamalg.obj lj_vm.obj @if errorlevel 1 goto :BAD :MTDLL if exist %LJDLLNAME%.manifest^ @@ -126,7 +133,7 @@ if exist %LJDLLNAME%.manifest^ %LJCOMPILE% luajit.c @if errorlevel 1 goto :BAD -%LJLINK% /out:luajit.exe luajit.obj %LJLIBNAME% +%LJLINK% /OUT:luajit.exe luajit.obj %LJLIBNAME% @if errorlevel 1 goto :BAD if exist luajit.exe.manifest^ %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe