From 9634784777d48ce6352c0a7cd7ebde5abbd02ef3 Mon Sep 17 00:00:00 2001 From: Luka Blaskovic Date: Wed, 25 Aug 2021 11:02:11 +0000 Subject: luajit: disable unwind external on aarch64-darwin see: https://github.com/LuaJIT/LuaJIT/issues/698 --- .../luajit/aarch64-darwin-disable-unwind-external.patch | 14 ++++++++++++++ pkgs/development/interpreters/luajit/default.nix | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/development/interpreters/luajit/aarch64-darwin-disable-unwind-external.patch (limited to 'pkgs/development/interpreters/luajit') diff --git a/pkgs/development/interpreters/luajit/aarch64-darwin-disable-unwind-external.patch b/pkgs/development/interpreters/luajit/aarch64-darwin-disable-unwind-external.patch new file mode 100644 index 000000000000..dcfb1e9d4e7f --- /dev/null +++ b/pkgs/development/interpreters/luajit/aarch64-darwin-disable-unwind-external.patch @@ -0,0 +1,14 @@ +diff --git a/src/Makefile b/src/Makefile +index 2538503f..7e6380da 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -320,7 +320,9 @@ ifeq (Darwin,$(TARGET_SYS)) + $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) + endif + TARGET_STRIP+= -x ++ ifneq (arm64,$(shell uname -m)) + TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL ++ endif + TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC + TARGET_DYNXLDOPTS= + TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 2a94f9f69e7c..6a163c4b562f 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -51,6 +51,10 @@ stdenv.mkDerivation rec { luaversion = "5.1"; + # Fix for pcall on aarch64-darwin. + # Upstream issue: https://github.com/LuaJIT/LuaJIT/issues/698 + patches = lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [ ./aarch64-darwin-disable-unwind-external.patch ]; + postPatch = '' substituteInPlace Makefile --replace ldconfig : if test -n "''${dontStrip-}"; then -- cgit v1.2.3