Disable race for risv64
Resolves: RHEL-97549
This commit is contained in:
parent
890360e761
commit
c545c23036
20
golang.spec
20
golang.spec
@ -7,6 +7,14 @@
|
|||||||
%bcond_with ignore_tests
|
%bcond_with ignore_tests
|
||||||
%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
|
||||||
#
|
#
|
||||||
@ -197,7 +205,9 @@ 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}
|
||||||
Requires: %{name}-race = %{version}-%{release}
|
Requires: %{name}-race = %{version}-%{release}
|
||||||
|
%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
|
||||||
@ -330,12 +340,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
|
||||||
@ -396,6 +408,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}
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
pushd "${tsan_go_dir}"
|
pushd "${tsan_go_dir}"
|
||||||
CFLAGS="%{tsan_buildflags} %{tsan_optflag}" CC=clang GOAMD64=v3 ./buildgo.sh
|
CFLAGS="%{tsan_buildflags} %{tsan_optflag}" CC=clang GOAMD64=v3 ./buildgo.sh
|
||||||
@ -413,6 +426,7 @@ pushd "${tsan_go_dir}"
|
|||||||
popd
|
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
|
||||||
|
|
||||||
# bootstrap compiler GOROOT
|
# bootstrap compiler GOROOT
|
||||||
%if !%{golang_bootstrap}
|
%if !%{golang_bootstrap}
|
||||||
@ -462,7 +476,9 @@ 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}
|
||||||
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std
|
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
@ -672,12 +688,14 @@ fi
|
|||||||
%{_sysconfdir}/prelink.conf.d
|
%{_sysconfdir}/prelink.conf.d
|
||||||
|
|
||||||
%files src -f go-src.list
|
%files src -f go-src.list
|
||||||
|
%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
|
||||||
%else
|
%else
|
||||||
%exclude %{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
|
%exclude %{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%files docs -f go-docs.list
|
%files docs -f go-docs.list
|
||||||
|
|
||||||
@ -698,6 +716,7 @@ fi
|
|||||||
|
|
||||||
%files -n go-toolset
|
%files -n go-toolset
|
||||||
|
|
||||||
|
%if %{race}
|
||||||
%files race
|
%files race
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
%{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso
|
%{goroot}/src/runtime/race/internal/amd64v1/race_linux.syso
|
||||||
@ -705,6 +724,7 @@ fi
|
|||||||
%else
|
%else
|
||||||
%{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
|
%{goroot}/src/runtime/race/race_linux_%{gohostarch}.syso
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
%autochangelog
|
%autochangelog
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user