Sync from SUSE:SLFO:Main go1.17 revision eb2a9ebb00d9ad82ac8bff849149d6e2

This commit is contained in:
Adrian Schröter 2024-05-03 13:05:36 +02:00
commit 3c4f478495
11 changed files with 1376 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

120
README.SUSE Normal file
View File

@ -0,0 +1,120 @@
Updated: 05.05.2012
Authors: Graham Anderson, <graham@andtech.eu>
PROJECT DETAILS
---------------
OBS: https://build.opensuse.org/project/show?project=devel:languages:go
Maintainers: Sascha Peilicke (saschpe),
Graham Anderson (andtecheu)
Wiki: http://en.opensuse.org/Go
http://en.opensuse.org/openSUSE:Packaging_Go
GENERAL NOTES
-------------
Go toolchain environmental variables are configured via go.sh, which is
installed to /etc/profile.d/go.sh
Packaging guidelines and an RPM spec file recipe for packaging third party Go
libraries can be found on the openSUSE wiki:
http://en.opensuse.org/openSUSE:Packaging_Go
The openSUSE go package uses the standard Go distribution toolchain, with a
a small patchset to modify a few of the toolchain commands to suit our
environment and packaging needs.
This means that many of the standard go toolchain commands are not inside a
users PATH, but rather are invoked and used via the "go" command. Should you
wish to script or manually use the commands, the install location on a 64 bit
system is /usr/lib64/go/pkg/tool/linux_amd64
The "go" tool, the "godoc" document server are inside a users PATH.
We currently don't support the gccgo implementation, this is not for
any other reason than contributer and maintainer time constraints.
GO DOCUMENTATION
----------------
As of yet, there are no man pages for the standard Go distribution toolchain,
please see the documentation provided by the "godoc" command. Man pages are
slated to be included in the release in future.
One of the diffs from the maintained patchset adds the distro specific doc and
source file locations of the *-doc RPM packages to the virtual filesystem of
the "godoc" documentation server. That is to say, as long as packages follow
the Go packaging guidelines, API and other documentation should always be
available via the godoc server if the packages "doc" RPM is installed.
PACKAGE INSTALL LOCATIONS
-------------------------
Go standard library packages are installed to a location in $GOROOT, which is
defined as /usr/lib64/go on 64bit systems.
Third party package binaries are installed to the default system wide
$GOPATH entry. On 64bit systems the location /usr/lib64/go/contrib is used.
This is specified in the macros.go RPM macro definition file that is part of
the main Go package and is used for packaging most third party Go libraries.
The reasons binary packages are installed to a GOPATH entry instead of GOROOT
are mainly to do with how the Go toolchain prioritises and behaves with
packages installed to the same location as the Go std library.
By installing third party packages to a system-wide GOPATH entry location,
we can ensure that no packages clobber the standard library namespace or file
tree. Additionally we can support binary only packages, which as of Go 1.1
will only be supported outside of the $GOROOT.
There are additional benefits to this location; such as allowing users and
developers to prioritise linking from their own user defined GOPATH, which
defaults to $HOME/go configured via /etc/profile.d/go.sh config. This has
particular benefit for development workflows.
For Go 1.1 and beyond, building and linking with binary only pacakges will
only be supported with the following caveat. Package source code must not
exist in the same GOPATH segment as the binary package .a archive file.
If both the binary archive (.a) and the package source are installed to the
same GOPATH segment, then the "go build" or "go install" command will
prioritise building the software using package sources before using package
binary archives. A side effect of this is that is actually possible to have
source code only third party packages.
To summarise the priority of binary package linking and building:
1. Any source files or binary packages in $GOROOT are considered first. Any
binary packages in $GOROOT that are considered "stale" by the build tools
are ignored in favour of the package source.
2. $GOPATH is considered next for import statements. GOPATH is a colon
delimited list of paths. GOPATH segments are examined by the build tools
in a FIFO manner, left to right.
Both a system wide and a user GOPATH segment are configured by default,
the user GOPATH segment takes priority over the system segment to allow
flexibility for development workflows.
The default user GOPATH is:
GOPATH=$HOME/go:$GOROOT/contrib
The default root user GOPATH is:
GOPATH=$GOROOT/contrib
3. For Go < 1.1, If both the source and binary archive is available for a
package import in the same GOPATH segment, the binary archive will take
precedence and will be linked during compilation.
For Go >= 1.1 If the package source is avaiable in the GOPATH segment, it
will always be used in preference to the binary

15
_service Normal file
View File

