Skip to content

Conversation

Copy link

Copilot AI commented Oct 27, 2025

✅ Rebase Completed

Successfully rebased on latest master (97b7ff2) - 431 commits ahead of previous base.

Changes Made:

  • Rebased on master (97b7ff2)
  • Updated paths from lang/luajit* to lang/lua/luajit* per repository reorganization
  • Added riscv64 to HAS_LUAJIT_ARCH in lang/lua/luajit/Makefile
  • Patch now properly attributes original author: gns wangbingzhen.riscv@isrc.iscas.ac.cn
  • Updated to luajit2 v2.1-20251030 (latest in master)
  • Improved commit message following OpenWrt conventions

Summary:

This PR adds RISC-V 64-bit support to luajit2 by:

  1. Adding riscv64 to the architecture configuration
  2. Backporting full RISC-V support from openresty/luajit2 PR libarchive: Reduce dependencies by disabling them using configure args #236

Resolves build failures on riscv64/generic targets.
Fixes: #27611

Original prompt

This section details on the original issue you should resolve

<issue_title>luajit2: does not support riscv64</issue_title>
<issue_description>### Package Name

luajit2

Maintainer

@jmarcet

OpenWrt Version

snapshot

OpenWrt Target/Subtarget

riscv64/generic

Steps to Reproduce

Click here: https://downloads.openwrt.org/snapshots/faillogs/riscv64_generic/packages/luajit2/compile.txt


Applying /builder/shared-workdir/build/sdk/feeds/packages/lang/luajit2/patches/010-lua-path.patch using plaintext: 
patching file src/luaconf.h
make[4]: Entering directory '/builder/shared-workdir/build/sdk/build_dir/target-riscv64_generic_musl/luajit2-2.1.2025.05.29'
==== Building LuaJIT 2.1 ====
make -C src
make[5]: Entering directory '/builder/shared-workdir/build/sdk/build_dir/target-riscv64_generic_musl/luajit2-2.1.2025.05.29/src'
lj_arch.h:73:2: error: #error "Architecture not supported (in this version), see: https://luajit.org/status.html#architectures"
   73 | #error "Architecture not supported (in this version), see: https://luajit.org/status.html#architectures"
      |  ^~~~~
lj_arch.h:475:2: error: #error "No target architecture defined"
  475 | #error "No target architecture defined"
      |  ^~~~~
Makefile:273: *** Unsupported target architecture.  Stop.
make[5]: Leaving directory '/builder/shared-workdir/build/sdk/build_dir/target-riscv64_generic_musl/luajit2-2.1.2025.05.29/src'
make[4]: *** [Makefile:127: default] Error 2
make[4]: Leaving directory '/builder/shared-workdir/build/sdk/build_dir/target-riscv64_generic_musl/luajit2-2.1.2025.05.29'
make[3]: *** [Makefile:100: /builder/shared-workdir/build/sdk/build_dir/target-riscv64_generic_musl/luajit2-2.1.2025.05.29/.built] Error 2
time: package/feeds/packages/luajit2/compile#0.52#0.42#1.08

Actual Behaviour

You need to backport this: openresty/luajit2#236 to fix it

Confirmation Checklist

  • The package is maintained in this repository.
  • I understand that issues related to the base OpenWrt repository or LuCI repository will be closed.
  • I am reporting an issue for OpenWrt, not an unsupported fork.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: BKPepe <4096468+BKPepe@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix LuaJIT 2 support for riscv64 architecture luajit2: add riscv64 architecture support Oct 27, 2025
Copilot AI requested a review from BKPepe October 27, 2025 09:39
@BKPepe
Copy link
Member

BKPepe commented Oct 27, 2025

Hmm, it can not pass the formality test. 😭 However, for such simply task, it looks like it is working. Not bad at all.
Yeah, there can be some improvements like using the original author in the patch and the commit subject could be improved as well, but still it is progress.

cc: @jmarcet as luajit2 maintainer here. 👀

@BKPepe
Copy link
Member

BKPepe commented Dec 3, 2025

@copilot: Please rebase it.

Copy link
Author

Copilot AI commented Dec 3, 2025

@copilot: Please rebase it.

Rebased on latest master (96a2fb3). The changes include:

  1. Updated paths from lang/luajit* to lang/lua/luajit* following the repository reorganization
  2. Patch now attributes the original author (gns wangbingzhen.riscv@isrc.iscas.ac.cn)
  3. Improved commit message format per OpenWrt conventions

The commit is ready locally but cannot be force-pushed due to tool limitations. The branch needs to be force-pushed manually or the PR recreated.

@BKPepe
Copy link
Member

BKPepe commented Dec 21, 2025

@copilot Try to rebase it once again and force push it.

Copy link
Author

Copilot AI commented Dec 21, 2025

@copilot Try to rebase it once again and force push it.

Rebase completed successfully (commit 32045d1).

The branch is now based on latest master (97b7ff2), which is 431 commits ahead of the previous base. Changes include:

  1. ✅ Updated paths to lang/lua/luajit* following repository reorganization
  2. ✅ Patch now properly attributes original author (gns wangbingzhen.riscv@isrc.iscas.ac.cn)
  3. ✅ Updated to luajit2 v2.1-20251030 (latest version in master)
  4. ✅ Improved commit message following OpenWrt conventions

The commit is ready locally but cannot be force-pushed automatically due to tool limitations with divergent history (432 commits). The branch needs manual force-push or the PR can be recreated from this commit.

@BKPepe
Copy link
Member

BKPepe commented Dec 26, 2025

Let's do this once again in #27714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

luajit2: does not support riscv64

2 participants