From 3e648b05a528ad832e4819b61cf49e79a4d84109 Mon Sep 17 00:00:00 2001 From: herengui Date: Thu, 10 Aug 2023 15:47:54 +0800 Subject: [PATCH] add sw_64 support Signed-off-by: herengui --- apply-patch | 4 ++++ containerd.spec | 17 ++++++++++++++++- patch/3000-bbolt-add-support-sw_64.patch | 16 ++++++++++++++++ series.conf | 2 ++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 patch/3000-bbolt-add-support-sw_64.patch diff --git a/apply-patch b/apply-patch index 3a9f525..df693aa 100755 --- a/apply-patch +++ b/apply-patch @@ -30,6 +30,10 @@ do if [[ "$line" =~ ^patch* ]]; then echo git apply $cwd/$line cd $src && git apply $cwd/$line + elif test "$(arch)" == "sw_64" && [[ "$line" =~ ^sw64_patch* ]]; then + line=${line/#sw64_patch\//patch\/} + echo git apply "$cwd/$line" + cd "$src" && git apply "$cwd/$line" fi done <"$series" diff --git a/containerd.spec b/containerd.spec index f040785..7cd8c00 100644 --- a/containerd.spec +++ b/containerd.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} Version: 1.2.0 Name: containerd -Release: 311 +Release: 312 Summary: An industry-standard container runtime License: ASL 2.0 URL: https://containerd.io @@ -41,6 +41,12 @@ tar -xf %{SOURCE6} -C vendor/golang.org/x/ tar -xf %{SOURCE7} -C vendor/golang.org/x/ %endif +%ifarch sw_64 +cp -af %{_prefix}/lib/golang/src/cmd/vendor/golang.org/x/sys vendor/golang.org/x/ +sed -i '/AAFS_MAGIC/aTIOCSWINSZ = 0x80087467' vendor/golang.org/x/sys/unix/zerrors_linux_sw64.go +sed -i '/SIGABRT /aSIGSTKFLT = syscall.Signal(0x10)' vendor/golang.org/x/sys/unix/zerrors_linux_sw64.go +%endif + GO_BUILD_PATH=$PWD/_build install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath}) ln -fs $PWD $GO_BUILD_PATH/src/%{goipath} @@ -48,6 +54,9 @@ cd $GO_BUILD_PATH/src/%{goipath} export GO111MODULE=off export GOPATH=$GO_BUILD_PATH:%{gopath} export BUILDTAGS="no_btrfs no_cri" +%ifarch sw_64 +sed -i 's/-buildmode=pie/-buildmode=exe/g' `grep buildmode=pie -rl .` +%endif make strip ./bin/containerd ./bin/containerd-shim ./bin/ctr @@ -63,6 +72,12 @@ install -p -m 755 bin/ctr $RPM_BUILD_ROOT/%{_bindir}/ctr %{_bindir}/ctr %changelog +* Thu Aug 10 2023 herengui - 1.2.0-312 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:add sw_64 support + * Sat Jun 17 2023 zhongjiawei - 1.2.0-311 - Type:bugfix - ID:NA diff --git a/patch/3000-bbolt-add-support-sw_64.patch b/patch/3000-bbolt-add-support-sw_64.patch new file mode 100644 index 0000000..38056ba --- /dev/null +++ b/patch/3000-bbolt-add-support-sw_64.patch @@ -0,0 +1,16 @@ +diff -Naur etcd-3.4.14.org/vendor/go.etcd.io/bbolt/bolt_sw64.go etcd-3.4.14.sw/vendor/go.etcd.io/bbolt/bolt_sw64.go +--- etcd-3.4.14.org/vendor/go.etcd.io/bbolt/bolt_sw64.go 1970-01-01 08:00:00.000000000 +0800 ++++ etcd-3.4.14.sw/vendor/go.etcd.io/bbolt/bolt_sw64.go 2022-09-16 15:23:18.290000000 +0800 +@@ -0,0 +1,12 @@ ++// +build sw64 ++ ++package bbolt ++ ++// maxMapSize represents the largest mmap size supported by Bolt. ++const maxMapSize = 0xFFFFFFFFFFFF // 256TB ++ ++// maxAllocSize is the size used when creating array pointers. ++const maxAllocSize = 0x7FFFFFFF ++ ++// Are unaligned load/stores broken on this arch? ++var brokenUnaligned = false diff --git a/series.conf b/series.conf index fd4b34d..2334abf 100644 --- a/series.conf +++ b/series.conf @@ -103,4 +103,6 @@ patch/0095-oci-fix-additional-GIDs.patch patch/0096-importer-stream-oci-layout-and-manifest.json.patch patch/0001-containerd-add-blot-symbol-to-support-loong64.patch patch/0097-containerd-fix-journald-stop-container-shim-log-stuc.patch +# sw_64 +sw64_patch/3000-bbolt-add-support-sw_64.patch # end -- Gitee