Skip to content

fix(luajit): support building on aarch64 hosts#15412

Open
bryanforbes wants to merge 1 commit into
batocera-linux:masterfrom
bryanforbes:fix/luajit-aarch64
Open

fix(luajit): support building on aarch64 hosts#15412
bryanforbes wants to merge 1 commit into
batocera-linux:masterfrom
bryanforbes:fix/luajit-aarch64

Conversation

@bryanforbes

Copy link
Copy Markdown
Contributor

LuaJIT requires its host tools (minilua, buildvm) to match the target's bitness. On x86_64 hosts this is solved with gcc -m32, but aarch64 has no equivalent flag.

Use Buildroot's own cross-compiler (TARGET_CC) to build the host tools as static arm32 binaries, which run natively on aarch64 via the kernel's 32-bit compat mode (CONFIG_COMPAT). Also use TARGET_CFLAGS/TARGET_LDFLAGS for the host tools on aarch64, since HOST_CFLAGS/HOST_LDFLAGS contain aarch64-specific include/library paths that are wrong for arm32.

Skip selecting BR2_HOSTARCH_NEEDS_IA32_COMPILER on aarch64 since the IA32 multilib check is not applicable.

@dmanlfc

dmanlfc commented May 9, 2026

Copy link
Copy Markdown
Collaborator

No fault of yours @bryanforbes but let’s discuss to make this simplified next week or remove this alternative package altogether.

LuaJIT requires its host tools (minilua, buildvm) to match the
target's bitness. On x86_64 hosts this is solved with gcc -m32,
but aarch64 has no equivalent flag.

Use Buildroot's own cross-compiler (TARGET_CC) to build the host
tools as static arm32 binaries, which run natively on aarch64 via
the kernel's 32-bit compat mode (CONFIG_COMPAT). Also use
TARGET_CFLAGS/TARGET_LDFLAGS for the host tools on aarch64, since
HOST_CFLAGS/HOST_LDFLAGS contain aarch64-specific include/library paths
that are wrong for arm32.

Skip selecting BR2_HOSTARCH_NEEDS_IA32_COMPILER on aarch64 since
the IA32 multilib check is not applicable.
@bryanforbes bryanforbes force-pushed the fix/luajit-aarch64 branch from 670d131 to d36b0e5 Compare May 26, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants