已开启
[sync] PR-14: fix build error on loongarch64 for openGemini #15
[sync] PR-14: fix build error on loongarch64 for openGemini #15
已开启
openeuler-ci-bot创建于 6月5日
共 2 个文件变更+104-1
@@ -0,0 +1,98 @@
1+From 745e306e8c0b67d5ad3023c51d3cb5f27e53a51e Mon Sep 17 00:00:00 2001
2+From: Wenlong Zhang <zhangwenlong@loongson.cn>
3+Date: Thu, 4 Jun 2026 20:30:12 +0800
4+Subject: [PATCH] fix build error on loongarch64 for openGemini
5+ 
6+---
7+ .../gopsutil/v3/host/host_linux_loong64.go | 48 +++++++++++++++++++
8+ .../valyala/gozstd/libzstd_linux_loong64.go | 6 +++
9+ vendor/go.etcd.io/bbolt/bolt_loong64.go | 9 ++++
10+ 3 files changed, 63 insertions(+)
11+ create mode 100644 vendor/github.com/shirou/gopsutil/v3/host/host_linux_loong64.go
12+ create mode 100644 vendor/github.com/valyala/gozstd/libzstd_linux_loong64.go
13+ create mode 100644 vendor/go.etcd.io/bbolt/bolt_loong64.go
14+ 
15+diff --git a/vendor/github.com/shirou/gopsutil/v3/host/host_linux_loong64.go b/vendor/github.com/shirou/gopsutil/v3/host/host_linux_loong64.go
16+new file mode 100644
17+index 0000000..edf1be5
18+--- /dev/null
19++++ b/vendor/github.com/shirou/gopsutil/v3/host/host_linux_loong64.go
20+@@ -0,0 +1,48 @@
21++// Code generated by cmd/cgo -godefs; DO NOT EDIT.
22++// cgo -godefs host/types_linux.go
23++
24++//go:build linux && loong64
25++// +build linux,loong64
26++
27++package host
28++
29++const (
30++ sizeofPtr = 0x8
31++ sizeofShort = 0x2
32++ sizeofInt = 0x4
33++ sizeofLong = 0x8
34++ sizeofLongLong = 0x8
35++ sizeOfUtmp = 0x190
36++)
37++
38++type (
39++ _C_short int16
40++ _C_int int32
41++ _C_long int64
42++ _C_long_long int64
43++)
44++
45++type (
46++ utmp struct {
47++ Type int16
48++ Pid int32
49++ Line [32]int8
50++ Id [4]int8
51++ User [32]int8
52++ Host [256]int8
53++ Exit exit_status
54++ Session int64
55++ Tv timeval
56++ Addr_v6 [4]int32
57++ X__glibc_reserved [20]int8
58++ Pad_cgo_0 [4]byte
59++ }
60++ exit_status struct {
61++ Termination int16
62++ Exit int16
63++ }
64++ timeval struct {
65++ Sec int64
66++ Usec int64
67++ }
68++)
69+diff --git a/vendor/github.com/valyala/gozstd/libzstd_linux_loong64.go b/vendor/github.com/valyala/gozstd/libzstd_linux_loong64.go
70+new file mode 100644
71+index 0000000..401ee28
72+--- /dev/null
73++++ b/vendor/github.com/valyala/gozstd/libzstd_linux_loong64.go
74+@@ -0,0 +1,6 @@
75++package gozstd
76++
77++/*
78++#cgo linux,loong64 LDFLAGS: -lzstd
79++*/
80++import "C"
81+diff --git a/vendor/go.etcd.io/bbolt/bolt_loong64.go b/vendor/go.etcd.io/bbolt/bolt_loong64.go
82+new file mode 100644
83+index 0000000..c5bb7cb
84+--- /dev/null
85++++ b/vendor/go.etcd.io/bbolt/bolt_loong64.go
86+@@ -0,0 +1,9 @@
87++// +build loong64
88++
89++package bbolt
90++
91++// maxMapSize represents the largest mmap size supported by Bolt.
92++const maxMapSize = 0xFFFFFFFFFFFF // 256TB
93++
94++// maxAllocSize is the size used when creating array pointers.
95++const maxAllocSize = 0x7FFFFFFF
96+--
97+2.54.0
98+ 
@@ -2,13 +2,14 @@
2 2 
3Name: openGemini3Name: openGemini
4Version: 1.0.04Version: 1.0.0
5-Release: 35+Release: 4
6Summary: An open source distributed time-series database with high concurrency, high performance, and high scalability6Summary: An open source distributed time-series database with high concurrency, high performance, and high scalability
7License: Apache 2.07License: Apache 2.0
8Group: Applications/Databases8Group: Applications/Databases
9URL: https://www.openGemini.org/9URL: https://www.openGemini.org/
10Source0: %{name}-%{version}.tar.gz10Source0: %{name}-%{version}.tar.gz
11Patch0: 0001-add-loong64-support.patch11Patch0: 0001-add-loong64-support.patch
12+Patch1: 0002-fix-build-error-on-loongarch64-for-openGemini.patch
12 13 
13BuildRequires: gcc,make,golang >= 1.1614BuildRequires: gcc,make,golang >= 1.16
14 15 
@@ -17,6 +18,7 @@ An open source distributed time-series database with high concurrency, high perf
17%prep18%prep
18%setup -q -n %{name}19%setup -q -n %{name}
19%patch0 -p120%patch0 -p1
21+%patch1 -p1
20 22 
21%build23%build
22# set up temporary build gopath, and put our directory there24# set up temporary build gopath, and put our directory there
@@ -59,6 +61,9 @@ install -p -m 0644 ./config/* %{buildroot}/etc/%{name}
59%dir /var/log/%{name}61%dir /var/log/%{name}
60 62 
61%changelog63%changelog
64+* Thu Jun 04 2026 Wenlong Zhang <zhangwenlong@loongson.cn> - 1.0.0-4
65+- fix build error on loongarch64 for openGemini
66+ 
62* Wed Dec 18 2024 FloatX <664712890@qq.com> - 1.0.0-367* Wed Dec 18 2024 FloatX <664712890@qq.com> - 1.0.0-3
63- Delete ts-cli68- Delete ts-cli
64 69