Rebase to go1.15beta1

This commit is contained in:
Jakub Čajka 2020-07-20 18:36:44 +02:00
parent 6db1c7a908
commit a3e201c572
No known key found for this signature in database
GPG Key ID: 48DAAF91F61E4F5D
4 changed files with 99 additions and 5 deletions

1
.gitignore vendored
View File

@ -86,3 +86,4 @@
/go1.14.3.src.tar.gz /go1.14.3.src.tar.gz
/go1.14.4.src.tar.gz /go1.14.4.src.tar.gz
/go1.14.6.src.tar.gz /go1.14.6.src.tar.gz
/go1.15beta1.src.tar.gz

View File

@ -104,12 +104,12 @@
%global gohostarch s390x %global gohostarch s390x
%endif %endif
%global go_api 1.14 %global go_api 1.15
%global go_version 1.14.6 %global go_version 1.15beta1
Name: golang Name: golang
Version: 1.14.6 Version: 1.15
Release: 1%{?dist} Release: 0.beta1.0%{?dist}
Summary: The Go Programming Language Summary: The Go Programming Language
# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
License: BSD and Public Domain License: BSD and Public Domain
@ -220,6 +220,7 @@ Requires: go-srpm-macros
Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch
Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch
Patch3: 0003-cmd-go-disable-Google-s-proxy-and-sumdb.patch Patch3: 0003-cmd-go-disable-Google-s-proxy-and-sumdb.patch
Patch4: shared-fix.patch
# Having documentation separate was broken # Having documentation separate was broken
Obsoletes: %{name}-docs < 1.1-4 Obsoletes: %{name}-docs < 1.1-4
@ -591,6 +592,9 @@ fi
%endif %endif
%changelog %changelog
* Mon Jul 20 2020 Jakub Čajka <jcajka@redhat.com> - 1.15-0.beta1.0
* Rebase to go1.15beta1
* Mon Jul 20 2020 Jakub Čajka <jcajka@redhat.com> - 1.14.6-1 * Mon Jul 20 2020 Jakub Čajka <jcajka@redhat.com> - 1.14.6-1
- Rebase to go1.14.6 - Rebase to go1.14.6
- Security fix for CVE-2020-14040 and CVE-2020-15586 - Security fix for CVE-2020-14040 and CVE-2020-15586

89
shared-fix.patch Normal file
View File

@ -0,0 +1,89 @@
From 9f33108dfa22946622a8a78b5cd3f64cd3e455dd Mon Sep 17 00:00:00 2001
From: Cherry Zhang <cherryyz@google.com>
Date: Tue, 23 Jun 2020 12:02:54 -0400
Subject: [PATCH] cmd/link: skip zero values in fingerprint check
Normally, packages are loaded in dependency order, and if a
Library object is not nil, it is already loaded with the actual
fingerprint. In shared build mode, however, packages may be added
not in dependency order (e.g. go install -buildmode=shared std
adds all std packages before loading them), and it is possible
that a Library's fingerprint is not yet loaded. Skip the check
in this case (when the fingerprint is the zero value).
Fixes #39777.
Change-Id: I66208e92bf687c8778963ba8e33e9bd948f82f3a
Reviewed-on: https://go-review.googlesource.com/c/go/+/239517
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
---
misc/cgo/testshared/shared_test.go | 6 ++++++
misc/cgo/testshared/testdata/issue39777/a/a.go | 9 +++++++++
misc/cgo/testshared/testdata/issue39777/b/b.go | 7 +++++++
src/cmd/link/internal/ld/ld.go | 7 ++++++-
4 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644 misc/cgo/testshared/testdata/issue39777/a/a.go
create mode 100644 misc/cgo/testshared/testdata/issue39777/b/b.go
diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go
index acae1b2c212c..fda3d2ce76fc 100644
--- a/misc/cgo/testshared/shared_test.go
+++ b/misc/cgo/testshared/shared_test.go
@@ -1028,3 +1028,9 @@ func TestGeneratedHash(t *testing.T) {
goCmd(nil, "install", "-buildmode=shared", "-linkshared", "./issue30768/issue30768lib")
goCmd(nil, "test", "-linkshared", "./issue30768")
}
+
+// Test that packages can be added not in dependency order (here a depends on b, and a adds
+// before b). This could happen with e.g. go build -buildmode=shared std. See issue 39777.
+func TestPackageOrder(t *testing.T) {
+ goCmd(t, "install", "-buildmode=shared", "-linkshared", "./issue39777/a", "./issue39777/b")
+}
diff --git a/misc/cgo/testshared/testdata/issue39777/a/a.go b/misc/cgo/testshared/testdata/issue39777/a/a.go
new file mode 100644
index 000000000000..c7bf8359514a
--- /dev/null
+++ b/misc/cgo/testshared/testdata/issue39777/a/a.go
@@ -0,0 +1,9 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package a
+
+import "testshared/issue39777/b"
+
+func F() { b.F() }
diff --git a/misc/cgo/testshared/testdata/issue39777/b/b.go b/misc/cgo/testshared/testdata/issue39777/b/b.go
new file mode 100644
index 000000000000..4e681965e68b
--- /dev/null
+++ b/misc/cgo/testshared/testdata/issue39777/b/b.go
@@ -0,0 +1,7 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package b
+
+func F() {}
diff --git a/src/cmd/link/internal/ld/ld.go b/src/cmd/link/internal/ld/ld.go
index 71f388b5a066..e56a6690fbcc 100644
--- a/src/cmd/link/internal/ld/ld.go
+++ b/src/cmd/link/internal/ld/ld.go
@@ -160,7 +160,12 @@ func addlib(ctxt *Link, src, obj, lib string, fingerprint goobj2.FingerprintType
pkg := pkgname(ctxt, lib)
// already loaded?
- if l := ctxt.LibraryByPkg[pkg]; l != nil {
+ if l := ctxt.LibraryByPkg[pkg]; l != nil && !l.Fingerprint.IsZero() {
+ // Normally, packages are loaded in dependency order, and if l != nil
+ // l is already loaded with the actual fingerprint. In shared build mode,
+ // however, packages may be added not in dependency order, and it is
+ // possible that l's fingerprint is not yet loaded -- exclude it in
+ // checking.
checkFingerprint(l, l.Fingerprint, src, fingerprint)
return l
}

View File

@ -1 +1 @@
SHA512 (go1.14.6.src.tar.gz) = 5c865c8272fb0dc8eab1514732b0200dbc867276512714dd30afc658a0d2afac6bd758e00c6f576d8d254e411418a52a564c895399b56cfe06c2b1785271a8fd SHA512 (go1.15beta1.src.tar.gz) = 5b894b0d22a7ecb8d056c6a8936d708f189ff12e77dd8547fe5144e7b37888fb30b0bec87f22453db5c976305826f3a1c86c20c40a525b004f743aa896d62ea1