!10 Add riscv64 support

From: @a-xiang-and-shanhaijing 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2023-07-19 08:10:30 +00:00 committed by Gitee
commit 0fefc3e6b3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 1302 additions and 1 deletions

File diff suppressed because it is too large Load Diff

12
add-riscv-support.patch Normal file
View File

@ -0,0 +1,12 @@
diff -ur tidb-4.0.14/util/sys/linux/sys_linux.go tidb-4.0.14/util/sys/linux/sys_linux.go
--- tidb-4.0.14/util/sys/linux/sys_linux.go 2021-07-26 18:50:15.000000000 +0800
+++ tidb-4.0.14/util/sys/linux/sys_linux.go 2023-07-19 09:54:54.386949713 +0800
@@ -27,7 +27,7 @@
if err != nil {
return
}
- charsToString := func(ca []int8) string {
+ charsToString := func(ca []uint8) string {
s := make([]byte, len(ca))
var lens int
for ; lens < len(ca); lens++ {

View File

@ -1,6 +1,6 @@
Name: tidb
Version: 4.0.14
Release: 3
Release: 4
Summary: TiDB is a distributed NewSQL database compatible with MySQL protocol
License: QL and STRUTIL
@ -12,6 +12,10 @@ Source2: tidb-server.toml
Source3: vendor.tar.gz
Patch0: Set-GOFLAG-to-go-mod-vendor.patch
Patch1: 0001-fix-release-version.patch
%ifarch riscv64
Patch2: add-riscv-support.patch
Patch3: add-riscv-support-for-vendor.patch
%endif
BuildRequires: golang >= 1.10.0
Requires(pre): shadow-utils
Requires(post): systemd
@ -20,8 +24,18 @@ Requires(post): systemd
TiDB is a distributed NewSQL database compatible with MySQL protocol
%prep
%ifarch riscv64
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
tar xvf %{SOURCE3} -C .
%patch3
%else
%autosetup -p1
tar xvf %{SOURCE3} -C .
%endif
%build
%make_build
@ -69,6 +83,9 @@ exit 0
%license LICENSE
%changelog
* Mon Jul 17 2023 zhangxiang <zhangxiang@iscas.ac.cn> - 4.0.14-4
- add riscv64 support
* Mon Oct 11 2021 baizhonggui <baizhonggui@huawei.com> - 4.0.14-3
- Fix commond tidb-server -V 'Release Version' not displayed