From 76efff603fdf96b6e99b7cc05d05eb32921ca1f2 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Fri, 30 Dec 2022 15:01:35 +0800 Subject: [PATCH] add loong64 support for buildah Signed-off-by: Wenlong Zhang --- 0001-add-loong64-support-for-etcd.patch | 29 +++++++++++++++++++++++++ buildah.spec | 12 +++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0001-add-loong64-support-for-etcd.patch diff --git a/0001-add-loong64-support-for-etcd.patch b/0001-add-loong64-support-for-etcd.patch new file mode 100644 index 0000000..bb6f9f5 --- /dev/null +++ b/0001-add-loong64-support-for-etcd.patch @@ -0,0 +1,29 @@ +From e6fea3042b3b9f9986ce9e19c730b2bd3d3eaa05 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Fri, 30 Dec 2022 06:22:44 +0000 +Subject: [PATCH] add loong64 support for etcd + +--- + vendor/go.etcd.io/bbolt/bolt_loong64.go | 10 ++++++++++ + 1 file changed, 10 insertions(+) + create mode 100644 vendor/go.etcd.io/bbolt/bolt_loong64.go + +diff --git a/vendor/go.etcd.io/bbolt/bolt_loong64.go b/vendor/go.etcd.io/bbolt/bolt_loong64.go +new file mode 100644 +index 0000000..d02d59e +--- /dev/null ++++ b/vendor/go.etcd.io/bbolt/bolt_loong64.go +@@ -0,0 +1,10 @@ ++// +build loong64 ++ ++package bbolt ++ ++// maxMapSize represents the largest mmap size supported by Bolt. ++const maxMapSize = 0x8000000000 // 512GB ++ ++// maxAllocSize is the size used when creating array pointers. ++const maxAllocSize = 0x7FFFFFFF ++ +-- +2.27.0 + diff --git a/buildah.spec b/buildah.spec index 9cfb8df..97e8822 100644 --- a/buildah.spec +++ b/buildah.spec @@ -1,9 +1,14 @@ %global _find_debuginfo_dwz_opts %{nil} %global _dwz_low_mem_die_limit 0 +%global anolis_release .0.1 %if 0%{?rhel} > 7 && ! 0%{?fedora} +%ifarch loongarch64 %define gobuild(o:) \ +go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v %{?**}; +%else go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v %{?**}; +%endif %else %if ! 0%{?gobuild:1} %define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v %{?**}; @@ -18,7 +23,7 @@ go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl Epoch: 1 Name: buildah Version: 1.26.2 -Release: 1%{?dist} +Release: 1%{anolis_release}%{?dist} Summary: A command line tool used for creating OCI Images License: ASL 2.0 URL: https://%{name}.io @@ -29,6 +34,8 @@ Source0: https://%{import_path}/tarball/%{commit0}/%{branch}-%{shortcommit0}.tar %else Source0: https://%{import_path}/archive/%{commit0}/%{name}-%{version}-%{shortcommit0}.tar.gz %endif + +Patch001: 0001-add-loong64-support-for-etcd.patch BuildRequires: golang >= 1.17.7 BuildRequires: git BuildRequires: glib2-devel @@ -132,6 +139,9 @@ make DESTDIR=%{buildroot} PREFIX=%{_prefix} -C docs install %{_datadir}/%{name}/test %changelog +*Fri Dec 30 2022 Wenlong Zhang - 20.10.16-2.0.1 +- add loong64 support for buildah + * Thu Jul 07 2022 Jindrich Novy - 1:1.26.2-1 - update to https://github.com/containers/buildah/releases/tag/v1.26.2 - Related: #2061390 -- Gitee