From c4b9412a2f7d34e2c4892fb00a6a80a45e7ee59b Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Thu, 28 Mar 2024 17:19:47 +0300 Subject: [PATCH] import go-rpm-macros-3.2.0-3.el9 --- SOURCES/add-gobuild-and-gotest.patch | 6 ++++-- SPECS/go-rpm-macros.spec | 14 +++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/SOURCES/add-gobuild-and-gotest.patch b/SOURCES/add-gobuild-and-gotest.patch index d54f6df..77c06b4 100644 --- a/SOURCES/add-gobuild-and-gotest.patch +++ b/SOURCES/add-gobuild-and-gotest.patch @@ -1,12 +1,14 @@ From 1001f5a99439556c5ad3efe6045923e985a52f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= -Date: Wed, 23 Nov 2022 13:43:23 +0100 +Date: Wed, 22 Sep 2023 12:00:00 +0100 Subject: [PATCH] Add %gobuild and %gotest Both macros are define in rpm/macros.d/macros.go-compilers-gcc. CentOS Stream 9 go-srpm-macros discards that file and only installs rpm/macros.d/macros.go-srpm. This commit adds %gobuild and %gotest to rpm/macros.d/macros.go-srpm with the same options that RHEL 8 uses. + +This also sets the base ISA for x86_64 and Power. --- rpm/macros.d/macros.go-srpm | 8 ++++++++ 1 file changed, 8 insertions(+) @@ -23,7 +25,7 @@ index a46f81f..05cd6c9 100644 +# Define commands for building +# BUILD_ID can be generated for golang build no matter of debuginfo +%gobuild(o:) \ -+CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" go build -compiler gc -buildmode pie '-tags=rpm_crashtraceback libtrust_openssl ' -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};\ ++GOPPC64=power9 GOAMD64=v2 CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" go build -compiler gc -buildmode pie '-tags=rpm_crashtraceback libtrust_openssl ' -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};\ + +# Define commands for testing +%gotest() go test -compiler gc -ldflags "${LDFLAGS:-}" %{?**}; diff --git a/SPECS/go-rpm-macros.spec b/SPECS/go-rpm-macros.spec index b9b1e7e..8c6c425 100644 --- a/SPECS/go-rpm-macros.spec +++ b/SPECS/go-rpm-macros.spec @@ -36,7 +36,7 @@ Version: 3.2.0 ExclusiveArch: %{golang_arches} %{gccgo_arches} Name: go-rpm-macros -Release: 2%{?dist}.inferit.1 +Release: 3%{?dist}.inferit Summary: Build-stage rpm automation for Go packages License: GPLv3+ @@ -78,7 +78,9 @@ Patch1: golist-bootstrap-cli-no-vendor.patch # RHEL 8 only provides the macros.go-srpm file which includes gobuild and gotest. # C9S also only provides the macros.go-srpm file but it also follows upstream which includes gobuild and gotest in the macros.go-compilers-gcc. # For a simple fix, this patch ports both RHEL 8 macros to macros.go-srpm. +# This also sets the GOAMD64 variable to v2 # Resolves: rhbz#1965292 +# Resolves: RHEL-5529 Patch2: add-gobuild-and-gotest.patch %description @@ -251,11 +253,13 @@ sed -i "s,golist,%{golist_execdir}/golist,g" %{buildroot}%{_bindir}/go-rpm-integ %{_spectemplatedir}/*.spec %changelog -* Sun Jan 28 2024 Arkady L. Shane - 3.2.0-2.inferit.1 -- Revert i686 adding +<<<<<<< HEAD +* Sun Jan 28 2024 Arkady L. Shane - 3.2.0-3.inferit +- Drop ix86 arch from exclusive -* Tue Jan 16 2024 Arkady L. Shane - 3.2.0-2.inferit -- Added i686 to exclusive arches +* Fri Sep 22 2023 Alejandro Sáez - 3.2.0-3 +- Update add-gobuild-and-gotest.patch to add GOPPC64 and GOAMD64 +- Resolves: RHEL-5529 * Fri Jul 28 2023 Alejandro Sáez - 3.2.0-2 - Add golang_arches_future