Compare commits

...

102 Commits
f25 ... master

Author SHA1 Message Date
Jakub Čajka 27a8ad3859
Rebase to go1.15.5
Security fix for CVE-2020-28362, CVE-2020-28367 and CVE-2020-28366
Resolves: BZ#1897342, BZ#1897636, BZ#1897644, BZ#1897647
2020-11-14 08:55:50 +01:00
Jakub Čajka c88a8dfff5
Rebase to go1.15.4
Resolves BZ#1895189
2020-11-06 16:34:38 +01:00
Jakub Čajka 61730a32f4
Rebase to go1.15.3
Resolves: BZ#1888443
2020-10-15 13:41:00 +02:00
Jakub Čajka d7ab797463
Rebase to go1.15.2
Resolves: BZ#1877565
2020-09-10 12:57:26 +02:00
Jakub Čajka fb39d90765
Rebase to go1.15.1
Security fix for CVE-2020-24553
Resolves: BZ#1874858, BZ#1866892
2020-09-04 15:43:41 +02:00
Jakub Čajka d3aa981e83
Rebase to go1.15 proper
Resolves: BZ#1859241, BZ#1866892
2020-08-12 10:33:11 +02:00
Jakub Čajka dac586c9c7
Rebase to go1.15rc1
Security fix for CVE-2020-16845
Resolves: BZ#1867101
Related: BZ#1859241
2020-08-10 12:04:23 +02:00
Fedora Release Engineering e8c1f5c4a2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 20:57:54 +00:00
Jakub Čajka 132cf34fe6
Rebase to go1.15rc1
Related: BZ#1859241
2020-07-27 10:26:48 +02:00
Jakub Čajka a3e201c572
Rebase to go1.15beta1 2020-07-20 18:36:44 +02:00
Jakub Čajka 6db1c7a908
Rebase to go1.14.6
Security fix for CVE-2020-14040 and CVE-2020-15586
Resolves: BZ#1842708, BZ#1856957, BZ#1853653
2020-07-20 10:27:10 +02:00
Alejandro Sáez 0cb15e561e Add patch that fixes issue in ppc64le
Fix: https://golang.org/issue/39991
Add sources
2020-07-14 14:48:03 +02:00
Jakub Čajka 91d21a3bde
It is FALGS 2020-07-03 08:31:27 +02:00
Jakub Čajka ea99ebaff6
Workaround tests failures on aarch64 2020-07-02 21:35:44 +02:00
Alejandro Sáez ecf8f72447 Rebase to go1.14.4
Related: BZ#1842708
2020-07-02 18:30:16 +00:00
Jakub Čajka fde02715d5
Add new sources and BZ 2020-05-21 08:37:26 +02:00
Álex Sáez 8716ef4de3 Rebase to go1.14.3 2020-05-18 19:59:24 +02:00
Jakub Čajka aa89c2b0f2
Rebase to go1.14.2
Resolves: BZ#1815282
2020-04-20 13:34:36 +02:00
Neal Gompa 1f08860197 Fix building on older than EL8
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2020-04-18 13:26:06 -04:00
Jakub Čajka 4487a1b142
Rebase to go1.14 proper
Resolves: BZ#1792475
2020-02-26 15:26:46 +01:00
Jakub Čajka 9f5b8dce35
Rebase to go1.14rc1 2020-02-06 13:40:49 +01:00
Fedora Release Engineering 4751ecad2f - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 23:13:43 +00:00
Jakub Čajka fd2a3fb06e
Rebase to go1.14beta1
Resolves: BZ#1792475
2020-01-21 10:24:40 +01:00
Jakub Čajka fbfc80f071
Rebase to go1.13.6 2020-01-13 22:15:11 +01:00
Jakub Čajka 1524937377
Rebase to go1.13.5 2019-12-05 13:39:28 +01:00
Neal Gompa a522b09638 Fix date for changelog entry
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2019-12-04 09:05:11 -05:00
Neal Gompa 50defcc683 Small fixes to the spec and tighten up the file list
Signed-off-by: Neal Gompa <ngompa@datto.com>
2019-12-02 11:27:25 -05:00
Jakub Čajka f445d76353
Rebase to go1.13.4
Resolves: BZ#1767673
2019-11-01 16:38:39 +01:00
Jakub Čajka 069e0f1f5f
Rebase to go1.13.3
Fix for CVE-2019-17596
Resolves: BZ#1755639, BZ#1763312
2019-10-21 16:20:13 +02:00
Jakub Čajka 151fe9ed9a Rebase to go1.13.1
Fix for CVE-2019-16276
Resolves: BZ#1755970

