-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
luajit-2.1.0-beta3安装失败 #4553
Comments
Title: luajit-2.1.0-beta3 installation failed |
macos arm64 是后来新加的,之前 ci 上没适配。。可以提个 pr 过来直接修下 |
macos arm64 was added later and was not adapted on ci before. . You can submit a PR and fix it directly. |
好的,可以指点一下应该看哪里的代码吗?对这个项目还不太熟悉😅 |
Okay, can you give me some pointers on where to look at the code? Not very familiar with this project😅 |
可以调下这个 port 文件。https://github.com/xmake-io/xmake-repo/blob/dev/packages/l/luajit/port/xmake.lua 然后 clone 这个 repo 后执行 |
You can adjust this port file. https://github.com/xmake-io/xmake-repo/blob/dev/packages/l/luajit/port/xmake.lua Then clone this repo and execute |
checkout了 #define LJ_TARGET_IOS (LJ_TARGET_OSX && (LUAJIT_TARGET == LUAJIT_ARCH_ARM || LUAJIT_TARGET == LUAJIT_ARCH_ARM64)) 这里认为如果系统是OSX且架构是ARM或者ARM64,那么系统就是IOS,也就是说M1也被认定成了IOS。 #if LJ_TARGET_IOS || LJ_TARGET_CONSOLE
/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
/* Ditto for the consoles. Complain to Sony or MS, not me. */
#ifndef LUAJIT_ENABLE_JIT
#define LJ_OS_NOJIT 1
#endif
#endif 然后IOS不支持JIT,并把 /* Disable or enable the JIT compiler. */
#if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) || defined(LJ_OS_NOJIT)
#define LJ_HASJIT 0
#else
#define LJ_HASJIT 1
#endif 最后导致了 /* Global state, main thread and extra fields are allocated together. */
typedef struct GG_State {
lua_State L; /* Main thread. */
global_State g; /* Global state. */
#if LJ_TARGET_MIPS
ASMFunction got[LJ_GOT__MAX]; /* Global offset table. */
#endif
#if LJ_HASJIT
jit_State J; /* JIT state. */
HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */
#endif
ASMFunction dispatch[GG_LEN_DISP]; /* Instruction dispatch tables. */
BCIns bcff[GG_NUM_ASMFF]; /* Bytecode for ASM fast functions. */
} GG_State; 我还试了一下直接用LuaJIT本来的Makefile编译,发现这种情况下clangd显示LUAJIT_TARGET是x64,并且编译可以成功,所以现在有一个假设就是LuaJIT在M1上应该编译x64的版本然后在运行时转译? |
不清楚,这边也没 m1 测试。。你可以自己看下,如果能修,就提个 pr 过来 |
Not sure, there is no m1 test here either. . You can take a look at it yourself, and if you can fix it, submit a PR. |
Xmake 版本
v2.9.3+20240624
操作系统版本和架构
macOS Ventura 13.6, Apple M1
描述问题
安装
luajit
时出现编译错误,下面是错误日志:期待的结果
可以成功安装
luajit 2.1.0-beta3
工程配置
直接使用
xrepo
命令进行安装:xrepo install "luajit 2.1.0-beta3"
附加信息和错误日志
verbose的编译日志:
The text was updated successfully, but these errors were encountered: