From 03c54aebdd914ada16925db7ca455132c45b8a45 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Sat, 4 Jun 2022 05:44:45 -0700 Subject: luajit: use GC64 on darwin (#30971) --- var/spack/repos/builtin/packages/lua-luajit-openresty/package.py | 6 ++++++ var/spack/repos/builtin/packages/lua-luajit/package.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py b/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py index c0ac67953d..885656c174 100644 --- a/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py +++ b/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py @@ -43,6 +43,12 @@ class LuaLuajitOpenresty(LuaImplPackage): src_makefile.filter( '^DYNAMIC_CC = .*', 'DYNAMIC_CC = $(CC) {0}'.format(self.compiler.cc_pic_flag)) + # Catalina and higher produce a non-functional luajit unless this is set + if spec.satisfies("platform=darwin"): + src_makefile.filter( + '^.XCFLAGS.= -DLUAJIT_ENABLE_GC64', + 'XCFLAGS+= -DLUAJIT_ENABLE_GC64', + ) # Linking with the C++ compiler is a dirty hack to deal with the fact # that unwinding symbols are not included by libc, this is necessary # on some platforms for the final link stage to work diff --git a/var/spack/repos/builtin/packages/lua-luajit/package.py b/var/spack/repos/builtin/packages/lua-luajit/package.py index 6054115b5d..e1e15616d5 100644 --- a/var/spack/repos/builtin/packages/lua-luajit/package.py +++ b/var/spack/repos/builtin/packages/lua-luajit/package.py @@ -26,6 +26,7 @@ class LuaLuajit(LuaImplPackage): conflicts("lua", when="+lualinks") provides("luajit") lua_version_override = "5.1" + conflicts('platform=darwin', msg='luajit not supported on MacOS, see lua-luajit-openresty') @run_after("install") def install_links(self): @@ -47,6 +48,7 @@ class LuaLuajit(LuaImplPackage): src_makefile.filter( '^DYNAMIC_CC = .*', 'DYNAMIC_CC = $(CC) {0}'.format(self.compiler.cc_pic_flag)) + # Linking with the C++ compiler is a dirty hack to deal with the fact # that unwinding symbols are not included by libc, this is necessary # on some platforms for the final link stage to work -- cgit v1.2.3-60-g2f50