AlmaLinux changes: Update env var for v2

Disable race for riscv64
This commit is contained in:
Eduard Abdullin 2025-08-21 13:52:19 +00:00 committed by root
parent 25715f46ec
commit 27da6013cb

View File

@ -7,6 +7,11 @@
%bcond_with ignore_tests
%endif
%global race 1
%ifarch riscv64
%global race 0
%endif
# build ids are not currently generated:
# https://code.google.com/p/go/issues/detail?id=5238
#
@ -193,7 +198,9 @@ Provides: bundled(golang(golang.org/x/tools)) = 0.11.1.0.20230712164437.1ca21856
Requires: %{name}-bin = %{version}-%{release}
Requires: %{name}-src = %{version}-%{release}
%if %{race}
Requires: %{name}-race = %{version}-%{release}
%endif
Patch1: 0001-Modify-go.env.patch
Patch6: 0006-Default-to-ld.bfd-on-ARM64.patch
@ -395,6 +402,7 @@ tsan_go_dir="../llvm/compiler-rt-%{llvm_compiler_rt_version}.src/lib/tsan/go"
# by just reading GOARCH directly from Go.
export GOARCH=$(go env GOARCH)
%if %{race}
%ifarch x86_64
pushd "${tsan_go_dir}"
CFLAGS="%{tsan_buildflags} %{tsan_optflag}" CC=clang GOAMD64=v3 ./buildgo.sh
@ -412,6 +420,7 @@ pushd "${tsan_go_dir}"
popd
cp "${tsan_go_dir}"/race_linux_%{gohostarch}.syso ./src/runtime/race/race_linux_%{gohostarch}.syso
%endif
%endif
# bootstrap compiler GOROOT
%if !%{golang_bootstrap}
@ -457,7 +466,9 @@ popd
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std
%endif
%if %{race}
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std
%endif
%install
rm -rf $RPM_BUILD_ROOT
@ -665,12 +676,14 @@ fi
%{_sysconfdir}/prelink.conf.d
%files src -f go-src.list
%if %{race}
%ifarch x86_64
%exclude %{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso
%exclude %{goroot}/src/runtime/race/internal/amd64v3/race_linux.syso
%else
%exclude %{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
%endif
%endif
%files docs -f go-docs.list
@ -691,6 +704,7 @@ fi
%files -n go-toolset
%if %{race}
%files race
%ifarch x86_64
%{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso
@ -698,6 +712,7 @@ fi
%else
%{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
%endif
%endif
%changelog
%autochangelog