Signed-off-by: Jakub Čajka <jcajka@redhat.com>
2019-09-30 08:57:44 +02:00
Jakub Čajka 25a05dd355 Back to go1.13 tls1.3 behavior
Signed-off-by: Jakub Čajka <jcajka@redhat.com>
2019-09-05 13:52:39 +02:00
Jakub Čajka 8f7b389463 Rebase to go1.13 2019-09-04 13:26:49 +02:00
Jakub Čajka e45411af09 Rebase to 1.13rc2
Do not enable tls1.3 by default
Related: BZ#1737471
2019-09-03 17:26:29 +02:00
Jakub Čajka af8d391cb2 Actually fix CVE-2019-9514 and CVE-2019-9512 2019-08-28 12:37:49 +02:00
Jakub Čajka 081d5ff6f2 Rebase to 1.13rc1
Fix for CVE-2019-14809, CVE-2019-9514 and CVE-2019-9512
Resolves: BZ#1741816, BZ#1741827 and BZ#1743131
2019-08-26 12:09:05 +02:00
Jakub Čajka 0e633c63ed Fix ICE affecting aarch64
Resolves: BZ#1735290
2019-08-02 10:42:35 +02:00
Fedora Release Engineering 140a7e1b44 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 04:35:33 +00:00
Jakub Čajka 29d5602b19 De-configure sumdb and go proxy 2019-07-24 01:35:09 +02:00
Jakub Čajka f80e5ff991 Rebase to 1.13beta1
Related: BZ#1732118
2019-07-24 00:27:11 +02:00
Jakub Čajka a94ffe83e5 Rebase to 1.12.7
Resolves: BZ#1728056
2019-07-09 16:38:56 +02:00
Jakub Čajka 6c0cf70db5 Rebase to go1.12.6
Resolvse: BZ#1719483
2019-06-12 16:09:25 +02:00
Jakub Čajka a562f38c65 Rebase to go1.12.5
Resolves: BZ#1707187
2019-05-07 14:22:33 +02:00
Jakub Čajka f344d3da25 Rebase to 1.12.2
Resolves: BZ#1688996
2019-04-08 10:49:18 +02:00
Jakub Čajka 9985c0a473 Fixup changelog 2019-04-01 09:59:04 +02:00
Jakub Čajka ef14b33215 Rebase to 1.12.1
Fix CVE-2019-9741
Use weak deps for SCM deps
Resolves: BZ#1688233
2019-03-15 09:53:03 +01:00
Tim Landscheidt ff7ebd7613 Fix requirement for %preun (instead of %postun) scriptlet 2019-03-12 19:01:55 +00:00
Jakub Čajka c74b6b6cb8 Rebase to go1.12 proper
Resolves:  BZ#1680040
2019-02-27 21:29:49 +01:00
Jakub Čajka 73766cf515 Rebase to go1.12rc1 2019-02-18 10:08:01 +01:00
Fedora Release Engineering e3e1bdbf46 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 23:34:32 +00:00
Jakub Čajka 8ae8c86871 Fix for CVE-2019-6486 2019-01-29 12:52:29 +01:00
Jakub Čajka bc69b83b00 Rebase to go1.12beta2 2019-01-11 13:33:12 +01:00
Jakub Čajka 50b7643bf7 Rebase to go1.11.4
Fix for CVE-2018-16875, CVE-2018-16874 and CVE-2018-16873
Resolves: BZ#1659290, BZ#1659289, BZ#1659288
2019-01-02 11:50:21 +01:00
Jakub Čajka b86284b4f3 Rebase to 1.11.2 2018-11-05 15:16:56 +01:00
Jakub Čajka eb7ec5ddc1 Rebase to 1.11.1 2018-10-06 15:39:01 +02:00
Jakub Čajka 3014b94569 Rebase to 1.11 release 2018-08-27 16:21:42 +02:00
Jakub Čajka f1f6f5d515 Rebase to go1.11rc2
Reduce size of bin package
2018-08-23 11:20:46 +02:00
Jakub Čajka a273a5236a Rebase to go 1.11rc1 2018-08-14 14:48:38 +02:00
Jakub Čajka c45c363337 Rebase to go 1.11beta3 2018-08-06 12:28:08 +02:00
Jakub Čajka 4043bb182d Turn on back DWARF compression by default
Use less memory on 32bit targets during build
2018-07-27 15:36:47 +02:00
Jakub Čajka 62f2ae0511 Rebase to 1.11beta2 2018-07-20 10:14:54 +02:00
Jakub Čajka 75f7f03cb6 Turn off DWARF compression by default as it is not supported by rpm/debuginfo 2018-07-18 14:00:27 +02:00
Fedora Release Engineering 72a9f2e921 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 03:12:06 +00:00
Jakub Čajka 19d1adeab4 Rebase to go1.11beta1 2018-07-10 21:46:22 +02:00
Jakub Čajka c333e76e86 Rebase to 1.10.3 2018-06-11 09:04:52 +02:00
Jakub Čajka 6caa43c106 Rebase to 1.10.2
Patch clean up
2018-05-03 11:11:48 +02:00
Jakub Čajka 66a92c4de7 Rebase to 1.10.1
Resolves: BZ#1562270
2018-04-04 10:10:28 +02:00
Jakub Čajka 2389428bde Fix CVE-2018-7187
Resolves: BZ#1546386, BZ#1546388
2018-03-03 11:26:41 +01:00
Jakub Čajka e8abe4385f Add dependency on scm tools so go get works out of box in minimal envs 2018-02-21 13:11:15 +01:00
Jakub Čajka 639f9ab37f Rebase to 1.10 2018-02-21 13:01:34 +01:00
Jakub Čajka 5f45ed12c2 Rebase to 1.10rc2
Fix CVE-2018-6574
Resolves: BZ#1543561, BZ#1543562
2018-02-09 13:49:40 +01:00
Fedora Release Engineering 13bb238b09 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 13:48:58 +00:00
Jakub Čajka 63e3cb4201 Rebase to 1.10rc1 2018-01-27 09:34:18 +01:00
Jakub Čajka 77baa559ba Rebase to 1.10beta2 2018-01-12 12:47:23 +01:00
Jakub Čajka d37b3b5006 Rebase to 1.10beta1
Drop verbose patch as most of it is now implemented by bootstrap tool and is easily toggled by passing -v flag to make.bash
2018-01-09 12:59:49 +01:00
Jakub Čajka 4bc73c764a Add bundled provides 2017-12-06 12:22:23 +01:00
Jakub Čajka b65272222a Temporalily ignore test failures on 32bit intel and aarch64 2017-11-23 16:28:44 +01:00
Jakub Čajka 315b776905 Rebase to 1.9.2
execute correctly pie tests
allow to ignore tests via bcond
reduce size of golang package
2017-11-07 13:42:51 +01:00
Jakub Čajka 920ea39083 add bcond for bootstraping 2017-10-12 15:52:28 +02:00
Jakub Čajka 387b897724 Use corect version 2017-10-06 13:17:08 +02:00
Jakub Čajka ceb83a748c fix CVE-2017-15041 and CVE-2017-15042 2017-10-06 13:12:30 +02:00
Jakub Čajka 903219bc93 Bump to release version 2017-09-15 13:25:24 +02:00
Fedora Release Engineering cb0891bb70 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 22:14:37 +00:00
Fedora Release Engineering 494a6d19c3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 11:03:59 +00:00
Jakub Čajka 9941f71a57 Mention upstream issue in s390x-ignore... patch 2017-07-13 12:39:15 +02:00
Jakub Čajka c2d0ceffa4 Merge branch 'master' of ssh://pkgs.fedoraproject.org/golang 2017-07-12 17:43:58 +02:00
Jakub Čajka 3cc854f423 Improved s390x patch 2017-07-12 17:26:26 +02:00
Petr Písař c7375398e7 perl dependency renamed to perl-interpreter <https://fedoraproject.org/wiki/Changes/perl_Package_to_Install_Core_Modules> 2017-07-12 14:32:33 +02:00
Jakub Čajka 5767354120 Bump to 1.9beta2
Workaround build failure on s390x
2017-07-12 13:38:36 +02:00
Jakub Čajka 45041c89fe bump to 1.8.3
fix for CVE-2017-8932
make possible to use 31bit OID in ASN1
Resolves: BZ#1454978, BZ#14551
2017-05-26 14:45:09 +02:00
Jakub Čajka 0a43a1cbaf fix uint64 constant codegen on s390x
Resolves: BZ#1441078
2017-04-21 14:56:13 +02:00
Jakub Čajka 1344685ff3 Revert: Final modularity bootstrap 2017-04-12 12:28:20 +02:00
Jakub Čajka 5706a3480e Final modularity bootstrap 2017-04-12 12:20:02 +02:00
Jakub Čajka ab6ee497cb Revert: modularity bootstrap 2017-04-12 10:29:49 +02:00
Jakub Čajka 29646808b3 Modularity bootstrap :) 2017-04-12 10:26:16 +02:00
Vincent Batts d83d5139a6
Revert "spec: hard code the bootstrap for a modularity build"
This reverts commit 63fbc71112.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2017-04-11 10:14:48 -04:00
Vincent Batts 63fbc71112
spec: hard code the bootstrap for a modularity build
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2017-04-11 10:13:43 -04:00
Jakub Čajka 749ec62908 bump to Go 1.8.1
Resolves: BZ#1440345
2017-04-11 10:41:35 +02:00
Jakub Čajka a1ca3c96e0 avoid possibly stale packages due to chacha test file not being test file 2017-02-24 13:41:35 +01:00
Jakub Čajka 1bf7308023 Bump to released 1.8
Ignore ppc64 tests failure for time beeing, haven't managed to reproduce localy
2017-02-20 15:50:48 +01:00
Fedora Release Engineering 7dabca5bf2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 11:37:38 +00:00
Jakub Čajka b881112930 make possible to override default traceback level at build time
add sub-package race containing std lib built with -race enabled
Related: BZ#1411242
2017-01-31 15:11:25 +01:00
Jakub Čajka 100fcef237 rebase to go1.8rc3
Resolves: BZ#1411242
2017-01-27 11:39:40 +01:00
14 changed files with 722 additions and 832 deletions

58
.gitignore vendored
View File

@ -37,3 +37,61 @@
/go1.7.1.src.tar.gz
/go1.7.3.src.tar.gz
/go1.7.4.src.tar.gz
/go1.8rc3.src.tar.gz
/go1.8.src.tar.gz
/go1.8.1.src.tar.gz
/go1.8.3.src.tar.gz
/go1.9beta2.src.tar.gz
/go1.9.src.tar.gz
/go1.9.1.src.tar.gz
/go1.9.2.src.tar.gz
/go1.10beta1.src.tar.gz
/go1.10beta2.src.tar.gz
/go1.10rc1.src.tar.gz
/go1.10rc2.src.tar.gz
/go1.10.src.tar.gz
/go1.10.1.src.tar.gz
/go1.10.2.src.tar.gz
/go1.10.3.src.tar.gz
/go1.11beta1.src.tar.gz
/go1.11beta2.src.tar.gz
/go1.11beta3.src.tar.gz
/go1.11rc1.src.tar.gz
/go1.11rc2.src.tar.gz
/go1.11.src.tar.gz
/go1.11.1.src.tar.gz
/go1.11.2.src.tar.gz
/go1.11.4.src.tar.gz
/go1.12beta2.src.tar.gz
/go1.12rc1.src.tar.gz
/go1.12.src.tar.gz
/go1.12.1.src.tar.gz
/go1.12.2.src.tar.gz
/go1.12.5.src.tar.gz
/go1.12.6.src.tar.gz
/go1.12.7.src.tar.gz
/go1.13beta1.src.tar.gz
/go1.13rc1.src.tar.gz
/go1.13rc2.src.tar.gz
/go1.13.src.tar.gz
/go1.13.1.src.tar.gz
/go1.13.3.src.tar.gz
/go1.13.4.src.tar.gz
/go1.13.5.src.tar.gz
/go1.13.6.src.tar.gz
/go1.14beta1.src.tar.gz
/go1.14rc1.src.tar.gz
/go1.14.src.tar.gz
/go1.14.2.src.tar.gz
/go1.14.3.src.tar.gz
/go1.14.4.src.tar.gz
/go1.14.6.src.tar.gz
/go1.15beta1.src.tar.gz
/go1.15rc1.src.tar.gz
/go1.15rc2.src.tar.gz
/go1.15.src.tar.gz
/go1.15.1.src.tar.gz
/go1.15.2.src.tar.gz
/go1.15.3.src.tar.gz
/go1.15.4.src.tar.gz
/go1.15.5.src.tar.gz

View File

@ -0,0 +1,88 @@
From edce31a2904846ae74e3c011f2cf5fddc963459e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
Date: Thu, 22 Mar 2018 12:07:32 +0100
Subject: [PATCH 1/3] Don't use the bundled tzdata at runtime, except for the
internal test suite
---
src/time/internal_test.go | 7 +++++--
src/time/zoneinfo_test.go | 3 ++-
src/time/zoneinfo_unix.go | 2 --
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/time/internal_test.go b/src/time/internal_test.go
index 76d5524124..e81ace5f64 100644
--- a/src/time/internal_test.go
+++ b/src/time/internal_test.go
@@ -4,13 +4,15 @@
package time
+import "runtime"
+
func init() {
// force US/Pacific for time zone tests
ForceUSPacificForTesting()
}
func initTestingZone() {
- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:])
+ z, err := loadLocation("America/Los_Angeles", zoneSources)
if err != nil {
panic("cannot load America/Los_Angeles for testing: " + err.Error())
}
@@ -21,8 +23,9 @@ func initTestingZone() {
var OrigZoneSources = zoneSources
func forceZipFileForTesting(zipOnly bool) {
- zoneSources = make([]string, len(OrigZoneSources))
+ zoneSources = make([]string, len(OrigZoneSources)+1)
copy(zoneSources, OrigZoneSources)
+ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if zipOnly {
zoneSources = zoneSources[len(zoneSources)-1:]
}
diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go
index 7a55d4f618..6063ca1195 100644
--- a/src/time/zoneinfo_test.go
+++ b/src/time/zoneinfo_test.go
@@ -8,6 +8,7 @@ import (
"fmt"
"os"
"reflect"
+ "runtime"
"testing"
"time"
)
@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testing.T) {
t.Fatal(err)
}
- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
+ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if err != nil {
t.Fatal(err)
}
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index 88313aa0ed..d9596115ef 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -12,7 +12,6 @@
package time
import (
- "runtime"
"syscall"
)
@@ -22,7 +21,6 @@ var zoneSources = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
}
func initLocal() {
--
2.14.3

View File

@ -1,7 +1,7 @@
From 84b8c9ceaa5257f7ff4ab059ff208246ecdfe9d9 Mon Sep 17 00:00:00 2001
From 817407fc2d6a861e65086388766f58082d38bc0b Mon Sep 17 00:00:00 2001
From: Michael Munday <munday@ca.ibm.com>
Date: Tue, 17 Jan 2017 11:33:38 -0500
Subject: [PATCH] syscall: expose IfInfomsg.X__ifi_pad on s390x
Subject: [PATCH 2/3] syscall: expose IfInfomsg.X__ifi_pad on s390x
Exposing this field on s390x improves compatibility with the other
linux architectures, all of which already expose it.
@ -10,12 +10,14 @@ Fixes #18628 and updates #18632.
Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5
---
src/syscall/ztypes_linux_s390x.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go
index 63c4a83..b589425 100644
index 63c4a83b19..b5894255df 100644
--- a/src/syscall/ztypes_linux_s390x.go
+++ b/src/syscall/ztypes_linux_s390x.go
@@ -449,12 +449,12 @@
@@ -449,12 +449,12 @@ type RtAttr struct {
}
type IfInfomsg struct {
@ -34,3 +36,6 @@ index 63c4a83..b589425 100644
}
type IfAddrmsg struct {
--
2.14.3

View File

@ -0,0 +1,54 @@
From b38cd2374c2395f5a77802ef8ea3d7ac5b8a86ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
Date: Mon, 27 May 2019 15:12:53 +0200
Subject: [PATCH 3/3] cmd/go: disable Google's proxy and sumdb
---
src/cmd/go/internal/cfg/cfg.go | 10 +++++-----
src/cmd/go/testdata/script/mod_sumdb_golang.txt | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
index 61dc6bdda6..e8658dc56c 100644
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
@@ -245,11 +245,11 @@ var (
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", objabi.GOPPC64))
GOWASM = envOr("GOWASM", fmt.Sprint(objabi.GOWASM))
- GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
- GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
- GOPRIVATE = Getenv("GOPRIVATE")
- GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
- GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
+ GOPROXY = envOr("GOPROXY", "direct")
+ GOSUMDB = envOr("GOSUMDB", "off")
+ GOPRIVATE = Getenv("GOPRIVATE")
+ GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
+ GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
GOINSECURE = Getenv("GOINSECURE")
)
diff --git a/src/cmd/go/testdata/script/mod_sumdb_golang.txt b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
index 40a07fc7e9..50436e32d7 100644
--- a/src/cmd/go/testdata/script/mod_sumdb_golang.txt
+++ b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
@@ -2,12 +2,12 @@
env GOPROXY=
env GOSUMDB=
go env GOPROXY
-stdout '^https://proxy.golang.org,direct$'
+stdout '^direct$'
go env GOSUMDB
-stdout '^sum.golang.org$'
+stdout '^off$'
env GOPROXY=https://proxy.golang.org
go env GOSUMDB
-stdout '^sum.golang.org$'
+stdout '^off$'
# download direct from github
[!net] skip
--
2.21.0

7
fedora.go Normal file
View File

@ -0,0 +1,7 @@
// +build rpm_crashtraceback
package runtime
func init() {
setTraceback("crash")
}

View File

@ -1,21 +0,0 @@
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index ed9502d..c2569e7 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -32,14 +32,14 @@ var zoneDirs = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
}
var origZoneDirs = zoneDirs
func forceZipFileForTesting(zipOnly bool) {
- zoneDirs = make([]string, len(origZoneDirs))
+ zoneDirs = make([]string, len(origZoneDirs)+1)
copy(zoneDirs, origZoneDirs)
+ zoneDirs = append(zoneDirs, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if zipOnly {
for i := 0; i < len(zoneDirs)-1; i++ {
zoneDirs[i] = "/XXXNOEXIST"

View File

@ -1,12 +0,0 @@
diff -up go/src/runtime/runtime-gdb_test.go.gdb go/src/runtime/runtime-gdb_test.go
--- go/src/runtime/runtime-gdb_test.go.gdb 2016-04-28 10:31:13.005689813 +0200
+++ go/src/runtime/runtime-gdb_test.go 2016-04-28 10:32:12.202935125 +0200
@@ -72,7 +72,7 @@ func main() {
}
`
-func TestGdbPython(t *testing.T) {
+func testGdbPython(t *testing.T) {
checkGdbEnvironment(t)
checkGdbVersion(t)
checkGdbPython(t)

View File

@ -1,19 +0,0 @@
Index: go/src/make.bash
===================================================================
--- go.orig/src/make.bash
+++ go/src/make.bash
@@ -153,12 +153,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
# use the host compiler, CC, from `cmd/dist/dist env` instead.
CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
- "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+ "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd
echo
fi
echo "##### Building packages and commands for $GOOS/$GOARCH."
-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd
echo
rm -f "$GOTOOLDIR"/go_bootstrap

View File

@ -1,58 +0,0 @@
diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go
--- go/src/cmd/dist/buildtool.go.bootstrap 2016-06-06 14:26:37.638374670 +0200
+++ go/src/cmd/dist/buildtool.go 2016-06-06 14:30:33.873262307 +0200
@@ -111,15 +111,23 @@ func bootstrapBuildTools() {
defer os.Setenv("GOBIN", os.Getenv("GOBIN"))
os.Setenv("GOBIN", "")
+ hostos := os.Getenv("GOHOSTOS")
+ hostarch := os.Getenv("GOHOSTARCH")
+
os.Setenv("GOOS", "")
os.Setenv("GOHOSTOS", "")
os.Setenv("GOARCH", "")
os.Setenv("GOHOSTARCH", "")
+ bingopath := pathf("%s/bin/%s_%s/go", goroot_bootstrap, hostos, hostarch)
+ if _, err := os.Stat(bingopath); os.IsNotExist(err) {
+ bingopath = pathf("%s/bin/go", goroot_bootstrap)
+ }
+
// Run Go 1.4 to build binaries. Use -gcflags=-l to disable inlining to
// workaround bugs in Go 1.4's compiler. See discussion thread:
// https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ
- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-gcflags=-l", "-v", "bootstrap/...")
+ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-gcflags=-l", "-v", "bootstrap/...")
// Copy binaries into tool binary directory.
for _, name := range bootstrapDirs {
diff -up go/src/make.bash.bootstrap go/src/make.bash
--- go/src/make.bash.bootstrap 2016-06-06 14:26:37.628374633 +0200
+++ go/src/make.bash 2016-06-06 14:26:37.638374670 +0200
@@ -118,8 +118,15 @@ echo '##### Building Go bootstrap tool.'
echo cmd/dist
export GOROOT="$(cd .. && pwd)"
GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
+if [ -x "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" ]; then
+ rm -f cmd/dist/dist
+ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" build -o cmd/dist/dist ./cmd/dist
+elif [ -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
+ rm -f cmd/dist/dist
+ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+else
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
+ echo "ERROR: or $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
exit 1
fi
@@ -128,8 +135,6 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ];
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
exit 1
fi
-rm -f cmd/dist/dist
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" 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)

View File

@ -1,3 +1,12 @@
%bcond_with bootstrap
# temporalily ignore test failures
# due to https://github.com/golang/go/issues/39466
%ifarch aarch64
%bcond_without ignore_tests
%else
%bcond_with ignore_tests
%endif
# build ids are not currently generated:
# https://code.google.com/p/go/issues/detail?id=5238
#
@ -24,6 +33,9 @@
%global golibdir %{_libdir}/golang
# This macro may not always be defined, ensure it is
%{!?gopath: %global gopath %{_datadir}/gocode}
# Golang build options.
# Build golang using external/internal(close to cgo disabled) linking.
@ -41,17 +53,17 @@
%endif
# Use golang/gcc-go as bootstrap compiler
%ifarch %{golang_arches}
%global golang_bootstrap 1
%else
%if %{with bootstrap}
%global golang_bootstrap 0
%else
%global golang_bootstrap 1
%endif
# Controls what ever we fail on failed tests
%ifarch %{ix86} x86_64 %{arm} aarch64 %{power64}
%global fail_on_tests 1
%else
%if %{with ignore_tests}
%global fail_on_tests 0
%else
%global fail_on_tests 1
%endif
# Build golang shared objects for stdlib
@ -61,6 +73,13 @@
%global shared 0
%endif
# Pre build std lib with -race enabled
%ifarch x86_64
%global race 1
%else
%global race 0
%endif
# Fedora GOROOT
%global goroot /usr/lib/%{name}
@ -86,17 +105,19 @@
%global gohostarch s390x
%endif
%global go_api 1.7
%global go_version 1.7.4
%global go_api 1.15
%global go_version 1.15.5
Name: golang
Version: 1.7.4
Release: 2%{?dist}
Version: 1.15.5
Release: 1%{?dist}
Summary: The Go Programming Language
# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
License: BSD and Public Domain
URL: http://golang.org/
Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz
# make possible to override default traceback level at build time by setting build tag rpm_crashtraceback
Source1: fedora.go
# The compiler is written in Go. Needs go(1.4+) compiler for build.
%if !%{golang_bootstrap}
@ -110,35 +131,112 @@ BuildRequires: hostname
BuildRequires: net-tools
%endif
# for tests
BuildRequires: pcre-devel, glibc-static, perl
BuildRequires: pcre-devel, glibc-static, perl-interpreter, procps-ng
Provides: go = %{version}-%{release}
# Bundled/Vendored provides generated by
# go list -f {{.ImportPath}} ./src/vendor/... | sed "s:_$PWD/src/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):" && go list -f {{.ImportPath}} ./src/cmd/vendor/... | sed "s:_$PWD/src/cmd/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):"
Provides: bundled(golang(golang.org/x/crypto/chacha20))
Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305))
Provides: bundled(golang(golang.org/x/crypto/cryptobyte))
Provides: bundled(golang(golang.org/x/crypto/cryptobyte/asn1))
Provides: bundled(golang(golang.org/x/crypto/curve25519))
Provides: bundled(golang(golang.org/x/crypto/hkdf))
Provides: bundled(golang(golang.org/x/crypto/internal/subtle))
Provides: bundled(golang(golang.org/x/crypto/poly1305))
Provides: bundled(golang(golang.org/x/net/dns/dnsmessage))
Provides: bundled(golang(golang.org/x/net/http/httpguts))
Provides: bundled(golang(golang.org/x/net/http/httpproxy))
Provides: bundled(golang(golang.org/x/net/http2/hpack))
Provides: bundled(golang(golang.org/x/net/idna))
Provides: bundled(golang(golang.org/x/net/nettest))
Provides: bundled(golang(golang.org/x/sys/cpu))
Provides: bundled(golang(golang.org/x/text/secure/bidirule))
Provides: bundled(golang(golang.org/x/text/transform))
Provides: bundled(golang(golang.org/x/text/unicode/bidi))
Provides: bundled(golang(golang.org/x/text/unicode/norm))
Provides: bundled(golang(github.com/google/pprof/driver))
Provides: bundled(golang(github.com/google/pprof/internal/binutils))
Provides: bundled(golang(github.com/google/pprof/internal/driver))
Provides: bundled(golang(github.com/google/pprof/internal/elfexec))
Provides: bundled(golang(github.com/google/pprof/internal/graph))
Provides: bundled(golang(github.com/google/pprof/internal/measurement))
Provides: bundled(golang(github.com/google/pprof/internal/plugin))
Provides: bundled(golang(github.com/google/pprof/internal/report))
Provides: bundled(golang(github.com/google/pprof/internal/symbolizer))
Provides: bundled(golang(github.com/google/pprof/internal/symbolz))
Provides: bundled(golang(github.com/google/pprof/internal/transport))
Provides: bundled(golang(github.com/google/pprof/profile))
Provides: bundled(golang(github.com/google/pprof/third.party/d3))
Provides: bundled(golang(github.com/google/pprof/third.party/d3flamegraph))
Provides: bundled(golang(github.com/google/pprof/third.party/svgpan))
Provides: bundled(golang(github.com/ianlancetaylor/demangle))
Provides: bundled(golang(golang.org/x/arch/arm/armasm))
Provides: bundled(golang(golang.org/x/arch/arm64/arm64asm))
Provides: bundled(golang(golang.org/x/arch/ppc64/ppc64asm))
Provides: bundled(golang(golang.org/x/arch/x86/x86asm))
Provides: bundled(golang(golang.org/x/crypto/ed25519))
Provides: bundled(golang(golang.org/x/crypto/ed25519/internal/edwards25519))
Provides: bundled(golang(golang.org/x/crypto/ssh/terminal))
Provides: bundled(golang(golang.org/x/mod/internal/lazyregexp))
Provides: bundled(golang(golang.org/x/mod/modfile))
Provides: bundled(golang(golang.org/x/mod/module))
Provides: bundled(golang(golang.org/x/mod/semver))
Provides: bundled(golang(golang.org/x/mod/sumdb))
Provides: bundled(golang(golang.org/x/mod/sumdb/dirhash))
Provides: bundled(golang(golang.org/x/mod/sumdb/note))
Provides: bundled(golang(golang.org/x/mod/sumdb/tlog))
Provides: bundled(golang(golang.org/x/mod/zip))
Provides: bundled(golang(golang.org/x/sys/internal/unsafeheader))
Provides: bundled(golang(golang.org/x/sys/unix))
Provides: bundled(golang(golang.org/x/tools/go/analysis))
Provides: bundled(golang(golang.org/x/tools/go/analysis/internal/analysisflags))
Provides: bundled(golang(golang.org/x/tools/go/analysis/internal/facts))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/asmdecl))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/assign))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/atomic))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/bools))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/buildtag))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/cgocall))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/composite))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/copylock))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/ctrlflow))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/errorsas))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/httpresponse))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/ifaceassert))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/inspect))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/internal/analysisutil))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/loopclosure))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/lostcancel))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/nilfunc))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/printf))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/shift))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/stdmethods))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/stringintconv))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/structtag))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/tests))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/unmarshal))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/unreachable))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/unsafeptr))
Provides: bundled(golang(golang.org/x/tools/go/analysis/passes/unusedresult))
Provides: bundled(golang(golang.org/x/tools/go/analysis/unitchecker))
Provides: bundled(golang(golang.org/x/tools/go/ast/astutil))
Provides: bundled(golang(golang.org/x/tools/go/ast/inspector))
Provides: bundled(golang(golang.org/x/tools/go/cfg))
Provides: bundled(golang(golang.org/x/tools/go/types/objectpath))
Provides: bundled(golang(golang.org/x/tools/go/types/typeutil))
Provides: bundled(golang(golang.org/x/tools/internal/analysisinternal))
Provides: bundled(golang(golang.org/x/xerrors))
Provides: bundled(golang(golang.org/x/xerrors/internal))
Requires: %{name}-bin = %{version}-%{release}
Requires: %{name}-src = %{version}-%{release}
Requires: go-srpm-macros
Patch0: golang-1.2-verbose-build.patch
# use the arch dependent path in the bootstrap
Patch212: golang-1.5-bootstrap-binary-path.patch
# disable TestGdbPython
# https://github.com/golang/go/issues/11214
Patch213: go1.5beta1-disable-TestGdbPython.patch
# we had been just removing the zoneinfo.zip, but that caused tests to fail for users that
# later run `go test -a std`. This makes it only use the zoneinfo.zip where needed in tests.
Patch215: ./go1.5-zoneinfo_testing_only.patch
#PPC64X relocation overflow fix
Patch216: ppc64x-overflow-1.patch
Patch217: ppc64x-overflow-2.patch
# Fix for https://github.com/golang/go/issues/17276
Patch218: tzdata-fix.patch
# Proposed patch by mmunday https://golang.org/cl/35262
Patch219: s390x-expose-IfInfomsg-X__ifi_pad.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
Patch3: 0003-cmd-go-disable-Google-s-proxy-and-sumdb.patch
# Having documentation separate was broken
Obsoletes: %{name}-docs < 1.1-4
@ -191,6 +289,8 @@ BuildArch: noarch
%package bin
Summary: Golang core compiler tools
# Some distributions refer to this package by this name
Provides: %{name}-go = %{version}-%{release}
Requires: go = %{version}-%{release}
# Pre-go1.5, all arches had to be bootstrapped individually, before usable, and
# env variables to compile for the target os-arch.
@ -221,12 +321,17 @@ Obsoletes: golang-vet < 0-12.1
Obsoletes: golang-cover < 0-12.1
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
Requires(preun): %{_sbindir}/update-alternatives
# We strip the meta dependency, but go does require glibc.
# This is an odd issue, still looking for a better fix.
Requires: glibc
Requires: gcc
%if 0%{?rhel} && 0%{?rhel} < 8
Requires: git, subversion, mercurial
%else
Recommends: git, subversion, mercurial
%endif
%description bin
%{summary}
@ -248,26 +353,20 @@ Summary: Golang shared object libraries
%{summary}.
%endif
%if %{race}
%package race
Summary: Golang std library with -race enabled
Requires: %{name} = %{version}-%{release}
%description race
%{summary}
%endif
%prep
%setup -q -n go
%autosetup -p1 -n go
# increase verbosity of build
%patch0 -p1 -b .verbose
# use the arch dependent path in the bootstrap
%patch212 -p1 -b .bootstrap
# disable TestGdbPython
%patch213 -p1 -b .gdb
%patch215 -p1
%patch216 -p1
%patch217 -p1
%patch218 -p1
%patch219 -p1
cp %{SOURCE1} ./src/runtime/
%build
# print out system information
@ -302,16 +401,22 @@ export GO_LDFLAGS="-linkmode internal"
%if !%{cgo_enabled}
export CGO_ENABLED=0
%endif
./make.bash --no-clean
./make.bash --no-clean -v
popd
# build shared std lib
%if %{shared}
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std
%endif
%if %{race}
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race -v -x std
%endif
%install
rm -rf $RPM_BUILD_ROOT
# remove GC build cache
rm -rf pkg/obj/go-build/*
# create the top level directories
mkdir -p $RPM_BUILD_ROOT%{_bindir}
@ -332,17 +437,18 @@ cwd=$(pwd)
src_list=$cwd/go-src.list
pkg_list=$cwd/go-pkg.list
shared_list=$cwd/go-shared.list
race_list=$cwd/go-race.list
misc_list=$cwd/go-misc.list
docs_list=$cwd/go-docs.list
tests_list=$cwd/go-tests.list
rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list
rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list $race_list
touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list $race_list
pushd $RPM_BUILD_ROOT%{goroot}
find src/ -type d -a \( ! -name testdata -a ! -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $src_list
find src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $src_list
find src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test.go' \) -printf '%{goroot}/%p\n' >> $src_list
find bin/ pkg/ -type d -a ! -path '*_dynlink/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list
find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -printf '%{goroot}/%p\n' >> $pkg_list
find bin/ pkg/ -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list
find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' -printf '%{goroot}/%p\n' >> $pkg_list
find doc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $docs_list
find doc/ ! -type d -printf '%{goroot}/%p\n' >> $docs_list
@ -363,14 +469,21 @@ pushd $RPM_BUILD_ROOT%{goroot}
echo "%%{golibdir}/$(basename $file)" >> $shared_list
done
find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list
find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list
find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list
find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list
%endif
%if %{race}
find pkg/*_race/ -type d -printf '%%%dir %{goroot}/%p\n' >> $race_list
find pkg/*_race/ ! -type d -printf '%{goroot}/%p\n' >> $race_list
%endif
find test/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
find test/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
find src/ -type d -a \( -name testdata -o -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $tests_list
find src/ ! -type d -a \( -ipath '*/testdata/*' -o -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $tests_list
find src/ ! -type d -a \( -ipath '*/testdata/*' -o -name '*_test.go' \) -printf '%{goroot}/%p\n' >> $tests_list
# this is only the zoneinfo.zip
find lib/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list
find lib/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list
@ -415,6 +528,12 @@ export GO_LDFLAGS="-linkmode internal"
%if !%{cgo_enabled} || !%{external_linker}
export CGO_ENABLED=0
%endif
# workaround for https://github.com/golang/go/issues/39466 until it gests fixed
# Commented until the patch is ready, this work around suggested in the link avobe
# doesn't work properly
#ifarch aarch64
#export CGO_CFLAGS="-mno-outline-atomics"
#endif
# make sure to not timeout
export GO_TEST_TIMEOUT_SCALE=2
@ -439,20 +558,18 @@ fi
%files
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS
%license LICENSE PATENTS
%doc AUTHORS CONTRIBUTORS
# VERSION has to be present in the GOROOT, for `go install std` to work
%doc %{goroot}/VERSION
%dir %{goroot}/doc
%doc %{goroot}/doc/*
# go files
%dir %{goroot}
%exclude %{goroot}/bin/
%exclude %{goroot}/pkg/
%exclude %{goroot}/src/
%exclude %{goroot}/doc/
%exclude %{goroot}/misc/
%{goroot}/*
%{goroot}/api/
%{goroot}/lib/time/
%{goroot}/favicon.ico
%{goroot}/robots.txt
# ensure directory ownership, so they are cleaned up if empty
%dir %{gopath}
@ -468,23 +585,335 @@ fi
# gdbinit (for gdb debugging)
%{_sysconfdir}/gdbinit.d
%files -f go-src.list src
%files src -f go-src.list
%files -f go-docs.list docs
%files docs -f go-docs.list
%files -f go-misc.list misc
%files misc -f go-misc.list
%files -f go-tests.list tests
%files tests -f go-tests.list
%files -f go-pkg.list bin
%files bin -f go-pkg.list
%{_bindir}/go
%{_bindir}/gofmt
%{goroot}/bin/linux_%{gohostarch}/go
%{goroot}/bin/linux_%{gohostarch}/gofmt
%if %{shared}
%files -f go-shared.list shared
%files shared -f go-shared.list
%endif
%if %{race}
%files race -f go-race.list
%endif
%changelog
* Fri Nov 13 2020 Jakub Čajka <jcajka@redhat.com> - 1.15.5-1
- Rebase to go1.15.5
- Security fix for CVE-2020-28362, CVE-2020-28367 and CVE-2020-28366
- Resolves: BZ#1897342, BZ#1897636, BZ#1897644, BZ#1897647
* Fri Nov 06 2020 Jakub Čajka <jcajka@redhat.com> - 1.15.4-1
- Rebase to go1.15.4
- Resolves: BZ#1895189
* Thu Oct 15 2020 Jakub Čajka <jcajka@redhat.com> - 1.15.3-1
- Rebase to go1.15.3
- Resolves: BZ#1888443
* Thu Sep 10 2020 Jakub Čajka <jcajka@redhat.com> - 1.15.2-1
- Rebase to go1.15.2
- Resolves: BZ#1877565
* Thu Sep 03 2020 Jakub Čajka <jcajka@redhat.com> - 1.15.1-1
- Rebase to go1.15.1
- Security fix for CVE-2020-24553
- Resolves: BZ#1874858, BZ#1866892
* Wed Aug 12 2020 Jakub Čajka <jcajka@redhat.com> - 1.15-1
- Rebase to go1.15 proper
- Resolves: BZ#1859241, BZ#1866892
* Mon Aug 10 2020 Jakub Čajka <jcajka@redhat.com> - 1.15-0.rc2.0
- Rebase to go1.15rc1
- Security fix for CVE-2020-16845
- Resolves: BZ#1867101
- Related: BZ#1859241
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.15-0.rc1.0.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 27 2020 Jakub Čajka <jcajka@redhat.com> - 1.15-0.rc1.0
- Rebase to go1.15rc1
- Related: BZ#1859241
* 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
- Rebase to go1.14.6
- Security fix for CVE-2020-14040 and CVE-2020-15586
- Resolves: BZ#1842708, BZ#1856957, BZ#1853653
* Tue Jun 30 2020 Alejandro Sáez <asm@redhat.com> - 1.14.4-1
- Rebase to go1.14.4
- Add patch that fixes: https://golang.org/issue/39991
- Related: BZ#1842708
* Mon May 18 2020 Álex Sáez <asm@redhat.com> - 1.14.3-1
- Rebase to go1.14.3
- Resolves: BZ#1836015
* Mon Apr 20 2020 Jakub Čajka <jcajka@redhat.com> - 1.14.2-1
- Rebase to go1.14.2
- Resolves: BZ#1815282
* Wed Feb 26 2020 Jakub Čajka <jcajka@redhat.com> - 1.14-1
- Rebase to go1.14 proper
- Resolves: BZ#1792475
* Thu Feb 06 2020 Jakub Čajka <jcajka@redhat.com> - 1.14-0.rc1.0
- Rebase to go1.14.rc1
- Related: BZ#1792475
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.14-0.beta1.0.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 20 2020 Jakub Čajka <jcajka@redhat.com> - 1.14-0.beta1.0
- Rebase to go1.14beta1
- Resolves: BZ#1792475
* Mon Jan 13 2020 Jakub Čajka <jcajka@redhat.com> - 1.13.6-1
- Rebase to go1.13.6
* Thu Dec 05 2019 Jakub Čajka <jcajka@redhat.com> - 1.13.5-1
- Rebase to go1.13.5
* Tue Nov 26 2019 Neal Gompa <ngompa@datto.com> - 1.13.4-2
- Small fixes to the spec and tighten up the file list
* Fri Nov 01 2019 Jakub Čajka <jcajka@redhat.com> - 1.13.4-1
- Rebase to go1.13.4
- Resolves BZ#1767673
* Sat Oct 19 2019 Jakub Čajka <jcajka@redhat.com> - 1.13.3-1
- Rebase to go1.13.3
- Fix for CVE-2019-17596
- Resolves: BZ#1755639, BZ#1763312
* Fri Sep 27 2019 Jakub Čajka <jcajka@redhat.com> - 1.13.1-1
- Rebase to go1.13.1
- Fix for CVE-2019-16276
- Resolves: BZ#1755970
* Thu Sep 05 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-2
- Back to go1.13 tls1.3 behavior
* Wed Sep 04 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-1
- Rebase to go1.13
* Fri Aug 30 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-0.rc2.1
- Rebase to go1.13rc2
- Do not enable tls1.3 by default
- Related: BZ#1737471
* Wed Aug 28 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-0.rc1.2
- Actually fix CVE-2019-9514 and CVE-2019-9512
- Related: BZ#1741816, BZ#1741827
* Mon Aug 26 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-0.rc1.1
- Rebase to 1.13rc1
- Fix for CVE-2019-14809, CVE-2019-9514 and CVE-2019-9512
- Resolves: BZ#1741816, BZ#1741827 and BZ#1743131
* Thu Aug 01 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-0.beta1.2.2
- Fix ICE affecting aarch64
- Resolves: BZ#1735290
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-0.beta1.2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Jul 24 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-0.beta1.2
- De-configure sumdb and go proxy
* Wed Jul 24 2019 Jakub Čajka <jcajka@redhat.com> - 1.13-0.beta1.1
- Rebase to 1.13beta1
- Related: BZ#1732118
* Tue Jul 09 2019 Jakub Čajka <jcajka@redhat.com> - 1.12.7-1
- Rebase to 1.12.7
- Resolves: BZ#1728056
* Wed Jun 12 2019 Jakub Čajka <jcajka@redhat.com> - 1.12.6-1
- Rebase to 1.12.6
- Resolves: BZ#1719483
* Tue May 07 2019 Jakub Čajka <jcajka@redhat.com> - 1.12.5-1
- Rebase to 1.12.5
- Resolves: BZ#1707187
* Mon Apr 08 2019 Jakub Čajka <jcajka@redhat.com> - 1.12.2-1
- Rebase to 1.12.2
- Resolves: BZ#1688996
* Mon Apr 01 2019 Jakub Čajka <jcajka@redhat.com> - 1.12.1-2
- Fix up change log, respective CVE has been fixed in go1.12rc1
* Fri Mar 15 2019 Jakub Čajka <jcajka@redhat.com> - 1.12.1-1
- Rebase to 1.12.1
- Fix requirement for %%preun (instead of %%postun) scriptlet thanks to Tim Landscheidt
- Use weak deps for SCM deps
* Wed Feb 27 2019 Jakub Čajka <jcajka@redhat.com> - 1.12-1
- Rebase to go1.12 proper
- Resolves: BZ#1680040
* Mon Feb 18 2019 Jakub Čajka <jcajka@redhat.com> - 1.12-0.rc1.1
- Rebase to go1.12rc1
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-0.beta2.2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sun Jan 27 2019 Jakub Čajka <jcajka@redhat.com> - 1.12-0.beta2.2
- Fix for CVE-2019-6486
- Resolves: BZ#1668973
* Fri Jan 11 2019 Jakub Čajka <jcajka@redhat.com> - 1.12-0.beta2.1
- Rebase to go1.12beta2
* Wed Jan 02 2019 Jakub Čajka <jcajka@redhat.com> - 1.11.4-1
- Rebase to go1.11.4
- Fix for CVE-2018-16875, CVE-2018-16874 and CVE-2018-16873
- Resolves: BZ#1659290, BZ#1659289, BZ#1659288
* Mon Nov 05 2018 Jakub Čajka <jcajka@redhat.com> - 1.11.2-1
- Rebase to go1.11.2
* Thu Oct 04 2018 Jakub Čajka <jcajka@redhat.com> - 1.11.1-1
- Rebase to go1.11.1
* Mon Aug 27 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-1
- Rebase to go1.11 release
* Thu Aug 23 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-0.rc2.1
- Rebase to go1.11rc2
- Reduce size of bin package
* Tue Aug 14 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-0.rc1.1
- Rebase to go1.11rc1
* Mon Aug 06 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-0.beta3.1
- Rebase to go1.11beta3
* Fri Jul 27 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-0.beta2.2
- Turn on back DWARF compression by default
- Use less memory on 32bit targets during build
- Resolves: BZ#1607270
- Related: BZ#1602096
* Fri Jul 20 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-0.beta2.1
- Rebase to 1.11beta2
* Wed Jul 18 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-0.beta1.2
- Turn off DWARF compression by default as it is not supported by rpm/debuginfo
- Related: BZ#1602096
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-0.beta1.1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Jul 04 2018 Jakub Čajka <jcajka@redhat.com> - 1.11-0.beta1.1
* Rebase to 1.11beta1
* Fri Jun 08 2018 Jakub Čajka <jcajka@redhat.com> - 1.10.3-1
- Rebase to 1.10.3
* Wed May 02 2018 Jakub Čajka <jcajka@redhat.com> - 1.10.2-1
- Rebase to 1.10.2
* Wed Apr 04 2018 Jakub Čajka <jcajka@redhat.com> - 1.10.1-1
- Rebase to 1.10.1
- Resolves: BZ#1562270
* Sat Mar 03 2018 Jakub Čajka <jcajka@redhat.com> - 1.10-2
- Fix CVE-2018-7187
- Resolves: BZ#1546386, BZ#1546388
* Wed Feb 21 2018 Jakub Čajka <jcajka@redhat.com> - 1.10-1
- Rebase to 1.10
* Thu Feb 08 2018 Jakub Čajka <jcajka@redhat.com> - 1.10-0.rc2.1
- Rebase to 1.10rc2
- Fix CVE-2018-6574
- Resolves: BZ#1543561, BZ#1543562
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-0.rc1.1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Jan 26 2018 Jakub Čajka <jcajka@redhat.com> - 1.10-0.rc1.1
- Rebase to 1.10rc1
* Fri Jan 12 2018 Jakub Čajka <jcajka@redhat.com> - 1.10-0.beta2.1
- Rebase to 1.10beta2
* Mon Jan 08 2018 Jakub Čajka <jcajka@redhat.com> - 1.10-0.beta1.1
- Rebase to 1.10beta1
- Drop verbose patch as most of it is now implemented by bootstrap tool and is easily toggled by passing -v flag to make.bash
* Thu Oct 26 2017 Jakub Čajka <jcajka@redhat.com> - 1.9.2-1
- Rebase to 1.9.2
- execute correctly pie tests
- allow to ignore tests via bcond
- reduce size of golang package
* Fri Oct 06 2017 Jakub Čajka <jcajka@redhat.com> - 1.9.1-1
- fix CVE-2017-15041 and CVE-2017-15042
* Fri Sep 15 2017 Jakub Čajka <jcajka@redhat.com> - 1.9-1
- bump to the relased version
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-0.beta2.1.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-0.beta2.1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Jul 11 2017 Jakub Čajka <jcajka@redhat.com> - 1.9-0.beta2.1
- bump to beta2
* Thu May 25 2017 Jakub Čajka <jcajka@redhat.com> - 1.8.3-1
- bump to 1.8.3
- fix for CVE-2017-8932
- make possible to use 31bit OID in ASN1
- Resolves: BZ#1454978, BZ#1455191
* Fri Apr 21 2017 Jakub Čajka <jcajka@redhat.com> - 1.8.1-2
- fix uint64 constant codegen on s390x
- Resolves: BZ#1441078
* Tue Apr 11 2017 Jakub Čajka <jcajka@redhat.com> - 1.8.1-1
- bump to Go 1.8.1
- Resolves: BZ#1440345
* Fri Feb 24 2017 Jakub Čajka <jcajka@redhat.com> - 1.8-2
- avoid possibly stale packages due to chacha test file not being test file
* Fri Feb 17 2017 Jakub Čajka <jcajka@redhat.com> - 1.8-1
- bump to released version
- Resolves: BZ#1423637
- Related: BZ#1411242
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-0.rc3.2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Jan 27 2017 Jakub Čajka <jcajka@redhat.com> - 1.8-0.rc3.2
- make possible to override default traceback level at build time
- add sub-package race containing std lib built with -race enabled
- Related: BZ#1411242
* Fri Jan 27 2017 Jakub Čajka <jcajka@redhat.com> - 1.8-0.rc3.1
- rebase to go1.8rc3
- Resolves: BZ#1411242
* Fri Jan 20 2017 Jakub Čajka <jcajka@redhat.com> - 1.7.4-2
- Resolves: BZ#1404679
- expose IfInfomsg.X__ifi_pad on s390x

View File

@ -1,457 +0,0 @@
From d6beea7f9ea1aa2ae5abca7fccb252767820aa13 Mon Sep 17 00:00:00 2001
From: Lynn Boger <laboger@linux.vnet.ibm.com>
Date: Tue, 26 Jul 2016 08:51:10 -0500
Subject: [PATCH] cmd/link: split large elf text sections for ppc64x
Some applications built with Go on ppc64x with
external linking can fail to link with relocation
truncation errors, due to the way that the golang
compiler generates a single go.o file containing
a single large text section to send to the GNU
linker. If the size of the single text section is
greater than 2^26, this can lead to link errors
due to 24 bit offset field in the bl (call)
instruction.
This fix solves the problem by splitting into
multiple text sections when this limit is reached.
When this is done then the GNU linker can fix the
long calls and insert jump tables where needed.
---
src/cmd/link/internal/ld/data.go | 52 +++++++++++++++++++++++++++++--
src/cmd/link/internal/ld/elf.go | 60 ++++++++++++++++++++++++++++++++---
src/cmd/link/internal/ld/lib.go | 20 ++++++++++++
src/cmd/link/internal/ld/symtab.go | 64 ++++++++++++++++++++++++++++++++++++++
src/cmd/link/internal/ppc64/asm.go | 12 ++++---
src/runtime/symtab.go | 34 +++++++++++++++-----
src/runtime/type.go | 16 +++++++++-
7 files changed, 237 insertions(+), 21 deletions(-)
diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go
index 57a0dad..58ce18c 100644
--- a/src/cmd/link/internal/ld/data.go
+++ b/src/cmd/link/internal/ld/data.go
@@ -527,7 +527,15 @@ func relocsym(s *LSym) {
o = Symaddr(r.Sym) + r.Add - int64(r.Sym.Sect.Vaddr)
case obj.R_ADDROFF:
- o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add
+
+ // The method offset tables using this relocation expect the offset to be relative
+ // to the start of the first text section, even if there are multiple.
+
+ if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr {
+ o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add
+ } else {
+ o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add
+ }
// r->sym can be null when CALL $(constant) is transformed from absolute PC to relative PC call.
case obj.R_CALL, obj.R_GOTPCREL, obj.R_PCREL:
@@ -1926,6 +1934,7 @@ func textaddress() {
}
va := uint64(INITTEXT)
sect.Vaddr = va
+ n := 1
for _, sym := range Ctxt.Textp {
sym.Sect = sect
if sym.Type&obj.SSUB != 0 {
@@ -1948,9 +1957,30 @@ func textaddress() {
} else {
va += uint64(sym.Size)
}
+ // On ppc64x a text section should not be larger than 2^26 bytes due to the size of
+ // call target offset field in the bl instruction. Splitting into text
+ // sections smaller than this limit allows the GNU linker to modify the long calls
+ // appropriately. The limit allows for the space for linker tables.
+
+ // Only break at outermost syms.
+
+ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) {
+
+ // Set the length for the previous text section
+ sect.Length = va - sect.Vaddr
+
+ // Create new section, set the starting Vaddr
+ sect = addsection(&Segtext, ".text", 05)
+ sect.Vaddr = va
+
+ // Create a symbol for the start and end of the secondary text section
+ Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect
+ n++
+ }
}
sect.Length = va - sect.Vaddr
+ Linklookup(Ctxt, "runtime.etext", 0).Sect = sect
}
// assign addresses
@@ -2057,11 +2087,27 @@ func address() {
Segdwarf.Filelen = va - Segdwarf.Vaddr
text := Segtext.Sect
+ lasttext := text
var rodata *Section
if Segrodata.Sect != nil {
rodata = Segrodata.Sect
} else {
- rodata = text.Next
+ // Could be multiple .text sections
+ n := 1
+ for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next {
+ if sect.Name != ".text" {
+ break
+ }
+ lasttext = sect
+ symname := fmt.Sprintf("runtime.text.%d", n)
+ xdefine(symname, obj.STEXT, int64(sect.Vaddr))
+ n++
+ }
+
+ rodata = lasttext.Next
+ if rodata != nil && rodata.Name != ".rodata" {
+ Diag("Unexpected section order in text segment")
+ }
}
var relrodata *Section
typelink := rodata.Next
@@ -2108,7 +2154,7 @@ func address() {
}
xdefine("runtime.text", obj.STEXT, int64(text.Vaddr))
- xdefine("runtime.etext", obj.STEXT, int64(text.Vaddr+text.Length))
+ xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length))
if HEADTYPE == obj.Hwindows {
xdefine(".text", obj.STEXT, int64(text.Vaddr))
}
diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go
index 39d3609..ecb00c2 100644
--- a/src/cmd/link/internal/ld/elf.go
+++ b/src/cmd/link/internal/ld/elf.go
@@ -1623,6 +1623,25 @@ func elfshname(name string) *ElfShdr {
return nil
}
+// Create an ElfShdr for the section with name.
+// A new one is created even if one already exists with
+// the same name.
+func elfshnamedup(name string) *ElfShdr {
+ var off int
+ var sh *ElfShdr
+
+ for i := 0; i < nelfstr; i++ {
+ if name == elfstr[i].s {
+ off = elfstr[i].off
+ sh = newElfShdr(int64(off))
+ return sh
+ }
+ }
+ Diag("cannot find elf name %s", name)
+ errorexit()
+ return nil
+}
+
func elfshalloc(sect *Section) *ElfShdr {
sh := elfshname(sect.Name)
sect.Elfsect = sh
@@ -1630,7 +1649,17 @@ func elfshalloc(sect *Section) *ElfShdr {
}
func elfshbits(sect *Section) *ElfShdr {
- sh := elfshalloc(sect)
+ var sh *ElfShdr
+
+ if sect.Name == ".text" {
+ if sect.Elfsect == nil {
+ sect.Elfsect = elfshnamedup(sect.Name)
+ }
+ sh = sect.Elfsect
+ } else {
+ sh = elfshalloc(sect)
+ }
+
// If this section has already been set up as a note, we assume type_ and
// flags are already correct, but the other fields still need filling in.
if sh.type_ == SHT_NOTE {
@@ -1706,6 +1735,15 @@ func elfshreloc(sect *Section) *ElfShdr {
}
sh := elfshname(elfRelType + sect.Name)
+
+ // There could be multiple text sections but each needs
+ // its own .rela.text.
+ if sect.Name == ".text" {
+ if sh.info != 0 && sh.info != uint32(sect.Elfsect.shnum) {
+ sh = elfshnamedup(elfRelType + sect.Name)
+ }
+ }
+
sh.type_ = uint32(typ)
sh.entsize = uint64(SysArch.RegSize) * 2
if typ == SHT_RELA {
@@ -1776,9 +1814,12 @@ func Elfemitreloc() {
Cput(0)
}
- elfrelocsect(Segtext.Sect, Ctxt.Textp)
- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next {
- elfrelocsect(sect, datap)
+ for sect := Segtext.Sect; sect != nil; sect = sect.Next {
+ if sect.Name == ".text" {
+ elfrelocsect(sect, Ctxt.Textp)
+ } else {
+ elfrelocsect(sect, datap)
+ }
}
for sect := Segrodata.Sect; sect != nil; sect = sect.Next {
elfrelocsect(sect, datap)
@@ -2109,7 +2150,16 @@ func Asmbelfsetup() {
elfshname("")
for sect := Segtext.Sect; sect != nil; sect = sect.Next {
- elfshalloc(sect)
+
+ // There could be multiple .text sections. Instead check the Elfsect
+ // field to determine if already has an ElfShdr and if not, create one.
+ if sect.Name == ".text" {
+ if sect.Elfsect == nil {
+ sect.Elfsect = elfshnamedup(sect.Name)
+ }
+ } else {
+ elfshalloc(sect)
+ }
}
for sect := Segrodata.Sect; sect != nil; sect = sect.Next {
elfshalloc(sect)
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 14f4fa9..709e7ca 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1956,6 +1956,26 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
if s.Type == obj.STEXT {
put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil)
}
+ n := 0
+
+ // Generate base addresses for all text sections if there are multiple
+ for sect := Segtext.Sect; sect != nil; sect = sect.Next {
+ if n == 0 {
+ n++
+ continue
+ }
+ if sect.Name != ".text" {
+ break
+ }
+ s = Linkrlookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0)
+ if s == nil {
+ break
+ }
+ if s.Type == obj.STEXT {
+ put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil)
+ }
+ n++
+ }
s = Linklookup(Ctxt, "runtime.etext", 0)
if s.Type == obj.STEXT {
put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil)
diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go
index 06d7792..80eb33d 100644
--- a/src/cmd/link/internal/ld/symtab.go
+++ b/src/cmd/link/internal/ld/symtab.go
@@ -315,6 +315,62 @@ func (libs byPkg) Swap(a, b int) {
libs[a], libs[b] = libs[b], libs[a]
}
+// Create a table with information on the text sections.
+
+func textsectionmap() uint32 {
+
+ t := Linklookup(Ctxt, "runtime.textsectionmap", 0)
+ t.Type = obj.SRODATA
+ t.Attr |= AttrReachable
+ nsections := int64(0)
+
+ for sect := Segtext.Sect; sect != nil; sect = sect.Next {
+ if sect.Name == ".text" {
+ nsections++
+ } else {
+ break
+ }
+ }
+ Symgrow(Ctxt, t, nsections*3*8)
+
+ off := int64(0)
+ n := 0
+
+ // The vaddr for each text section is the difference between the section's
+ // Vaddr and the Vaddr for the first text section as determined at compile
+ // time.
+
+ // The symbol name for the start address of the first text section is
+ // runtime.text. Additional text sections are named runtime.text.n where n is the
+ // order of creation starting with 1. These symbols provide the section's
+ // start address after relocation by the linker.
+
+ textbase := Segtext.Sect.Vaddr
+ for sect := Segtext.Sect; sect != nil; sect = sect.Next {
+ if sect.Name != ".text" {
+ break
+ }
+ off = setuintxx(Ctxt, t, off, sect.Vaddr-textbase, int64(SysArch.IntSize))
+ off = setuintxx(Ctxt, t, off, sect.Length, int64(SysArch.IntSize))
+ if n == 0 {
+ s := Linkrlookup(Ctxt, "runtime.text", 0)
+ if s == nil {
+ Diag("Unable to find symbol runtime.text\n")
+ }
+ off = setaddr(Ctxt, t, off, s)
+
+ } else {
+ s := Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0)
+ if s == nil {
+ Diag("Unable to find symbol runtime.text.%d\n", n)
+ }
+ off = setaddr(Ctxt, t, off, s)
+ }
+ n++
+ }
+ return uint32(n)
+}
+
func symtab() {
dosymtype()
@@ -489,6 +545,8 @@ func symtab() {
adduint(Ctxt, abihashgostr, uint64(hashsym.Size))
}
+ nsections := textsectionmap()
+
// Information about the layout of the executable image for the
// runtime to use. Any changes here must be matched by changes to
// the definition of moduledata in runtime/symtab.go.
@@ -527,6 +585,12 @@ func symtab() {
Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.gcbss", 0))
Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.types", 0))
Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.etypes", 0))
+
+ // text section information
+ Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.textsectionmap", 0))
+ adduint(Ctxt, moduledata, uint64(nsections))
+ adduint(Ctxt, moduledata, uint64(nsections))
+
// The typelinks slice
Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.typelink", 0))
adduint(Ctxt, moduledata, uint64(ntypelinks))
diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go
index bd2e23f..ab59fa8 100644
--- a/src/cmd/link/internal/ppc64/asm.go
+++ b/src/cmd/link/internal/ppc64/asm.go
@@ -813,12 +813,14 @@ func asmb() {
ld.Asmbelfsetup()
}
- sect := ld.Segtext.Sect
- ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff))
- ld.Codeblk(int64(sect.Vaddr), int64(sect.Length))
- for sect = sect.Next; sect != nil; sect = sect.Next {
+ for sect := ld.Segtext.Sect; sect != nil; sect = sect.Next {
ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff))
- ld.Datblk(int64(sect.Vaddr), int64(sect.Length))
+ // Might have multiple text sections
+ if sect.Name == ".text" {
+ ld.Codeblk(int64(sect.Vaddr), int64(sect.Length))
+ } else {
+ ld.Datblk(int64(sect.Vaddr), int64(sect.Length))
+ }
}
if ld.Segrodata.Filelen > 0 {
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index 4f6fae2..23e80ce 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -195,8 +195,9 @@ type moduledata struct {
end, gcdata, gcbss uintptr
types, etypes uintptr
- typelinks []int32 // offsets from types
- itablinks []*itab
+ textsectmap []textsect
+ typelinks []int32 // offsets from types
+ itablinks []*itab
modulename string
modulehashes []modulehash
@@ -226,6 +227,14 @@ type functab struct {
funcoff uintptr
}
+// Mapping information for secondary text sections
+
+type textsect struct {
+ vaddr uint64 // prelinked section vaddr
+ length uint64 // section length
+ baseaddr uintptr // relocated section address
+}
+
const minfunc = 16 // minimum function size
const pcbucketsize = 256 * minfunc // size of bucket in the pc->func lookup table
@@ -368,12 +377,23 @@ func findfunc(pc uintptr) *_func {
ffb := (*findfuncbucket)(add(unsafe.Pointer(datap.findfunctab), b*unsafe.Sizeof(findfuncbucket{})))
idx := ffb.idx + uint32(ffb.subbuckets[i])
if pc < datap.ftab[idx].entry {
- throw("findfunc: bad findfunctab entry")
- }
- // linear search to find func with pc >= entry.
- for datap.ftab[idx+1].entry <= pc {
- idx++
+ // If there are multiple text sections then the buckets for the secondary
+ // text sections will be off because the addresses in those text sections
+ // were relocated to higher addresses. Search back to find it.
+
+ for datap.ftab[idx].entry > pc && idx > 0 {
+ idx--
+ }
+ if idx == 0 {
+ throw("findfunc: bad findfunctab entry idx")
+ }
+ } else {
+
+ // linear search to find func with pc >= entry.
+ for datap.ftab[idx+1].entry <= pc {
+ idx++
+ }
}
return (*_func)(unsafe.Pointer(&datap.pclntable[datap.ftab[idx].funcoff]))
}
diff --git a/src/runtime/type.go b/src/runtime/type.go
index 5ef11a4..f641adc 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -257,7 +257,21 @@ func (t *_type) textOff(off textOff) unsafe.Pointer {
}
return res
}
- res := md.text + uintptr(off)
+ res := uintptr(0)
+
+ // Find the text section range that contains the offset to determine the section's base
+ // address. In cases where there are multiple text sections, the base address might be
+ // relocated by the linker.
+
+ for i := 0; i < len(md.textsectmap); i++ {
+ sectaddr := md.textsectmap[i].vaddr
+ sectlen := md.textsectmap[i].length
+ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen {
+ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr)
+ break
+ }
+ }
+
if res > md.etext {
println("runtime: textOff", hex(off), "out of range", hex(md.text), "-", hex(md.etext))
throw("runtime: text offset out of range")

View File

@ -1,150 +0,0 @@
From a5b97a846d70cd8db7f33c24f2b9159f935ce318 Mon Sep 17 00:00:00 2001
From: Lynn Boger <laboger@linux.vnet.ibm.com>
Date: Tue, 13 Sep 2016 15:13:08 -0500
Subject: [PATCH] cmd/compile: large text sections on ppc64le
Additional fixes as submitted upstream.
---
src/cmd/link/internal/ld/data.go | 24 ++++++++++++------------
src/cmd/link/internal/ld/lib.go | 2 +-
src/cmd/link/internal/ld/symtab.go | 2 +-
src/runtime/type.go | 28 ++++++++++++++++++----------
4 files changed, 32 insertions(+), 24 deletions(-)
diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go
index 58ce18c..d8e43ff 100644
--- a/src/cmd/link/internal/ld/data.go
+++ b/src/cmd/link/internal/ld/data.go
@@ -531,7 +531,7 @@ func relocsym(s *LSym) {
// The method offset tables using this relocation expect the offset to be relative
// to the start of the first text section, even if there are multiple.
- if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr {
+ if r.Sym.Sect.Name == ".text" {
o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add
} else {
o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add
@@ -1928,7 +1928,6 @@ func textaddress() {
sect.Align = int32(Funcalign)
Linklookup(Ctxt, "runtime.text", 0).Sect = sect
- Linklookup(Ctxt, "runtime.etext", 0).Sect = sect
if HEADTYPE == obj.Hwindows {
Linklookup(Ctxt, ".text", 0).Sect = sect
}
@@ -1964,7 +1963,7 @@ func textaddress() {
// Only break at outermost syms.
- if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) {
+ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > 0x1c00000 {
// Set the length for the previous text section
sect.Length = va - sect.Vaddr
@@ -1973,7 +1972,7 @@ func textaddress() {
sect = addsection(&Segtext, ".text", 05)
sect.Vaddr = va
- // Create a symbol for the start and end of the secondary text section
+ // Create a symbol for the start of the secondary text section
Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect
n++
}
@@ -2093,15 +2092,8 @@ func address() {
rodata = Segrodata.Sect
} else {
// Could be multiple .text sections
- n := 1
- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next {
- if sect.Name != ".text" {
- break
- }
+ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next {
lasttext = sect
- symname := fmt.Sprintf("runtime.text.%d", n)
- xdefine(symname, obj.STEXT, int64(sect.Vaddr))
- n++
}
rodata = lasttext.Next
@@ -2155,6 +2147,14 @@ func address() {
xdefine("runtime.text", obj.STEXT, int64(text.Vaddr))
xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length))
+
+ n := 1
+ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next {
+ symname := fmt.Sprintf("runtime.text.%d", n)
+ xdefine(symname, obj.STEXT, int64(sect.Vaddr))
+ n++
+ }
+
if HEADTYPE == obj.Hwindows {
xdefine(".text", obj.STEXT, int64(text.Vaddr))
}
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 709e7ca..c37ef92 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1958,7 +1958,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
}
n := 0
- // Generate base addresses for all text sections if there are multiple
+ // Generate base addresses for all text sections if there are multiple.
for sect := Segtext.Sect; sect != nil; sect = sect.Next {
if n == 0 {
n++
diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go
index 80eb33d..ec26f88 100644
--- a/src/cmd/link/internal/ld/symtab.go
+++ b/src/cmd/link/internal/ld/symtab.go
@@ -331,7 +331,7 @@ func textsectionmap() uint32 {
break
}
}
- Symgrow(Ctxt, t, nsections*3*8)
+ Symgrow(Ctxt, t, nsections*(2*int64(SysArch.IntSize)+int64(SysArch.PtrSize)))
off := int64(0)
n := 0
diff --git a/src/runtime/type.go b/src/runtime/type.go
index f641adc..d4df5a9 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -259,17 +259,25 @@ func (t *_type) textOff(off textOff) unsafe.Pointer {
}
res := uintptr(0)
- // Find the text section range that contains the offset to determine the section's base
- // address. In cases where there are multiple text sections, the base address might be
- // relocated by the linker.
-
- for i := 0; i < len(md.textsectmap); i++ {
- sectaddr := md.textsectmap[i].vaddr
- sectlen := md.textsectmap[i].length
- if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen {
- res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr)
- break
+ // The text, or instruction stream is generated as one large buffer. The off (offset) for a method is
+ // its offset within this buffer. If the total text size gets too large, there can be issues on platforms like ppc64 if
+ // the target of calls are too far for the call instruction. To resolve the large text issue, the text is split
+ // into multiple text sections to allow the linker to generate long calls when necessary. When this happens, the vaddr
+ // for each text section is set to its offset within the text. Each method's offset is compared against the section
+ // vaddrs and sizes to determine the containing section. Then the section relative offset is added to the section's
+ // relocated baseaddr to compute the method addess.
+
+ if len(md.textsectmap) > 1 {
+ for i := 0; i < len(md.textsectmap); i++ {
+ sectaddr := md.textsectmap[i].vaddr
+ sectlen := md.textsectmap[i].length
+ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen {
+ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr)
+ break
+ }
}
+ } else {
+ res = md.text + uintptr(off)
}
if res > md.etext {

View File

@ -1 +1 @@
49c1076428a5d3b5ad7ac65233fcca2f go1.7.4.src.tar.gz
SHA512 (go1.15.5.src.tar.gz) = 8e1d71f628d364b949b1e124af8950a563bbe9d9ae73b94c66af6ce029f67c26e2654556c0c118d0bc8566af52a7e9ed736b4667bbef7ccdab2bd338c43e6eb4

View File

@ -1,34 +0,0 @@
From c5434f2973a87acff76bac359236e690d632ce95 Mon Sep 17 00:00:00 2001
From: Alberto Donizetti <alb.donizetti@gmail.com>
Date: Thu, 29 Sep 2016 13:59:10 +0200
Subject: [PATCH] time: update test for tzdata-2016g
Fixes #17276
Change-Id: I0188cf9bc5fdb48c71ad929cc54206d03e0b96e4
Reviewed-on: https://go-review.googlesource.com/29995
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
---
src/time/time_test.go | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/time/time_test.go b/src/time/time_test.go
index 68236fd..2e47d08 100644
--- a/src/time/time_test.go
+++ b/src/time/time_test.go
@@ -943,8 +943,11 @@ func TestLoadFixed(t *testing.T) {
// but Go and most other systems use "east is positive".
// So GMT+1 corresponds to -3600 in the Go zone, not +3600.
name, offset := Now().In(loc).Zone()
- if name != "GMT+1" || offset != -1*60*60 {
- t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60)
+ // The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1"
+ // on earlier versions; we accept both. (Issue #17276).
+ if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 {
+ t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d",
+ name, offset, "GMT+1", "-01", -1*60*60)
}
}