diff --git a/apply-patches b/apply-patches new file mode 100644 index 0000000000000000000000000000000000000000..21931ccde1b972a5a3a9997e20a8b771930356a1 --- /dev/null +++ b/apply-patches @@ -0,0 +1,13 @@ +#!/bin/bash + +set -ex + +if [ ! -d loongarch64 ]; then + tar -xf loongarch64.tar.gz +fi + +for p in $(cat loongarch64.conf); do + patch -p1 -s -i loongarch64/$p +done + +rm -rf $0 loongarch64 loongarch64.tar.gz loongarch64.conf diff --git a/loongarch64.conf b/loongarch64.conf new file mode 100644 index 0000000000000000000000000000000000000000..e87a78b807c85dbc7da91065f6050ab0f6586115 --- /dev/null +++ b/loongarch64.conf @@ -0,0 +1,21 @@ +0001-LoongArch64-Add-target-architecture-selection.patch +0002-LoongArch64-Add-DynASM-support.patch +0003-LoongArch64-Add-register-assignments-for-the-interpr.patch +0004-LoongArch64-Add-stack-layout.patch +0005-LoongArch64-Add-some-general-macro-type-definitions-.patch +0006-LoongArch64-Add-pure-interpreter-backend.patch +0007-LoongArch64-Add-definitions-for-target-CPU.patch +0008-LoongArch64-Add-some-constant-definitions.patch +0009-LoongArch64-Add-LoongArch-instruction-emitter.patch +0010-LoongArch64-Add-IR-assembler-support.patch +0011-LoongArch64-Add-JIT-support-in-the-interpreter.patch +0012-LoongArch64-Add-CPU-feature-detection-when-init-JIT-.patch +0013-LoongArch64-Add-LoongArch-lp64-calling-conventions-a.patch +0014-LoongArch64-Add-FFI-C-callback-handling.patch +0015-LoongArch64-Add-FFI-support-in-the-interpreter.patch +0016-LoongArch64-Add-DWARF-and-ELF-header-definitions.patch +0017-LoongArch64-Add-support-for-LuaJIT-VM-builder.patch +0018-LoongArch64-Add-loongarch64-support-when-save-list-b.patch +0019-LoongArch64-Add-LoongArch64-disassembler-module.patch +0020-LoongArch64-Add-support-in-Makefile.patch +0021-LoongArch64-Upgrade-the-base-code-to-v2.1.ROLLING.patch diff --git a/loongarch64.tar.gz b/loongarch64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9825123089a3abf3106cae413c990494995f66a0 Binary files /dev/null and b/loongarch64.tar.gz differ diff --git a/luajit.spec b/luajit.spec index d233e8372691b3e4eed303fa1be1b5d86e30135c..1bea606c012c154ef4637c7c62b1072a740b90c5 100644 --- a/luajit.spec +++ b/luajit.spec @@ -2,18 +2,22 @@ Name: luajit Version: 2.1.0 -Release: 8 +Release: 9 Summary: Just-In-Time Compiler for Lua License: MIT URL: http://luajit.org/ Source0: http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz +Source1: loongarch64.tar.gz +Source2: loongarch64.conf +Source3: apply-patches + # Patches from https://github.com/LuaJit/LuaJIT.git # Generated from v2.1 branch against the 2.1.0-beta3 tag using # git diff v2.1.0-beta3..v2.1 > luajit-2.1-update.patch Patch0001: luajit-2.1-d06beb0-update.patch Patch0002: 0002-luajit-add-secure-compile-option-fstack.patch Patch0003: add-riscv-support.patch -ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 riscv64 +ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 riscv64 loongarch64 BuildRequires: gcc BuildRequires: make @@ -45,6 +49,13 @@ Man pages and other related documents for luajit. %patch -P0003 -p1 %endif +%ifarch loongarch64 +cp %{SOURCE1} . +cp %{SOURCE2} . +cp %{SOURCE3} . +sh ./apply-patches +%endif + sed -i -e '/install -m/s/-m/-p -m/' Makefile %build @@ -83,6 +94,9 @@ cp -a doc _tmp_html/html %{_mandir}/man1/%{name}.1* %changelog +* Tue Apr 23 2024 zhaoxiaolin - 2.1.0-9 +- Add loongarch64 base support + * Thu Mar 21 2024 TexasOct - 2.1.0-8 - update riscv64 support and update to mainline d06beb04