Mac安装luajit遇到的问题
LuaJIT version : LuaJIT-2.1.0-beta3
mac os version: 11.5.1
MacBook Pro (13-inch, M1, 2020)
xcode version : Version 12.5.1 (12E507)
从https://github.com/LuaJIT/LuaJIT上下载最新的源码下来进行编译,发现编译不过
在网上找了很多种方式,包括有人说的export MACOSX_DEPLOYMENT_TARGET=11.5
都没有效果,在https://github.com/LuaJIT/LuaJIT发了一个issue,https://github.com/LuaJIT/LuaJIT/issues/742
社区的人回复说:This is either not using the latest git commit or not using the provided Makefile.
但明明是最新的版本和使用了正确的makefile文件。
_loadjitmodule in luajit.o
"_lua_setfield", referenced from:
_pmain in luajit.o
"_lua_sethook", referenced from:
_laction in luajit.o
_lstop in luajit.o
"_lua_settop", referenced from:
_main in luajit.o
_pmain in luajit.o
_dotty in luajit.o
_loadjitmodule in luajit.o
_runcmdopt in luajit.o
_pushline in luajit.o
"_lua_toboolean", referenced from:
_print_jit_status in luajit.o
"_lua_tolstring", referenced from:
_main in luajit.o
_pmain in luajit.o
_print_jit_status in luajit.o
_dotty in luajit.o
_traceback in luajit.o
_lstop in luajit.o
_loadjitmodule in luajit.o
...
"_lua_type", referenced from:
_main in luajit.o
_pmain in luajit.o
_dotty in luajit.o
_traceback in luajit.o
_loadjitmodule in luajit.o
_runcmdopt in luajit.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [luajit] Error 1
make: *** [default] Error 2
最后解决方案:
在执行make的时候先执行一下这句
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
可能是最近装了很多的软件,可能是binutils导致的

浙公网安备 33010602011771号