From 7ecc35193a3748798d25a254553e0140e9b32a69 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Thu, 11 Dec 2025 15:55:17 +0800 Subject: [PATCH] add dup2 for loong64 --- 0001-add-dup2-for-loong64.patch | 24 ++++++++++++++++++++++++ tidb.spec | 7 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 0001-add-dup2-for-loong64.patch diff --git a/0001-add-dup2-for-loong64.patch b/0001-add-dup2-for-loong64.patch new file mode 100644 index 0000000..0d0b772 --- /dev/null +++ b/0001-add-dup2-for-loong64.patch @@ -0,0 +1,24 @@ +From 36440f69d07964247ad9c1f86ad5f38589be4006 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Thu, 11 Dec 2025 15:52:14 +0800 +Subject: [PATCH] add dup2 for loong64 + +--- + vendor/golang.org/x/sys/unix/syscall_linux_loong64.go | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +index 139d45f..fb2c1c6 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +@@ -227,3 +227,7 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error + } + return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) + } ++ ++// dup2 exists because func Dup3 in syscall_linux.go references ++// it in an unreachable path. dup2 isn't available on loong64. ++func dup2(oldfd int, newfd int) error +-- +2.43.0 + diff --git a/tidb.spec b/tidb.spec index 301461d..fbb66bf 100644 --- a/tidb.spec +++ b/tidb.spec @@ -1,6 +1,6 @@ Name: tidb Version: 4.0.14 -Release: 6 +Release: 7 Summary: TiDB is a distributed NewSQL database compatible with MySQL protocol License: Apache 2.0 @@ -15,6 +15,7 @@ Patch1: 0001-fix-release-version.patch Patch2: add-riscv-support.patch Patch3: add-riscv-support-for-vendor.patch Patch4: 0001-add-loong64-support.patch +Patch5: 0001-add-dup2-for-loong64.patch BuildRequires: golang >= 1.10.0 Requires(pre): shadow-utils @@ -36,6 +37,7 @@ tar xvf %{SOURCE3} -C . %endif %ifarch loongarch64 %patch -P 4 -p1 +%patch -P 5 -p1 %endif %build @@ -84,6 +86,9 @@ exit 0 %license LICENSE %changelog +* Thu Dec 11 2025 Wenlong Zhang - 4.0.14-7 +- add dup2 for loong64 + * Tue Dec 17 2024 shenzhongwei - 4.0.14-6 - include all patches in the source package. -- Gitee