From 515c8518eaa12b5877dc5278c995cd987e8b8ef9 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Tue, 16 Nov 2021 21:37:19 +0800 Subject: [PATCH 1/2] build: support loongarch64 platform Signed-off-by: Liwei Ge --- go-compilers.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/go-compilers.spec b/go-compilers.spec index 5c97914..230caa7 100644 --- a/go-compilers.spec +++ b/go-compilers.spec @@ -1,13 +1,14 @@ +%define anolis_release .0.1 Name: go-compilers Version: 1 -Release: 20%{?dist} +Release: 20%{anolis_release}%{?dist} Summary: Go language compilers for various architectures Group: Development/Tools License: GPLv3+ Source0: macros.golang-compiler # FIXME: This is defined in go-srpm-macros why do we need it here? -%global go_arches x86_64 aarch64 ppc64le s390x %{ix86} +%global go_arches x86_64 aarch64 ppc64le s390x %{ix86} loongarch64 ExclusiveArch: %{go_arches} # for install, cut and rm commands @@ -49,6 +50,9 @@ install -m 644 -D %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.golang %endif %changelog +* Tue Nov 16 2021 Liwei Ge - 1-20.0.1 +- Support loongarch64 platform + * Fri Dec 21 2018 Tom Stellard - 1-20 - Add -compressdwarf=false to ldflags -- Gitee From d92b8875af2707ff8392dbc951cc4ed0c42fa314 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Thu, 18 Nov 2021 19:53:37 +0800 Subject: [PATCH 2/2] macros: disable pie buildmode for loongarch64 Signed-off-by: Liwei Ge --- go-compilers.spec | 5 ++++- macros.golang-compiler | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/go-compilers.spec b/go-compilers.spec index 230caa7..acb41c5 100644 --- a/go-compilers.spec +++ b/go-compilers.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 Name: go-compilers Version: 1 Release: 20%{anolis_release}%{?dist} @@ -50,6 +50,9 @@ install -m 644 -D %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.golang %endif %changelog +* Thu Nov 18 2021 Liwei Ge - 1-20.0.2 +- Disable pie buildmode for loongarch64 + * Tue Nov 16 2021 Liwei Ge - 1-20.0.1 - Support loongarch64 platform diff --git a/macros.golang-compiler b/macros.golang-compiler index 689e6d1..2a1f6d7 100644 --- a/macros.golang-compiler +++ b/macros.golang-compiler @@ -8,7 +8,7 @@ # Define commands for building # BUILD_ID can be generated for golang build no matter of debuginfo %gobuild(o:) \ -%ifnarch ppc64 \ +%ifnarch ppc64 loongarch64\ go build -buildmode pie -compiler gc -tags=rpm_crashtraceback -ldflags "-compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};\ %else \ go build -compiler gc -tags=rpm_crashtraceback -ldflags "-compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};\ -- Gitee