AlmaLinux changes: Update env var for v2

Disable race for riscv64
This commit is contained in:
Eduard Abdullin 2025-09-12 01:46:14 +00:00 committed by root
commit 60c6a86791

View File

@ -12,6 +12,14 @@
%global race 0 %global race 0
%endif %endif
# Enable race by default
%global race 1
# Disable race on riscv64 as it's not supported
%ifarch riscv64
%global race 0
%endif
# build ids are not currently generated: # build ids are not currently generated:
# https://code.google.com/p/go/issues/detail?id=5238 # https://code.google.com/p/go/issues/detail?id=5238
# #
@ -203,8 +211,10 @@ Provides: bundled(golang(rsc.io/markdown)) = 0.0.0.20240306144322.0bf8f97ee8ef
Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-bin = %{version}-%{release}
Requires: %{name}-src = %{version}-%{release} Requires: %{name}-src = %{version}-%{release}
%if %{race} %if %{race}
%if %{race}
Requires: %{name}-race = %{version}-%{release} Requires: %{name}-race = %{version}-%{release}
%endif %endif
%endif
Patch1: 0001-Modify-go.env.patch Patch1: 0001-Modify-go.env.patch
Patch6: 0006-Default-to-ld.bfd-on-ARM64.patch Patch6: 0006-Default-to-ld.bfd-on-ARM64.patch
@ -337,12 +347,14 @@ Requires: delve
%description -n go-toolset %description -n go-toolset
This is the main package for go-toolset. This is the main package for go-toolset.
%if %{race}
%package race %package race
Summary: Race detetector library object files. Summary: Race detetector library object files.
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
%description race %description race
Binary library objects for Go's race detector. Binary library objects for Go's race detector.
%endif
%prep %prep
@ -408,6 +420,7 @@ tsan_go_dir="../llvm/compiler-rt-%{llvm_compiler_rt_version}.src/lib/tsan/go"
# by just reading GOARCH directly from Go. # by just reading GOARCH directly from Go.
export GOARCH=$(go env GOARCH) export GOARCH=$(go env GOARCH)
%if %{race}
%if %{race} %if %{race}
%ifarch x86_64 %ifarch x86_64
pushd "${tsan_go_dir}" pushd "${tsan_go_dir}"
@ -435,6 +448,7 @@ popd
cp "${tsan_go_dir}"/race_linux_%{gohostarch}.syso ./src/runtime/race/race_linux_%{gohostarch}.syso cp "${tsan_go_dir}"/race_linux_%{gohostarch}.syso ./src/runtime/race/race_linux_%{gohostarch}.syso
%endif %endif
%endif %endif
%endif
# bootstrap compiler GOROOT # bootstrap compiler GOROOT
%if !%{golang_bootstrap} %if !%{golang_bootstrap}
@ -492,9 +506,11 @@ popd
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std
%endif %endif
%if %{race}
%if %{race} %if %{race}
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std
%endif %endif
%endif
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -709,6 +725,7 @@ fi
%files src -f go-src.list %files src -f go-src.list
%if %{race} %if %{race}
%if %{race}
%ifarch x86_64 %ifarch x86_64
%exclude %{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso %exclude %{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso
%exclude %{goroot}/src/runtime/race/internal/amd64v3/race_linux.syso %exclude %{goroot}/src/runtime/race/internal/amd64v3/race_linux.syso
@ -716,6 +733,7 @@ fi
%exclude %{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso %exclude %{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
%endif %endif
%endif %endif
%endif
%files docs -f go-docs.list %files docs -f go-docs.list
@ -736,6 +754,7 @@ fi
%files -n go-toolset %files -n go-toolset
%if %{race}
%if %{race} %if %{race}
%files race %files race
%ifarch x86_64 %ifarch x86_64
@ -745,6 +764,7 @@ fi
%{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso %{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
%endif %endif
%endif %endif
%endif
%changelog %changelog
%autochangelog %autochangelog