@ -0,0 +1,15 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/llvm/llvm-project.git</param>
<param name="scm">git</param>
<param name="include">compiler-rt</param>
<!-- [boo#1052528] Always make sure this is kept up to date with src/runtime/race/README. -->
<param name="revision">89f7ccea6f6488c443655880229c54db1f180153</param>
<param name="versionformat">%H</param>
<param name="filename">llvm</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">llvm-*.tar</param>
<param name="compression">xz</param>
</service>
</services>

View File

@ -0,0 +1,33 @@
Index: go/src/cmd/link/internal/ld/lib.go
===================================================================
--- go.orig/src/cmd/link/internal/ld/lib.go
+++ go/src/cmd/link/internal/ld/lib.go
@@ -1389,28 +1389,6 @@ func (ctxt *Link) hostlink() {
// Use lld to avoid errors from default linker (issue #38838)
altLinker = "lld"
}
-
- if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" {
- // On ARM, the GNU linker will generate COPY relocations
- // even with -znocopyreloc set.
- // https://sourceware.org/bugzilla/show_bug.cgi?id=19962
- //
- // On ARM64, the GNU linker will fail instead of
- // generating COPY relocations.
- //
- // In both cases, switch to gold.
- altLinker = "gold"
-
- // If gold is not installed, gcc will silently switch
- // back to ld.bfd. So we parse the version information
- // and provide a useful error if gold is missing.
- cmd := exec.Command(*flagExtld, "-fuse-ld=gold", "-Wl,--version")
- if out, err := cmd.CombinedOutput(); err == nil {
- if !bytes.Contains(out, []byte("GNU gold")) {
- log.Fatalf("ARM external linker must be gold (issue #15696), but is not: %s", out)
- }
- }
- }
}
if ctxt.Arch.Family == sys.ARM64 && buildcfg.GOOS == "freebsd" {
// Switch to ld.bfd on freebsd/arm64.

77
gcc-go.patch Normal file
View File

@ -0,0 +1,77 @@
Index: go/src/cmd/dist/buildtool.go
===================================================================
--- go.orig/src/cmd/dist/buildtool.go
+++ go/src/cmd/dist/buildtool.go
@@ -190,7 +190,7 @@ func bootstrapBuildTools() {
// only applies to the final cmd/go binary, but that's OK: if this is Go 1.10
// or later we don't need to disable inlining to work around bugs in the Go 1.4 compiler.
cmd := []string{
- pathf("%s/bin/go", goroot_bootstrap),
+ pathf("%s/bin/go-$gcc_go_version", goroot_bootstrap),
"install",
"-gcflags=-l",
"-tags=math_big_pure_go compiler_bootstrap",
Index: go/src/make.bash
===================================================================
--- go.orig/src/make.bash
+++ go/src/make.bash
@@ -60,7 +60,7 @@
# time goes when these scripts run.
#
# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.4 for bootstrap.
-# If $GOROOT_BOOTSTRAP/bin/go is missing, $(go env GOROOT) is
+# If $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version is missing, $(go env GOROOT) is
# tried for all "go" in $PATH. $HOME/go1.4 by default.
set -e
@@ -162,8 +162,8 @@
fi
fi
done; unset IFS
-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
+if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" ]; then
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version." >&2
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
exit 1
fi
@@ -181,7 +181,7 @@
exit 1
fi
rm -f cmd/dist/dist
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" build -o cmd/dist/dist ./cmd/dist
# -e doesn't propagate out of eval, so check success by hand.
eval $(./cmd/dist/dist env -p || echo FAIL=true)
Index: go/src/make.rc
===================================================================
--- go.orig/src/make.rc
+++ go/src/make.rc
@@ -52,7 +52,7 @@ GOROOT = `{cd .. && pwd}
if(! ~ $#GOROOT_BOOTSTRAP 1)
GOROOT_BOOTSTRAP = $home/go1.4
for(p in $path){
- if(! test -x $GOROOT_BOOTSTRAP/bin/go){
+ if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
if(go_exe = `{path=$p whatis go}){
goroot = `{GOROOT='' $go_exe env GOROOT}
if(! ~ $goroot $GOROOT){
@@ -61,7 +61,7 @@ for(p in $path){
}
}
}
-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
+if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
exit bootstrap
@@ -75,7 +75,7 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
if(~ $#vflag 1)
echo cmd/dist
-GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
+GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version build -o cmd/dist/dist ./cmd/dist
eval `{./cmd/dist/dist env -9}
if(~ $#vflag 1)

9
go-rpmlintrc Normal file
View File

@ -0,0 +1,9 @@
addFilter("binaryinfo-readelf-failed") # go binaries are suposedly ELF-compliant
addFilter("statically-linked-binary") # go doesn't yet support dynamic linking
# .syso files are special. Note that while they are architecture-dependent,
# they are named to avoid conflicts (and we make sure of that in the RPM
# through go_arch).
addFilter("unstripped-binary-or-object.*\.syso$")
addFilter("arch-dependent-file-in-usr-share.*\.syso$")
addFilter("W: position-independent-executable-suggested")

1
go.gdbinit Normal file
View File

@ -0,0 +1 @@
add-auto-load-safe-path /usr/lib/go/$go_label/src/runtime/runtime-gdb.py

BIN
go1.17.13.src.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

637
go1.17.changes Normal file
View File

@ -0,0 +1,637 @@
-------------------------------------------------------------------
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
-------------------------------------------------------------------
Thu Apr 13 04:58:20 UTC 2023 - Martin Liška <mliska@suse.cz>
- Use gcc13 compiler for Tumbleweed.
-------------------------------------------------------------------
Tue Aug 23 19:49:42 UTC 2022 - Andreas Schwab <schwab@suse.de>
- Don't build with shared on riscv64 for < go1.18
-------------------------------------------------------------------
Mon Aug 22 20:44:19 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- Define go_bootstrap_version go1.16 without suse_version checks
- Simplify conditional gcc_go_version 12 on Tumbleweed, 11 elsewhere
-------------------------------------------------------------------
Thu Aug 18 08:36:32 UTC 2022 - Dirk Müller <dmueller@suse.com>
- Bootstrap using go1.16 on SLE-15 and newer. go1.16 is
bootstrapped using gcc-go 11 or 12. This allows dropping older
versions of Go from Factory.
-------------------------------------------------------------------
Mon Aug 1 15:40:03 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.13 (released 2022-08-01) includes security fixes to the
encoding/gob and math/big packages, as well as bug fixes to the
compiler and the runtime.
Refs boo#1190649 go1.17 release tracking
CVE-2022-32189
* boo#1202035 CVE-2022-32189 go#53871
* go#54094 math/big: index out of range in Float.GobDecode
* go#53846 runtime: modified timer results in extreme cpu load
* go#53617 cmd/compile: condition in for loop body is incorrectly optimised away
* go#53111 runtime: gentraceback() dead loop on arm64 casued the process hang
* go#52960 cmd/compile: miscompilation in pointer operations
-------------------------------------------------------------------
Tue Jul 12 20:28:01 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.12 (released 2022-07-12) includes security fixes to the
compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs,
net/http, and path/filepath packages, as well as bug fixes to the
compiler, the go command, the runtime, and the runtime/metrics
package.
Refs boo#1190649 go1.17 release tracking
CVE-2022-1705 CVE-2022-32148 CVE-2022-30631 CVE-2022-30633 CVE-2022-28131 CVE-2022-30635 CVE-2022-30632 CVE-2022-30630 CVE-2022-1962
* boo#1201434 CVE-2022-1705 go#53188
* go#53432 net/http: improper sanitization of Transfer-Encoding header
* boo#1201436 CVE-2022-32148 go#53423
* go#53620 net/http/httputil: NewSingleHostReverseProxy - omit X-Forwarded-For not working
* boo#1201437 CVE-2022-30631 go#53168
* go#53717 compress/gzip: stack exhaustion in Reader.Read (CVE-2022-30631)
* boo#1201440 CVE-2022-30633 go#53611
* go#53715 encoding/xml: stack exhaustion in Unmarshal (CVE-2022-30633)
* boo#1201443 CVE-2022-28131 go#53614
* go#53711 encoding/xml: stack exhaustion in Decoder.Skip (CVE-2022-28131)
* boo#1201444 CVE-2022-30635 go#53615
* go#53709 encoding/gob: stack exhaustion in Decoder.Decode (CVE-2022-30635)
* boo#1201445 CVE-2022-30632 go#53416
* go#53713 path/filepath: stack exhaustion in Glob (CVE-2022-30632)
* boo#1201447 CVE-2022-30630 go#53415
* go#53719 io/fs: stack exhaustion in Glob (CVE-2022-30630)
* boo#1201448 CVE-2022-1962 go#53616
* go#53707 go/parser: stack exhaustion in all Parse* functions (CVE-2022-1962)
* go#53612 syscall: NewCallback triggers data race on Windows when used from different goroutine
* go#53589 runtime/metrics: data race detected in Read
* go#53470 cmd/compile: internal compiler error: width not calculated: int128
* go#53050 misc/cgo/test: failure with gcc 10
* go#52688 runtime: total allocation stats are managed in a uintptr which can quickly wrap around on 32-bit architectures
* go#51351 cmd/go: "v1.x.y is not a tag" when .gitconfig sets log.decorate to full
-------------------------------------------------------------------
Wed Jun 1 17:51:26 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.11 (released 2022-06-01) includes security fixes to the
crypto/rand, crypto/tls, os/exec, and path/filepath packages, as
well as bug fixes to the crypto/tls package.
Refs boo#1190649 go1.17 release tracking
CVE-2022-30634 CVE-2022-30629 CVE-2022-30580 CVE-2022-29804
* boo#1200134 go#52561 CVE-2022-30634
* go#52932 crypto/rand: Read hangs when passed buffer larger than 1<<32 - 1
* boo#1200135 go#52814 CVE-2022-30629
* go#52832 crypto/tls: randomly generate ticket_age_add
* boo#1200136 go#52574 CVE-2022-30580
* go#53056 os/exec: Cmd.{Run,Start} should fail if Cmd.Path is unset
* boo#1200137 go#52476 CVE-2022-29804
* go#52478 path/filepath: Clean(.\c:) returns c: on Windows
* go#52790 crypto/tls: 500% increase in allocations from (*tls.Conn).Read in go 1.17
* go#52826 runtime: TestGcSys is still flaky
* go#53042 misc/cgo/testsanitizers: occasional hangs in TestTSAN/tsan12
* go#53049 runtime: TestGdbBacktrace failures due to GDB "internal-error: wait returned unexpected status 0x0"
* go#53114 misc/cgo/testsanitizers: deadlock in TestTSAN/tsan11
-------------------------------------------------------------------
Tue May 10 22:25:54 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.10 (released 2022-05-10) includes security fixes to the
syscall package, as well as bug fixes to the compiler, runtime,
and the crypto/x509 and net/http/httptest packages.
Refs boo#1190649 go1.17 release tracking
CVE-2022-29526
* boo#1199413 go#52313 CVE-2022-29526
* go#52439 syscall: Faccessat checks wrong group
* go#51858 crypto/x509: x509 certificate with issuerUniqueID and/or subjectUniqueID parse error
* go#52095 cmd/compile: fails to compile very long files starting go1.17
* go#52148 syscall: TestGroupCleanupUserNamespace failure on linux-s390x-ibm
* go#52306 sync: TestWaitGroupMisuse2 is flaky
* go#52374 runtime: executable compiled under Go 1.17.7 will occasionally wedge
* go#52455 net/http/httptest: race in Close
* go#52705 net: TestDialCancel is not compatible with new macOS ARM64 builders
-------------------------------------------------------------------
Mon May 2 08:43:22 UTC 2022 - Martin Liška <mliska@suse.cz>
- Remove remaining use of gold linker when bootstrapping with
gccgo. The binutils-gold package will be removed in the future.
* History: go1.8.3 2017-06-18 added conditional if gccgo defined
BuildRequires: binutils-gold for arches other than s390x
* No information available why binutils-gold was used initially
* Unrelated to upstream recent hardcoded gold dependency for ARM
-------------------------------------------------------------------
Tue Apr 12 17:42:46 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.9 (released 2022-04-12) includes security fixes to the
crypto/elliptic and encoding/pem packages, as well as bug fixes
to the linker and runtime.
Refs boo#1190649 go1.17 release tracking
CVE-2022-24675 CVE-2022-28327
* boo#1198423 go#51853 CVE-2022-24675
* go#52036 encoding/pem: stack overflow
* boo#1198424 go#52075 CVE-2022-28327
* go#52076 crypto/elliptic: generic P-256 panic when scalar has too many leading zeroes
* go#51736 plugin: tls handshake panic: unreachable method called. linker bug?
* go#51696 runtime: some tests fails on Windows with CGO_ENABLED=0
* go#51458 runtime: finalizer call has wrong frame size
* go#50611 internal/poll: deadlock in Read on arm64 when an FD is closed
-------------------------------------------------------------------
Thu Apr 7 23:57:47 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- Template gcc-go.patch to substitute gcc_go_version and eliminate
multiple similar patches each with hardcoded gcc go binary name.
gcc-go.patch inserts gcc-go binary name e.g. go-8 to compensate
for current lack of gcc-go update-alternatives usage.
* add gcc-go.patch
* drop gcc6-go.patch
* drop gcc7-go.patch
-------------------------------------------------------------------
Thu Apr 7 17:51:56 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- For SLE-12 set gcc_go_version to 8 to bootstrap using gcc8-go.
gcc6-go and gcc7-go no longer successfully bootstrap go1.17 or
go1.18 on SLE-12 aarch64 ppc64le or s390x.
* gcc6-go fails with errors e.g. libnoder.a(_go_.o):(.toc+0x0):
undefined reference to `__go_pimt__I4_DiagFrN4_boolee3
-------------------------------------------------------------------
Fri Mar 11 23:37:41 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- Add %define go_label as a configurable Go toolchain directory
* go_label can be used to package multiple Go toolchains with
the same go_api
* go_label should be defined as go_api with an optional suffix
e.g. %{go_api} or %{go_api}-foo
* Default go_label = go_api makes no changes to package layout
-------------------------------------------------------------------
Wed Mar 9 17:03:28 UTC 2022 - Dirk Müller <dmueller@suse.com>
- add dont-force-gold-on-arm64.patch (bsc#1183043)
- drop binutils-gold dependency
-------------------------------------------------------------------
Thu Mar 3 21:51:40 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.8 (released 2022-03-03) includes a security fix to the
regexp/syntax package, as well as bug fixes to the compiler,
runtime, the go command, and the crypto/x509, and net packages.
Refs boo#1190649 go1.17 release tracking
CVE-2022-24921
* boo#1196732 go#51112 CVE-2022-24921
* go#51118 regexp: stack overflow (process exit) handling deeply nested regexp
* go#51332 cmd/go/internal/modfetch: erroneously resolves a v2+incompatible version when a v2/go.mod file exists
* go#51199 cmd/compile: "runtime: bad pointer in frame" in riscv64 with complier optimizations
* go#51162 net: use EDNS to increase DNS packet size [freeze exception]
* go#50734 runtime/metrics: time histogram sub-bucket ranges are off by a factor of two
* go#51000 crypto/x509: invalid RDNSequence: invalid attribute value: unsupported string type: 18
-------------------------------------------------------------------
Fri Feb 18 02:10:17 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- Add missing .bin binary test data to packaging.
* Existing test data files added to packaging with mode 644:
src/compress/bzip2/testdata/pass-random2.bin
src/compress/bzip2/testdata/pass-random1.bin
src/debug/dwarf/testdata/line-gcc-win.bin
-------------------------------------------------------------------
Thu Feb 10 23:46:55 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.7 (released 2022-02-10) includes security fixes to the
crypto/elliptic, math/big packages and to the go command, as well
as bug fixes to the compiler, linker, runtime, the go command,
and the debug/macho, debug/pe, and net/http/httptest packages.
Refs boo#1190649 go1.17 release tracking
CVE-2022-23806 CVE-2022-23772 CVE-2022-23773
* boo#1195838 go#50974 CVE-2022-23806
* go#50978 crypto/elliptic: IsOnCurve returns true for invalid field elements
* boo#1195835 go#50699 CVE-2022-23772
* go#50701 math/big: Rat.SetString may consume large amount of RAM and crash
* boo#1195834 go#35671 CVE-2022-23773
* go#50687 cmd/go: do not treat branches with semantic-version names as releases
* go#50942 cmd/asm: "compile: loop" compiler bug?
* go#50867 cmd/compile: incorrect use of CMN on arm64
* go#50812 cmd/go: remove bitbucket VCS probing
* go#50781 runtime: incorrect frame information in traceback traversal may hang the process.
* go#50722 debug/pe: reading debug_info section of PE files that use the DWARF5 form DW_FORM_line_strp causes error
* go#50683 cmd/compile: MOVWreg missing sign-extension following a Copy from a floating-point LoadReg
* go#50586 net/http/httptest: add fipsonly compliant certificate in for NewTLSServer(), for dev.boringcrypto branch
* go#50297 cmd/link: does not set section type of .init_array correctly
* go#50246 runtime: intermittent os/exec.Command.Start() Hang on Darwin in Presence of "plugin" Package
-------------------------------------------------------------------
Thu Jan 6 20:38:08 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.6 (released 2022-01-06) includes fixes to the compiler,
linker, runtime, and the crypto/x509, net/http, and reflect
packages.
Refs boo#1190649 go1.17 release tracking
* go#50165 crypto/x509: error parsing large ASN.1 identifiers
* go#50073 runtime: race detector SIGABRT or SIGSEGV on macOS Monterey
* go#49961 reflect: segmentation violation while using html/template
* go#49921 x/net/http2: http.Server.WriteTimeout does not fire if the http2 stream's window is out of space.
* go#49413 cmd/compile: internal compiler error: Op...LECall and OpDereference have mismatched mem
* go#48116 runtime: mallocs cause "base outside usable address space" panic when running on iOS 14
-------------------------------------------------------------------
Thu Dec 9 17:31:00 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.5 (released 2021-12-09) includes security fixes to the
syscall and net/http packages.
Refs boo#1190649 go1.17 release tracking
CVE-2021-44716 CVE-2021-44717
* boo#1193598 go#50057 CVE-2021-44717
* go#50067 syscall: dont close fd 0 on ForkExec error
* boo#1193597 go#50058 CVE-2021-44716
* go#50065 net/http: limit growth of header canonicalization cache
-------------------------------------------------------------------
Fri Dec 3 02:15:02 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.4 (released 2021-12-02) includes fixes to the compiler,
linker, runtime, and the go/types, net/http, and time packages.
Refs boo#1190649 go1.17 release tracking
* go#49911 x/net/http2: frequent failures in TestClientConnCloseAtBody
* go#49909 x/net/ipv6: TestPacketConnReadWriteMulticast{UDP,ICMP} failing with "i/o timeout" on OpenBSD 6.8 and 7.0
* go#49905 x/net/http2: Client doesn't send body until ExpectContinueTimeout expires
* go#49868 syscall: ntdll.dll errors in rtlGetNtVersionNumbers via os.StartProcess
* go#49729 runtime: "fatal error: unexpected signal during runtime execution" in cmd/go tests on darwin-amd64-race running macOS 12.0
* go#49662 x/net/http2: TestUnreadFlowControlReturned_Server failures with stream error "NO_ERROR" since 2021-10-05
* go#49624 net/http: Possible HTTP/2 busy loop regression in Go 1.17.3
* go#49568 net/http: server responds with Transfer-Encoding: identity
* go#49561 x/net/http2: setting Request.Close doesn't close TCP connections
* go#49559 net/http: HTTP/2 response body Close method sometimes returns spurious context cancelation error (1.17.3 regression)
* go#49511 cmd/compile: init info of OAS node in a select case is being dropped
* go#49479 runtime: "morestack on g0" in x/perf/storage/app on windows/arm64
* go#49407 time: ParseInLocation error
* go#49392 cmd/compile: internal compiler error: Expand calls interface data problem
* go#49369 runtime: time goes backwards on windows-arm64 (frequent TestGcLastTime failures)
* go#49129 cmd/compile: internal compiler error: can't find source for b12->b4: v31 = MOVBload <bool> v14 v1 : DX
* go#48825 go/types, types2: stack overflow in hasVarSize for invalid type
-------------------------------------------------------------------
Thu Nov 4 21:23:39 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.3 (released 2021-11-04) includes security fixes to the
archive/zip and debug/macho packages, as well as bug fixes to the
compiler, linker, runtime, the go command, the misc/wasm
directory, and to the net/http and syscall packages.
Refs boo#1190649 go1.17 release tracking
CVE-2021-41771 CVE-2021-41772
* boo#1192377 go#48990 CVE-2021-41771
* go#48992 debug/macho: invalid dynamic symbol table command can cause panic
* boo#1192378 go#48085 CVE-2021-41772
* go#48252 archive/zip: Reader.Open panics on empty string
* go#49199 cmd/go: go list all breaks in //go:build-only repos
* go#49154 misc/wasm, cmd/link: Go 1.17.2 causes WASM builds to throw command line too long with many environment variables
* go#49086 cmd/link: -buildmode=pie -linkshared panic at runtime
* go#49077 x/net/http2: backport critical fixes
* go#49010 net,runtime: apparent deadlock in (*net.conn).Close and runtime.netpollblock on arm64 platforms
* go#48823 x/net/http2: client can hang forever if headers' size exceeds connection's buffer size and server hangs past request time
* go#48650 x/net/http2: pool deadlock
* go#48479 cmd/compile: 64 bits shifts on arm get wrong results
* go#48475 cmd/compile: incorrect arm/arm64 simplification rules
* go#48075 syscall: SysProcAttr{ NoInheritHandles: true } broken in 1.17 on Windows
-------------------------------------------------------------------
Fri Oct 8 00:41:43 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.2 (released 2021-10-07) includes a security fix to the
linker and misc/wasm directory, as well as bug fixes to the
compiler, the runtime, the go command, and to the time and
text/template packages.
Refs boo#1190649 go1.17 release tracking
CVE-2021-38297
* boo#1191468 go#48797 CVE-2021-38297
* go#48800 security: fix CVE-2021-38297 misc/wasm, cmd/link: do not let command line args overwrite global data
* go#48561 cmd/compile: unsafe.Add bug when adding uint8 value to a pointer
* go#48444 text/template: should t.init() be executed before t.muTmpl.Lock() in AddParseTree() method?
* go#48177 time: output does not respect comma as millisecond separator
* go#47859 time: timer reset sometimes ignored, causing delayed ticks
* go#47756 cmd/go: mod tidy -go=1.17 should move indirect dependencies to the second require part
-------------------------------------------------------------------
Fri Sep 10 02:44:03 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17.1 (released 2021-09-09) includes a security fix to the
archive/zip package, as well as bug fixes to the compiler,
linker, the go command, and to the crypto/rand, embed, go/types,
html/template, and net/http packages.
Refs boo#1190649 go1.17 release tracking
CVE-2021-39293
* boo#1190589 go#47801 CVE-2021-39293
* go#47986 archive/zip: overflow in preallocation check can cause OOM panic
* go#48156 cmd/go: get panics with "can't find reason for requirement on"
* go#48102 cmd/compile: panic during export method expression
* go#48082 go/types: panic in error reporting for invalid use of "init"
* go#47857 cmd/go: module dependencies not updated with go get -u in 1.17
* go#47854 go/types: incorrect type reported for comma-err C functions (manifests itself in IDEs)
* go#47814 crypto/rand: getentropy is not available on iOS
* go#47782 cmd/link: wrong dynamic linker path when cross-compiling to OpenBSD
* go#47754 embed: 1.17 rejects types with underlying type []byte
* go#47692 x/net/http2: server sends RST_STREAM w/ PROTOCOL_ERROR to clients it incorrectly believes have violated max advertised num streams
-------------------------------------------------------------------
Tue Aug 17 22:34:51 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17 (released 2021-08-16) is a major release of Go.
go1.17.x minor releases will be provided through August 2022.
https://github.com/golang/go/wiki/Go-Release-Cycle
Most changes are in the implementation of the toolchain, runtime,
and libraries. As always, the release maintains the Go 1 promise
of compatibility. We expect almost all Go programs to continue to
compile and run as before.
Refs boo#1190649 go1.17 release tracking
* See release notes https://golang.org/doc/go1.17. Excerpts
relevant to OBS environment and for SUSE/openSUSE follow:
* The compiler now implements a new way of passing function
arguments and results using registers instead of the
stack. Benchmarks for a representative set of Go packages and
programs show performance improvements of about 5%, and a
typical reduction in binary size of about 2%. This is currently
enabled for Linux, macOS, and Windows on the 64-bit x86
architecture (the linux/amd64, darwin/amd64, and windows/amd64
ports). This change does not affect the functionality of any
safe Go code and is designed to have no impact on most assembly
code.
* When the linker uses external linking mode, which is the
default when linking a program that uses cgo, and the linker is
invoked with a -I option, the option will now be passed to the
external linker as a -Wl,--dynamic-linker option.
* The runtime/cgo package now provides a new facility that allows
to turn any Go values to a safe representation that can be used
to pass values between C and Go safely. See runtime/cgo.Handle
for more information.
* ARM64 Go programs now maintain stack frame pointers on the
64-bit ARM architecture on all operating systems. Previously,
stack frame pointers were only enabled on Linux, macOS, and
iOS.
* Pruned module graphs in go 1.17 modules: If a module specifies
go 1.17 or higher, the module graph includes only the immediate
dependencies of other go 1.17 modules, not their full
transitive dependencies. To convert the go.mod file for an
existing module to Go 1.17 without changing the selected
versions of its dependencies, run: go mod tidy -go=1.17
By default, go mod tidy verifies that the selected versions of
dependencies relevant to the main module are the same versions
that would be used by the prior Go release (Go 1.16 for a
module that specifies go 1.17), and preserves the go.sum
entries needed by that release even for dependencies that are
not normally needed by other commands.
The -compat flag allows that version to be overridden to
support older (or only newer) versions, up to the version
specified by the go directive in the go.mod file. To tidy a go
1.17 module for Go 1.17 only, without saving checksums for (or
checking for consistency with) Go 1.16: go mod tidy
-compat=1.17
Note that even if the main module is tidied with -compat=1.17,
users who require the module from a go 1.16 or earlier module
will still be able to use it, provided that the packages use
only compatible language and library features.
The go mod graph subcommand also supports the -go flag, which
causes it to report the graph as seen by the indicated Go
version, showing dependencies that may otherwise be pruned out.
* Module deprecation comments: Module authors may deprecate a
module by adding a // Deprecated: comment to go.mod, then
tagging a new version. go get now prints a warning if a module
needed to build packages named on the command line is
deprecated. go list -m -u prints deprecations for all
dependencies (use -f or -json to show the full message). The go
command considers different major versions to be distinct
modules, so this mechanism may be used, for example, to provide
users with migration instructions for a new major version.
* go get -insecure flag is deprecated and has been removed. To
permit the use of insecure schemes when fetching dependencies,
please use the GOINSECURE environment variable. The -insecure
flag also bypassed module sum validation, use GOPRIVATE or
GONOSUMDB if you need that functionality. See go help
environment for details.
* go get prints a deprecation warning when installing commands
outside the main module (without the -d flag). go install
cmd@version should be used instead to install a command at a
specific version, using a suffix like @latest or @v1.2.3. In Go
1.18, the -d flag will always be enabled, and go get will only
be used to change dependencies in go.mod.
* go.mod files missing go directives: If the main module's go.mod
file does not contain a go directive and the go command cannot
update the go.mod file, the go command now assumes go 1.11
instead of the current release. (go mod init has added go
directives automatically since Go 1.12.)
If a module dependency lacks an explicit go.mod file, or its
go.mod file does not contain a go directive, the go command now
assumes go 1.16 for that dependency instead of the current
release. (Dependencies developed in GOPATH mode may lack a
go.mod file, and the vendor/modules.txt has to date never
recorded the go versions indicated by dependencies' go.mod
files.)
* vendor contents: If the main module specifies go 1.17 or
higher, go mod vendor now annotates vendor/modules.txt with the
go version indicated by each vendored module in its own go.mod
file. The annotated version is used when building the module's
packages from vendored source code.
If the main module specifies go 1.17 or higher, go mod vendor
now omits go.mod and go.sum files for vendored dependencies,
which can otherwise interfere with the ability of the go
command to identify the correct module root when invoked within
the vendor tree.
* Password prompts: The go command by default now suppresses SSH
password prompts and Git Credential Manager prompts when
fetching Git repositories using SSH, as it already did
previously for other Git password prompts. Users authenticating
to private Git repos with password-protected SSH may configure
an ssh-agent to enable the go command to use password-protected
SSH keys.
* go mod download: When go mod download is invoked without
arguments, it will no longer save sums for downloaded module
content to go.sum. It may still make changes to go.mod and
go.sum needed to load the build list. This is the same as the
behavior in Go 1.15. To save sums for all modules, use:
go mod download all
* The go command now understands //go:build lines and prefers
them over // +build lines. The new syntax uses boolean
expressions, just like Go, and should be less error-prone. As
of this release, the new syntax is fully supported, and all Go
files should be updated to have both forms with the same
meaning. To aid in migration, gofmt now automatically
synchronizes the two forms. For more details on the syntax and
migration plan, see https://golang.org/design/draft-gobuild.
* go run now accepts arguments with version suffixes (for
example, go run example.com/cmd@v1.0.0). This causes go run to
build and run packages in module-aware mode, ignoring the
go.mod file in the current directory or any parent directory,
if there is one. This is useful for running executables without
installing them or without changing dependencies of the current
module.
* The format of stack traces from the runtime (printed when an
uncaught panic occurs, or when runtime.Stack is called) is
improved.
* TLS strict ALPN: When Config.NextProtos is set, servers now
enforce that there is an overlap between the configured
protocols and the ALPN protocols advertised by the client, if
any. If there is no mutually supported protocol, the connection
is closed with the no_application_protocol alert, as required
by RFC 7301. This helps mitigate the ALPACA cross-protocol
attack. As an exception, when the value "h2" is included in the
server's Config.NextProtos, HTTP/1.1 clients will be allowed to
connect as if they didn't support ALPN. See issue go#46310 for
more information.
* crypto/ed25519: The crypto/ed25519 package has been rewritten,
and all operations are now approximately twice as fast on amd64
and arm64. The observable behavior has not otherwise changed.
* crypto/elliptic: CurveParams methods now automatically invoke
faster and safer dedicated implementations for known curves
(P-224, P-256, and P-521) when available. Note that this is a
best-effort approach and applications should avoid using the
generic, not constant-time CurveParams methods and instead use
dedicated Curve implementations such as P256. The P521 curve
implementation has been rewritten using code generated by the
fiat-crypto project, which is based on a formally-verified
model of the arithmetic operations. It is now constant-time and
three times faster on amd64 and arm64. The observable behavior
has not otherwise changed.
* crypto/tls: The new Conn.HandshakeContext method allows the
user to control cancellation of an in-progress TLS
handshake. The provided context is accessible from various
callbacks through the new ClientHelloInfo.Context and
CertificateRequestInfo.Context methods. Canceling the context
after the handshake has finished has no effect.
Cipher suite ordering is now handled entirely by the crypto/tls
package. Currently, cipher suites are sorted based on their
security, performance, and hardware support taking into account
both the local and peer's hardware. The order of the
Config.CipherSuites field is now ignored, as well as the
Config.PreferServerCipherSuites field. Note that
Config.CipherSuites still allows applications to choose what
TLS 1.01.2 cipher suites to enable.
The 3DES cipher suites have been moved to InsecureCipherSuites
due to fundamental block size-related weakness. They are still
enabled by default but only as a last resort, thanks to the
cipher suite ordering change above.
Beginning in the next release, Go 1.18, the Config.MinVersion
for crypto/tls clients will default to TLS 1.2, disabling TLS
1.0 and TLS 1.1 by default. Applications will be able to
override the change by explicitly setting
Config.MinVersion. This will not affect crypto/tls servers.
* crypto/x509: CreateCertificate now returns an error if the
provided private key doesn't match the parent's public key, if
any. The resulting certificate would have failed to verify.
* crypto/x509: The temporary GODEBUG=x509ignoreCN=0 flag has been
removed.
* crypto/x509: ParseCertificate has been rewritten, and now
consumes ~70% fewer resources. The observable behavior has not
otherwise changed, except for error messages.
* crypto/x509: Beginning in the next release, Go 1.18,
crypto/x509 will reject certificates signed with the SHA-1 hash
function. This doesn't apply to self-signed root
certificates. Practical attacks against SHA-1 have been
demonstrated in 2017 and publicly trusted Certificate
Authorities have not issued SHA-1 certificates since 2015.
* go/build: The new Context.ToolTags field holds the build tags
appropriate to the current Go toolchain configuration.
* net/http package now uses the new (*tls.Conn).HandshakeContext
with the Request context when performing TLS handshakes in the
client or server.
* syscall: On Unix-like systems, the process group of a child
process is now set with signals blocked. This avoids sending a
SIGTTOU to the child when the parent is in a background process
group.
* time: The new Time.IsDST method can be used to check whether
the time is in Daylight Savings Time in its configured
location.
* time: The new Time.UnixMilli and Time.UnixMicro methods return
the number of milliseconds and microseconds elapsed since
January 1, 1970 UTC respectively.
* time: The new UnixMilli and UnixMicro functions return the
local Time corresponding to the given Unix time.
-------------------------------------------------------------------
Thu Aug 12 20:48:30 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- Add bash scripts used by go tool commands to provide a more
complete cross-compiling go toolchain install.
* Fixes "go tool dist list" error "all.bash does not exist"
* Added to packaging:
/usr/lib64/go/1.17/lib/time/update.bash (already packaged)
/usr/lib64/go/1.17/src/all.bash
/usr/lib64/go/1.17/src/bootstrap.bash
/usr/lib64/go/1.17/src/buildall.bash
/usr/lib64/go/1.17/src/clean.bash
/usr/lib64/go/1.17/src/cmp.bash
/usr/lib64/go/1.17/src/make.bash
/usr/lib64/go/1.17/src/race.bash
/usr/lib64/go/1.17/src/run.bash
/usr/share/go/1.17/src/all.bash
/usr/share/go/1.17/src/bootstrap.bash
/usr/share/go/1.17/src/buildall.bash
/usr/share/go/1.17/src/clean.bash
/usr/share/go/1.17/src/cmd/compile/internal/ssa/gen/cover.bash
/usr/share/go/1.17/src/cmd/vendor/golang.org/x/sys/windows/mkerrors.bash
/usr/share/go/1.17/src/cmd/vendor/golang.org/x/sys/windows/mkknownfolderids.bash
/usr/share/go/1.17/src/cmp.bash
/usr/share/go/1.17/src/internal/trace/mkcanned.bash
/usr/share/go/1.17/src/make.bash
/usr/share/go/1.17/src/race.bash
/usr/share/go/1.17/src/run.bash
-------------------------------------------------------------------
Mon Aug 2 21:31:24 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17rc2 (released 2021-08-02) is a release candidate version of
go1.17 cut from the master branch at the revision tagged
go1.17rc2.
-------------------------------------------------------------------
Tue Jul 13 22:47:16 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17rc1 (released 2021-07-13) is a release candidate version of
go1.17 cut from the master branch at the revision tagged
go1.17rc1.
-------------------------------------------------------------------
Thu Jun 10 17:43:40 UTC 2021 - Jeff Kowalczyk <jkowalczyk@suse.com>
- go1.17beta1 (released 2021-06-10) is a beta version of go1.17 cut
from the master branch at the revision tagged go1.17beta1.

455
go1.17.spec Normal file
View File

@ -0,0 +1,455 @@
#
# spec file for package go1.17
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# nodebuginfo
# strip will cause Go's .a archives to become invalid because strip appears to
# reassemble the archive incorrectly. This is a known issue upstream
# (https://github.com/golang/go/issues/17890), but we have to deal with it in
# the meantime.
%undefine _build_create_debug
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true NO_BRP_AR=true
# Specify Go toolchain version used to bootstrap this package's Go toolchain
# go_bootstrap_version bootstrap go toolchain with specific existing go1.x package
# gcc_go_version bootstrap go toolchain with specific version of gcc-go
%if 0%{?suse_version} > 1500
# 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 go_bootstrap_version go1.16
%else
# Use gccgo and go1.x specified by upstream Go
%define gcc_go_version 11
%define go_bootstrap_version go1.16
%endif
# Bootstrap go toolchain using existing go package go_bootstrap_version
# To bootstrap using gccgo use '--with gccgo'
%bcond_with gccgo
# gccgo on ppc64le with default PIE enabled fails with:
# error while loading shared libraries:
# R_PPC64_ADDR16_HA re10143fb0c for symbol `' out of range
# track https://github.com/golang/go/issues/28531
# linuxppc-dev discussion:
# "PIE binaries are no longer mapped below 4 GiB on ppc64le"
# https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-November/180862.html
%ifarch ppc64le
#!BuildIgnore: gcc-PIE
%endif
# Build go-race only on platforms where C++14 is supported (SLE-15)
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 150000
%define tsan_arch x86_64 aarch64
%else
# Cannot use {nil} here (ifarch doesn't like it) so just make up a fake
# architecture that no build will ever match.
%define tsan_arch openSUSE_FAKE_ARCH
%endif
# Go has precompiled versions of LLVM's compiler-rt inside their source code.
# We cannot ship pre-compiled binaries so we have to recompile said source,
# however they vendor specific commits from upstream. This value comes from
# src/runtime/race/README (and we verify that it matches in check).
#
# In order to update the TSAN version, modify _service. See boo#1052528 for
# more details.
%define tsan_commit 89f7ccea6f6488c443655880229c54db1f180153
# go_api is the major version of Go.
# Used by go1.x packages and go metapackage for:
# RPM Provides: golang(API), RPM Requires: and rpm_vercmp
# as well as derived variables such as go_label.
%define go_api 1.17
# go_label is the configurable Go toolchain directory name.
# Used for packaging multiple Go toolchains with the same go_api.
# go_label should be defined as go_api with optional suffix, e.g.
# go_api or go_api-foo
%define go_label %{go_api}
# shared library support
%if "%{rpm_vercmp %{go_api} 1.5}" > "0"
%if %{with gccgo}
%define with_shared 1
%else
%ifarch %ix86 %arm x86_64 aarch64
%define with_shared 1
%else
%define with_shared 0
%endif
%endif
%else
%define with_shared 0
%endif
%ifarch ppc64 riscv64
%define with_shared 0
%endif
# setup go_arch (BSD-like scheme)
%ifarch %ix86
%define go_arch 386
%endif
%ifarch x86_64
%define go_arch amd64
%endif
%ifarch aarch64
%define go_arch arm64
%endif
%ifarch %arm
%define go_arch arm
%endif
%ifarch ppc64
%define go_arch ppc64
%endif
%ifarch ppc64le
%define go_arch ppc64le
%endif
%ifarch s390x
%define go_arch s390x
%endif
%ifarch riscv64
%define go_arch riscv64
%endif
Name: go1.17
Version: 1.17.13
Release: 0
Summary: A compiled, garbage-collected, concurrent programming language
License: BSD-3-Clause
Group: Development/Languages/Go
URL: https://go.dev/
Source: https://go.dev/dl/go%{version}.src.tar.gz
Source1: go-rpmlintrc
Source4: README.SUSE
Source6: go.gdbinit
# 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
# PATCH-FIX-OPENSUSE: https://go-review.googlesource.com/c/go/+/391115
Patch7: dont-force-gold-on-arm64.patch
# PATCH-FIX-UPSTREAM marguerite@opensuse.org - find /usr/bin/go-8 when bootstrapping with gcc8-go
Patch8: gcc-go.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# boostrap
%if %{with gccgo}
BuildRequires: gcc%{gcc_go_version}-go
%else
# no gcc-go
BuildRequires: %{go_bootstrap_version}
%endif
BuildRequires: fdupes
Suggests: %{name}-doc = %{version}
%if 0%{?suse_version} > 1500
# openSUSE Tumbleweed
Suggests: %{name}-libstd = %{version}
%endif
%ifarch %{tsan_arch}
# Needed to compile compiler-rt/TSAN.
BuildRequires: gcc-c++
%endif
#BNC#818502 debug edit tool of rpm fails on i586 builds
BuildRequires: rpm >= 4.11.1
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires: gcc
Provides: go = %{version}
Provides: go-devel = go%{version}
Provides: go-devel-static = go%{version}
Provides: golang(API) = %{go_api}
Obsoletes: go-devel < go%{version}
# go-vim/emacs were separate projects starting from 1.4
Obsoletes: go-emacs <= 1.3.3
Obsoletes: go-vim <= 1.3.3
ExclusiveArch: %ix86 x86_64 %arm aarch64 ppc64 ppc64le s390x riscv64
%description
Go is an expressive, concurrent, garbage collected systems programming language
that is type safe and memory safe. It has pointers but no pointer arithmetic.
Go has fast builds, clean syntax, garbage collection, methods for any type, and
run-time reflection. It feels like a dynamic language but has the speed and
safety of a static language.
%package doc
Summary: Go documentation
Group: Documentation/Other
Provides: go-doc = %{version}
%description doc
Go examples and documentation.
%ifarch %{tsan_arch}
# boo#1052528
%package race
Summary: Go runtime race detector
Group: Development/Languages/Go
URL: https://compiler-rt.llvm.org/
Requires: %{name} = %{version}
Supplements: %{name} = %{version}
ExclusiveArch: %{tsan_arch}
%description race
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.
%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
%ifarch %{tsan_arch}
# compiler-rt (from LLVM)
%setup -q -T -b 100 -n llvm-%{tsan_commit}
%endif
# go
%setup -q -n go
%patch7 -p1
%if %{with gccgo}
# Currently gcc-go does not manage an update-alternatives entry and will
# never be symlinked as "go", even if gcc-go is the only installed go toolchain.
# Patch go bootstrap scripts to find hardcoded go-(gcc-go-version) e.g. go-8
# Substitute defined gcc_go_version into gcc-go.patch
sed -i "s/\$gcc_go_version/%{gcc_go_version}/" $RPM_SOURCE_DIR/gcc-go.patch
%patch8 -p1
%endif
cp %{SOURCE4} .
%build
# Remove the pre-included .sysos, to avoid shipping things we didn't compile
# (which is against the openSUSE guidelines for packaging).
find . -type f -name '*.syso' -print -delete
# First, compile LLVM's TSAN, and replace the built-in with it. We can only do
# this for amd64.
%ifarch %{tsan_arch}
TSAN_DIR="../llvm-%{tsan_commit}/compiler-rt/lib/tsan/go"
pushd "$TSAN_DIR"
./buildgo.sh
popd
cp -v "$TSAN_DIR/race_linux_%{go_arch}.syso" src/runtime/race/
%endif
# Now, compile Go.
%if %{with gccgo}
export GOROOT_BOOTSTRAP=%{_prefix}
%else
export GOROOT_BOOTSTRAP=%{_libdir}/%{go_bootstrap_version}
%endif
# Ensure ARM arch is set properly - boo#1169832
%ifarch armv6l armv6hl
export GOARCH=arm
export GOARM=6
%endif
%ifarch armv7l armv7hl
export GOARCH=arm
export GOARM=7
%endif
export GOROOT="`pwd`"
export GOROOT_FINAL=%{_libdir}/go/%{go_label}
export GOBIN="$GOROOT/bin"
mkdir -p "$GOBIN"
cd src
HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash -v
cd ../
%ifarch %{tsan_arch}
# Install TSAN-friendly version of the std libraries.
bin/go install -race std
%endif
%if %{with_shared}
%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
%check
%ifarch %{tsan_arch}
# Make sure that we have the right TSAN checked out.
grep "^race_linux_%{go_arch}.syso built with LLVM %{tsan_commit}" src/runtime/race/README
%endif
%install
export GOROOT="%{buildroot}%{_libdir}/go/%{go_label}"
# locations for third party libraries, see README-openSUSE for info about locations.
install -d %{buildroot}%{_datadir}/go/%{go_label}/contrib
install -d $GOROOT/contrib/pkg/linux_%{go_arch}
ln -s %{_libdir}/go/%{go_label}/contrib/pkg/ %{buildroot}%{_datadir}/go/%{go_label}/contrib/pkg
install -d %{buildroot}%{_datadir}/go/%{go_label}/contrib/cmd
install -d %{buildroot}%{_datadir}/go/%{go_label}/contrib/src
ln -s %{_datadir}/go/%{go_label}/contrib/src/ %{buildroot}%{_libdir}/go/%{go_label}/contrib/src
install -Dm644 README.SUSE $GOROOT/contrib/
ln -s %{_libdir}/go/%{go_label}/contrib/README.SUSE %{buildroot}%{_datadir}/go/%{go_label}/contrib/README.SUSE
# source files for go install, godoc, etc
install -d %{buildroot}%{_datadir}/go/%{go_label}
for ext in *.{go,c,h,s,S,py,syso,bin}; do
find src -name ${ext} -exec install -Dm644 \{\} %{buildroot}%{_datadir}/go/%{go_label}/\{\} \;
done
# executable bash scripts called by go tool, etc
find src -name "*.bash" -exec install -Dm655 \{\} %{buildroot}%{_datadir}/go/%{go_label}/\{\} \;
mkdir -p $GOROOT/src
for i in $(ls %{buildroot}/usr/share/go/%{go_label}/src);do
ln -s /usr/share/go/%{go_label}/src/$i $GOROOT/src/$i
done
# add lib files that are needed (such as the timezone database).
install -d $GOROOT/lib
find lib -type f -exec install -D -m644 {} $GOROOT/{} \;
# copy document templates, packages, obj libs and command utilities
mkdir -p $GOROOT/bin
# remove bootstrap
rm -rf pkg/bootstrap
mv pkg $GOROOT
mv bin/* $GOROOT/bin
mkdir -p $GOROOT/misc/trace
mv misc/trace/* $GOROOT/misc/trace
# add wasm (Web Assembly) boo#1139210
mkdir -p $GOROOT/misc/wasm
mv misc/wasm/* $GOROOT/misc/wasm
rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc}
# gdbinit
install -Dm644 %{SOURCE6} $GOROOT/bin/gdbinit.d/go.gdb
%if "%{_lib}" == "lib64"
sed -i "s/lib/lib64/" $GOROOT/bin/gdbinit.d/go.gdb
sed -i "s/\$go_label/%{go_label}/" $GOROOT/bin/gdbinit.d/go.gdb
%endif
# update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d
touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt,go.gdb}
ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go
ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt
ln -sf %{_sysconfdir}/alternatives/go.gdb %{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb
# documentation and examples
# fix documetation permissions (rpmlint warning)
find doc/ misc/ -type f -exec chmod 0644 '{}' +
# remove unwanted arch-dependant binaries (rpmlint warning)
rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
# prepare go-doc
mkdir -p %{buildroot}%{_docdir}/go/%{go_label}
cp -r AUTHORS CONTRIBUTORS CONTRIBUTING.md LICENSE PATENTS README.md README.SUSE %{buildroot}%{_docdir}/go/%{go_label}
cp -r doc/* %{buildroot}%{_docdir}/go/%{go_label}
%fdupes -s %{buildroot}%{_prefix}
%post
update-alternatives \
--install %{_bindir}/go go %{_libdir}/go/%{go_label}/bin/go $((20+$(echo %{go_label} | cut -d. -f2))) \
--slave %{_bindir}/gofmt gofmt %{_libdir}/go/%{go_label}/bin/gofmt \
--slave %{_sysconfdir}/gdbinit.d/go.gdb go.gdb %{_libdir}/go/%{go_label}/bin/gdbinit.d/go.gdb
%postun
if [ $1 -eq 0 ] ; then
update-alternatives --remove go %{_libdir}/go/%{go_label}/bin/go
fi
%files
%{_bindir}/go
%{_bindir}/gofmt
%dir %{_libdir}/go
%{_libdir}/go/%{go_label}
%dir %{_datadir}/go
%{_datadir}/go/%{go_label}
%dir %{_sysconfdir}/gdbinit.d/
%config %{_sysconfdir}/gdbinit.d/go.gdb
%ghost %{_sysconfdir}/alternatives/go
%ghost %{_sysconfdir}/alternatives/gofmt
%ghost %{_sysconfdir}/alternatives/go.gdb
%dir %{_docdir}/go
%dir %{_docdir}/go/%{go_label}
%doc %{_docdir}/go/%{go_label}/AUTHORS
%doc %{_docdir}/go/%{go_label}/CONTRIBUTORS
%doc %{_docdir}/go/%{go_label}/CONTRIBUTING.md
%doc %{_docdir}/go/%{go_label}/PATENTS
%doc %{_docdir}/go/%{go_label}/README.md
%doc %{_docdir}/go/%{go_label}/README.SUSE
%if 0%{?suse_version} < 1500
%doc %{_docdir}/go/%{go_label}/LICENSE
%else
%license %{_docdir}/go/%{go_label}/LICENSE
%endif
# We don't include TSAN in the main Go package.
%ifarch %{tsan_arch}
%exclude %{_datadir}/go/%{go_label}/src/runtime/race/race_linux_%{go_arch}.syso
%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
%doc %{_docdir}/go/%{go_label}/*.html
%ifarch %{tsan_arch}
%files race
%{_datadir}/go/%{go_label}/src/runtime/race/race_linux_%{go_arch}.syso
%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

BIN
llvm-89f7ccea6f6488c443655880229c54db1f180153.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.