diff --git a/0001-golang1.21-not-support-plugin-buildmod-on-loong64.patch b/0001-golang1.21-not-support-plugin-buildmod-on-loong64.patch new file mode 100644 index 0000000000000000000000000000000000000000..53e7570d2c893550ff3352b42ead3540525819bf --- /dev/null +++ b/0001-golang1.21-not-support-plugin-buildmod-on-loong64.patch @@ -0,0 +1,54 @@ +From 1f08edd449e8d410bc4e5d001dc3b076c5a18f68 Mon Sep 17 00:00:00 2001 +From: Huang Yang +Date: Thu, 18 Apr 2024 07:12:12 +0000 +Subject: [PATCH] golang1.21 not support plugin buildmod on loong64 + +--- + Makefile | 2 +- + modules/server/profile/profile.go | 3 ++- + vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c | 2 +- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index cb1d16c..ff7e66b 100755 +--- a/Makefile ++++ b/Makefile +@@ -39,7 +39,7 @@ atuned: + go build -mod=vendor -v $(GOFLAGS) -o $(PKGPATH)/atuned cmd/atuned/*.go + + modules: +- cd ${CURDIR}/modules/server/profile/ && go build -mod=vendor -v $(GOFLAGS) -buildmode=plugin -o ${CURDIR}/pkg/daemon_profile_server.so *.go ++ cd ${CURDIR}/modules/server/profile/ && go build -mod=vendor -v $(GOFLAGS) -o ${CURDIR}/pkg/daemon_profile_server.so *.go + + clean: + rm -rf $(PKGPATH)/* +diff --git a/modules/server/profile/profile.go b/modules/server/profile/profile.go +index 2ce0a47..4b46245 100644 +--- a/modules/server/profile/profile.go ++++ b/modules/server/profile/profile.go +@@ -97,7 +97,8 @@ type ProfileServer struct { + ScriptPath string + Raw *ini.File + } +- ++func main() { ++ } + func init() { + svc := SVC.ProfileService{ + Name: "opt.profile", +diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +index 140d096..44d19f5 100644 +--- a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c ++++ b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +@@ -14000,7 +14000,7 @@ typedef INT16_TYPE LogEst; + # if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ + defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ + defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ +- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ++ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || defined(__loongarch64) + # define SQLITE_BYTEORDER 1234 + # elif defined(sparc) || defined(__ppc__) || \ + defined(__ARMEB__) || defined(__AARCH64EB__) +-- +2.43.0 + diff --git a/atune.spec b/atune.spec index 17d3048d34a3816e600a2c62878a19c4687321a7..31a3e93a9b404ad727c958be9a2c5802684e7d92 100755 --- a/atune.spec +++ b/atune.spec @@ -3,7 +3,7 @@ Summary: AI auto tuning system Name: atune Version: 1.2.0 -Release: 2 +Release: 3 License: MulanPSL-2.0 URL: https://gitee.com/openeuler/A-Tune Source: https://gitee.com/openeuler/A-Tune/repository/archive/v%{version}.tar.gz @@ -14,6 +14,7 @@ Patch9002: remove-the-installation-of-atune-ui-related-files.patch Patch9003: adjust-the-startup-sequence-of-atune-rest.patch Patch9004: import-os-for-app.py.patch Patch9005: adapt-sqlite-3.42-to-resolve-the-build-failure.patch +Patch9006: 0001-golang1.21-not-support-plugin-buildmod-on-loong64.patch BuildRequires: rpm-build golang-bin procps-ng BuildRequires: sqlite >= 3.24.0 openssl @@ -90,6 +91,16 @@ atune restful api for manage atuned AI tuning system. %patch9003 -p1 %patch9004 -p1 %patch9005 -p1 +%ifarch loongarch64 +%patch9006 -p1 +sed 's/go 1.14/go 1.21/g' -i go.mod +export GOSUMDB="sum.golang.org" +export GOPROXY="https://goproxy.cn" +go get -d golang.org/x/sys@v0.19.0 +go mod tidy +go mod download +go mod vendor +%endif %build %make_build @@ -190,6 +201,9 @@ atune restful api for manage atuned AI tuning system. %exclude /etc/atuned/rest_certs %changelog +* Thu Apr 18 2024 Huang Yang - 1.2.0-3 +- fix build error on loongarch64 + * Mon Mar 11 2024 zhoupengcheng - 1.2.0-2 - add import and fix build failure