Accepting request 1079835 from devel:languages:go
- Add subpackage go1.x-libstd for compiled shared object libstd.so. only on Tumbleweed at this time. * Main go1.x package included libstd.so in previous versions * Split libstd.so into subpackage that can be installed standalone * Continues the slimming down of main go1.x package by 40 Mb * Experimental and not recommended for general use, Go currently has no ABI * Upstream Go has not committed to support buildmode=shared long-term * Do not use in packaging, build static single binaries (the default) * Upstream Go go1.x binary releases do not include libstd.so * go1.x Suggests go1.x-libstd so not installed by default Recommends * go1.x-libstd does not Require: go1.x so can install standalone * Provides go-libstd unversioned package name * Fix build step -buildmode=shared std to omit -linkshared - Packaging improvements: * go1.x Suggests go1.x-doc so not installed by default Recommends * Use Group: Development/Languages/Go instead of Other * On Tumbleweed bootstrap with current default gcc13 and gccgo118 * On SLE-12 aarch64 ppc64le ppc64 remove overrides to bootstrap using go1.x package (%bcond_without gccgo). This is no longer needed on current SLE-12:Update and removing will consolidate the build configurations used. * Change source URLs to go.dev as per Go upstream * On x86_64 export GOAMD64=v1 as per the current baseline. At this time forgo GOAMD64=v3 option for x86_64_v3 support. * On x86_64 %define go_amd64=v1 as current instruction baseline (forwarded request 1079834 from jfkw) OBS-URL: https://build.opensuse.org/request/show/1079835 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/go1.18?expand=0&rev=22
This commit is contained in:
commit
ca166c0b72
@ -1,3 +1,44 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 14 23:41:22 UTC 2023 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
||||||
|
|
||||||
|
- Build subpackage go1.x-libstd compiled shared object libstd.so
|
||||||
|
only on Tumbleweed at this time.
|
||||||
|
Refs jsc#PED-1962
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 14 23:20:06 UTC 2023 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
||||||
|
|
||||||
|
- Add subpackage go1.x-libstd for compiled shared object libstd.so.
|
||||||
|
Refs jsc#PED-1962
|
||||||
|
* Main go1.x package included libstd.so in previous versions
|
||||||
|
* Split libstd.so into subpackage that can be installed standalone
|
||||||
|
* Continues the slimming down of main go1.x package by 40 Mb
|
||||||
|
* Experimental and not recommended for general use, Go currently has no ABI
|
||||||
|
* Upstream Go has not committed to support buildmode=shared long-term
|
||||||
|
* Do not use in packaging, build static single binaries (the default)
|
||||||
|
* Upstream Go go1.x binary releases do not include libstd.so
|
||||||
|
* go1.x Suggests go1.x-libstd so not installed by default Recommends
|
||||||
|
* go1.x-libstd does not Require: go1.x so can install standalone
|
||||||
|
* Provides go-libstd unversioned package name
|
||||||
|
* Fix build step -buildmode=shared std to omit -linkshared
|
||||||
|
- Packaging improvements:
|
||||||
|
* go1.x Suggests go1.x-doc so not installed by default Recommends
|
||||||
|
* Use Group: Development/Languages/Go instead of Other
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 14 23:06:51 UTC 2023 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
||||||
|
|
||||||
|
- Improvements to go1.x packaging spec:
|
||||||
|
* On Tumbleweed bootstrap with current default gcc13 and gccgo118
|
||||||
|
* On SLE-12 aarch64 ppc64le ppc64 remove overrides to bootstrap
|
||||||
|
using go1.x package (%bcond_without gccgo). This is no longer
|
||||||
|
needed on current SLE-12:Update and removing will consolidate
|
||||||
|
the build configurations used.
|
||||||
|
* Change source URLs to go.dev as per Go upstream
|
||||||
|
* On x86_64 export GOAMD64=v1 as per the current baseline.
|
||||||
|
At this time forgo GOAMD64=v3 option for x86_64_v3 support.
|
||||||
|
* On x86_64 %define go_amd64=v1 as current instruction baseline
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Apr 13 04:58:20 UTC 2023 - Martin Liška <mliska@suse.cz>
|
Thu Apr 13 04:58:20 UTC 2023 - Martin Liška <mliska@suse.cz>
|
||||||
|
|
||||||
|
99
go1.18.spec
99
go1.18.spec
@ -24,29 +24,25 @@
|
|||||||
%undefine _build_create_debug
|
%undefine _build_create_debug
|
||||||
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true NO_BRP_AR=true
|
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true NO_BRP_AR=true
|
||||||
|
|
||||||
# Used to bootstrap go toolchain with specific existing package
|
# Specify Go toolchain version used to bootstrap this package's Go toolchain
|
||||||
%define go_bootstrap_version go1.16
|
# go_bootstrap_version bootstrap go toolchain with specific existing go1.x package
|
||||||
|
# gcc_go_version bootstrap go toolchain with specific version of gcc-go
|
||||||
# Used to bootstrap go toolchain using specific version of gcc-go
|
|
||||||
%if 0%{?suse_version} > 1500
|
%if 0%{?suse_version} > 1500
|
||||||
# openSUSE Tumbleweed
|
# openSUSE Tumbleweed
|
||||||
|
# Usually ahead of bootstrap version specified by upstream Go
|
||||||
|
# Use Tumbleweed default gccgo and N-1 go1.x for testing
|
||||||
%define gcc_go_version 13
|
%define gcc_go_version 13
|
||||||
|
%define go_bootstrap_version go1.17
|
||||||
%else
|
%else
|
||||||
|
# Use gccgo and go1.x specified by upstream Go
|
||||||
%define gcc_go_version 11
|
%define gcc_go_version 11
|
||||||
|
%define go_bootstrap_version go1.17
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Bootstrap go toolchain using existing go package go_bootstrap_version
|
# Bootstrap go toolchain using existing go package go_bootstrap_version
|
||||||
# To bootstrap using gccgo use '--with gccgo'
|
# To bootstrap using gccgo use '--with gccgo'
|
||||||
%bcond_with gccgo
|
%bcond_with gccgo
|
||||||
|
|
||||||
# Boostrapping using existing go package can fail on certain SLE-12 architectures
|
|
||||||
# Override here as needed
|
|
||||||
%if 0%{?suse_version} == 1315
|
|
||||||
%ifarch aarch64 ppc64le ppc64 s390x
|
|
||||||
%bcond_without gccgo
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# gccgo on ppc64le with default PIE enabled fails with:
|
# gccgo on ppc64le with default PIE enabled fails with:
|
||||||
# error while loading shared libraries:
|
# error while loading shared libraries:
|
||||||
# R_PPC64_ADDR16_HA re10143fb0c for symbol `' out of range
|
# R_PPC64_ADDR16_HA re10143fb0c for symbol `' out of range
|
||||||
@ -58,9 +54,7 @@
|
|||||||
#!BuildIgnore: gcc-PIE
|
#!BuildIgnore: gcc-PIE
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Build go-race only on platforms where it's supported (both amd64 and aarch64
|
# Build go-race only on platforms where C++14 is supported (SLE-15)
|
||||||
# requires SLE15-or-later because of C++14, and ppc64le doesn't build at all
|
|
||||||
# on openSUSE yet).
|
|
||||||
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 150000
|
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 150000
|
||||||
%define tsan_arch x86_64 aarch64
|
%define tsan_arch x86_64 aarch64
|
||||||
%else
|
%else
|
||||||
@ -113,6 +107,8 @@
|
|||||||
%endif
|
%endif
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
%define go_arch amd64
|
%define go_arch amd64
|
||||||
|
# set GOAMD64 consistently
|
||||||
|
%define go_amd64 v1
|
||||||
%endif
|
%endif
|
||||||
%ifarch aarch64
|
%ifarch aarch64
|
||||||
%define go_arch arm64
|
%define go_arch arm64
|
||||||
@ -138,13 +134,15 @@ Version: 1.18.10
|
|||||||
Release: 0
|
Release: 0
|
||||||
Summary: A compiled, garbage-collected, concurrent programming language
|
Summary: A compiled, garbage-collected, concurrent programming language
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: Development/Languages/Other
|
Group: Development/Languages/Go
|
||||||
URL: http://golang.org
|
URL: https://go.dev/
|
||||||
Source: http://golang.org/dl/go%{version}.src.tar.gz
|
Source: https://go.dev/dl/go%{version}.src.tar.gz
|
||||||
Source1: go-rpmlintrc
|
Source1: go-rpmlintrc
|
||||||
Source4: README.SUSE
|
Source4: README.SUSE
|
||||||
Source6: go.gdbinit
|
Source6: go.gdbinit
|
||||||
# We have to compile TSAN ourselves. boo#1052528
|
# We have to compile TSAN ourselves. boo#1052528
|
||||||
|
# Preferred form when all arches share llvm race version
|
||||||
|
# Source100: llvm-%{tsan_commit}.tar.xz
|
||||||
Source100: llvm-%{tsan_commit}.tar.xz
|
Source100: llvm-%{tsan_commit}.tar.xz
|
||||||
# PATCH-FIX-OPENSUSE: https://go-review.googlesource.com/c/go/+/391115
|
# PATCH-FIX-OPENSUSE: https://go-review.googlesource.com/c/go/+/391115
|
||||||
Patch7: dont-force-gold-on-arm64.patch
|
Patch7: dont-force-gold-on-arm64.patch
|
||||||
@ -162,7 +160,11 @@ BuildRequires: gcc%{gcc_go_version}-go
|
|||||||
BuildRequires: %{go_bootstrap_version}
|
BuildRequires: %{go_bootstrap_version}
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
Recommends: %{name}-doc = %{version}
|
Suggests: %{name}-doc = %{version}
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
# openSUSE Tumbleweed
|
||||||
|
Suggests: %{name}-libstd = %{version}
|
||||||
|
%endif
|
||||||
%ifarch %{tsan_arch}
|
%ifarch %{tsan_arch}
|
||||||
# Needed to compile compiler-rt/TSAN.
|
# Needed to compile compiler-rt/TSAN.
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -192,7 +194,6 @@ safety of a static language.
|
|||||||
%package doc
|
%package doc
|
||||||
Summary: Go documentation
|
Summary: Go documentation
|
||||||
Group: Documentation/Other
|
Group: Documentation/Other
|
||||||
Requires: %{name} = %{version}
|
|
||||||
Provides: go-doc = %{version}
|
Provides: go-doc = %{version}
|
||||||
|
|
||||||
%description doc
|
%description doc
|
||||||
@ -202,7 +203,7 @@ Go examples and documentation.
|
|||||||
# boo#1052528
|
# boo#1052528
|
||||||
%package race
|
%package race
|
||||||
Summary: Go runtime race detector
|
Summary: Go runtime race detector
|
||||||
Group: Development/Languages/Other
|
Group: Development/Languages/Go
|
||||||
URL: https://compiler-rt.llvm.org/
|
URL: https://compiler-rt.llvm.org/
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}
|
||||||
Supplements: %{name} = %{version}
|
Supplements: %{name} = %{version}
|
||||||
@ -213,11 +214,25 @@ Go runtime race detector libraries. Install this package if you wish to use the
|
|||||||
-race option, in order to detect race conditions present in your Go programs.
|
-race option, in order to detect race conditions present in your Go programs.
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with_shared}
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
# openSUSE Tumbleweed
|
||||||
|
%package libstd
|
||||||
|
Summary: Go compiled shared library libstd.so
|
||||||
|
Group: Development/Languages/Go
|
||||||
|
Provides: go-libstd = %{version}
|
||||||
|
|
||||||
|
%description libstd
|
||||||
|
Go standard library compiled to a dynamically loadable shared object libstd.so
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%ifarch %{tsan_arch}
|
%ifarch %{tsan_arch}
|
||||||
# compiler-rt (from LLVM)
|
# compiler-rt (from LLVM)
|
||||||
%setup -q -T -b 100 -n llvm-%{tsan_commit}
|
%setup -q -T -b 100 -n llvm-%{tsan_commit}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# go
|
# go
|
||||||
%setup -q -n go
|
%setup -q -n go
|
||||||
%patch7 -p1
|
%patch7 -p1
|
||||||
@ -265,6 +280,10 @@ export GOARM=6
|
|||||||
export GOARCH=arm
|
export GOARCH=arm
|
||||||
export GOARM=7
|
export GOARM=7
|
||||||
%endif
|
%endif
|
||||||
|
%ifarch x86_64 %{?x86_64}
|
||||||
|
# use the baseline defined above. Other option is GOAMD64=v3 for x86_64_v3 support
|
||||||
|
export GOAMD64=%go_amd64
|
||||||
|
%endif
|
||||||
export GOROOT="`pwd`"
|
export GOROOT="`pwd`"
|
||||||
export GOROOT_FINAL=%{_libdir}/go/%{go_label}
|
export GOROOT_FINAL=%{_libdir}/go/%{go_label}
|
||||||
export GOBIN="$GOROOT/bin"
|
export GOBIN="$GOROOT/bin"
|
||||||
@ -279,7 +298,25 @@ bin/go install -race std
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_shared}
|
%if %{with_shared}
|
||||||
bin/go install -buildmode=shared -linkshared std
|
%if 0%{?suse_version} > 1500
|
||||||
|
# openSUSE Tumbleweed
|
||||||
|
# Compile Go standard library as a dynamically loaded shared object libstd.so
|
||||||
|
# for inclusion in a subpackage which can be installed standalone.
|
||||||
|
# Upstream Go binary releases do not ship a compiled libstd.so.
|
||||||
|
# Standard practice is to build Go binaries as a single executable.
|
||||||
|
# Upstream Go discussed removing this feature, opted to fix current support:
|
||||||
|
# Relevant upstream comments on: https://github.com/golang/go/issues/47788
|
||||||
|
#
|
||||||
|
# -buildmode=shared
|
||||||
|
# Combine all the listed non-main packages into a single shared
|
||||||
|
# library that will be used when building with the -linkshared
|
||||||
|
# option. Packages named main are ignored.
|
||||||
|
#
|
||||||
|
# -linkshared
|
||||||
|
# build code that will be linked against shared libraries previously
|
||||||
|
# created with -buildmode=shared.
|
||||||
|
bin/go install -buildmode=shared std
|
||||||
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -402,8 +439,16 @@ fi
|
|||||||
%exclude %{_datadir}/go/%{go_label}/src/runtime/race/race_linux_%{go_arch}.syso
|
%exclude %{_datadir}/go/%{go_label}/src/runtime/race/race_linux_%{go_arch}.syso
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# We don't include libstd.so in the main Go package.
|
||||||
|
%if %{with_shared}
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
# openSUSE Tumbleweed
|
||||||
|
# ./go/1.20/pkg/linux_amd64_dynlink/libstd.so
|
||||||
|
%exclude %{_libdir}/go/%{go_label}/pkg/linux_%{go_arch}_dynlink/libstd.so
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%files doc
|
%files doc
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%doc %{_docdir}/go/%{go_label}/*.html
|
%doc %{_docdir}/go/%{go_label}/*.html
|
||||||
|
|
||||||
%ifarch %{tsan_arch}
|
%ifarch %{tsan_arch}
|
||||||
@ -411,4 +456,12 @@ fi
|
|||||||
%{_datadir}/go/%{go_label}/src/runtime/race/race_linux_%{go_arch}.syso
|
%{_datadir}/go/%{go_label}/src/runtime/race/race_linux_%{go_arch}.syso
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with_shared}
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
# openSUSE Tumbleweed
|
||||||
|
%files libstd
|
||||||
|
%{_libdir}/go/%{go_label}/pkg/linux_%{go_arch}_dynlink/libstd.so
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user