Conditionalize baseline ISA

Related: RHEL-175604
This commit is contained in:
dbenoit 2026-05-13 11:26:53 -04:00
parent 1f69623fe7
commit dd8136324c

View File

@ -99,6 +99,20 @@
%global gohostarch riscv64
%endif
# Set the RHEL architecture baseline.
%if 0%{?rhel} < 9
%global goamd64 v1
%global goppc64 power8
%else
%if 0%{?rhel} < 10
%global goamd64 v2
%global goppc64 power8
%else
%global goamd64 v3
%global goppc64 power9
%endif
%endif
%global go_api 1.26
# Use only for prerelease versions
#global go_prerelease rc3
@ -342,6 +356,14 @@ Binary library objects for Go's race detector.
# Copy fedora.go to ./src/runtime/
cp %{SOURCE2} ./src/runtime/
sed -i '1s/$/ (%{?rhel:Red Hat} %{version}-%{release})/' VERSION
# Historically the ISA baselines have been set in modify-go.env.patch.
# This will prevent us sharing a specfile across major RHEL versions.
# As such, we must override the baselines set in the patch file.
sed -iE "s/^.*baseline for RHEL.*$//" go.env
sed -i "s/GOAMD64=.*/GOAMD64=%{goamd64}/" go.env
sed -i "s/GOPPC64=.*/GOPPC64=%{goppc64}/" go.env
# Delete the bundled race detector objects.
find ./src/runtime/race/ -name "race_*.syso" -exec rm {} \;
# Delete the boring binary blob. We use the system OpenSSL instead.