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
This commit is contained in:
parent
4bc73c764a
commit
d37b3b5006
1
.gitignore
vendored
1
.gitignore
vendored
@ -45,3 +45,4 @@
|
|||||||
/go1.9.src.tar.gz
|
/go1.9.src.tar.gz
|
||||||
/go1.9.1.src.tar.gz
|
/go1.9.1.src.tar.gz
|
||||||
/go1.9.2.src.tar.gz
|
/go1.9.2.src.tar.gz
|
||||||
|
/go1.10beta1.src.tar.gz
|
||||||
|
@ -1,21 +1,70 @@
|
|||||||
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
|
diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go
|
||||||
index ed9502d..c2569e7 100644
|
--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time 2017-12-05 01:10:10.000000000 +0100
|
||||||
--- a/src/time/zoneinfo_unix.go
|
+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go 2017-12-05 14:55:10.574637475 +0100
|
||||||
+++ b/src/time/zoneinfo_unix.go
|
@@ -4,13 +4,15 @@
|
||||||
@@ -32,14 +32,14 @@ var zoneDirs = []string{
|
|
||||||
|
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 -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go
|
||||||
|
--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time 2017-12-05 01:10:10.000000000 +0100
|
||||||
|
+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go 2017-12-05 14:58:09.823109248 +0100
|
||||||
|
@@ -8,6 +8,7 @@ import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"reflect"
|
||||||
|
+ "runtime"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testi
|
||||||
|
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 -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go
|
||||||
|
--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time 2017-12-05 01:10:10.000000000 +0100
|
||||||
|
+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go 2017-12-05 14:55:10.574637475 +0100
|
||||||
|
@@ -12,7 +12,6 @@
|
||||||
|
package time
|
||||||
|
|
||||||
|
import (
|
||||||
|
- "runtime"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
@@ -22,7 +21,6 @@ var zoneSources = []string{
|
||||||
"/usr/share/zoneinfo/",
|
"/usr/share/zoneinfo/",
|
||||||
"/usr/share/lib/zoneinfo/",
|
"/usr/share/lib/zoneinfo/",
|
||||||
"/usr/lib/locale/TZ/",
|
"/usr/lib/locale/TZ/",
|
||||||
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
|
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
|
||||||
}
|
}
|
||||||
|
|
||||||
var origZoneDirs = zoneDirs
|
func initLocal() {
|
||||||
|
|
||||||
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"
|
|
||||||
|
155
golang-1.10-pkgconfig-fix.patch
Normal file
155
golang-1.10-pkgconfig-fix.patch
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
From b17b0c7d9b1d7bffd90a83fb887c66b421193eb8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
|
||||||
|
Date: Fri, 5 Jan 2018 13:38:55 +0100
|
||||||
|
Subject: [PATCH] cmd/go/internal/work : improve pkgconfig support to work with
|
||||||
|
latest(1.4+) pkgconf
|
||||||
|
|
||||||
|
Fixes #23373
|
||||||
|
|
||||||
|
Fix interfacing with latest(1.4+) pkgconf versions, as they have change the output format, by extending parsing function splitPkgConfigOutput to accommodate more possible fragment escaping formats. Function is based on pkgconfigs own implementation at https://github.com/pkgconf/pkgconf/blob/master/libpkgconf/argvsplit.c. Along with this change test case TestSplitPkgConfigOutput have been expanded. Thanks to ignatenko for help on test cases and insights in to the pkgconfig.
|
||||||
|
|
||||||
|
Change-Id: I55301bb564b07128d5564ec1454dd247f84a95c3
|
||||||
|
---
|
||||||
|
src/cmd/go/internal/work/build_test.go | 15 ++++++-
|
||||||
|
src/cmd/go/internal/work/exec.go | 79 +++++++++++++++++++++++++---------
|
||||||
|
2 files changed, 72 insertions(+), 22 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/cmd/go/internal/work/build_test.go b/src/cmd/go/internal/work/build_test.go
|
||||||
|
index 3f5ba37c64..be9857ade7 100644
|
||||||
|
--- a/src/cmd/go/internal/work/build_test.go
|
||||||
|
+++ b/src/cmd/go/internal/work/build_test.go
|
||||||
|
@@ -43,10 +43,23 @@ func TestSplitPkgConfigOutput(t *testing.T) {
|
||||||
|
{[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}},
|
||||||
|
{[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}},
|
||||||
|
{[]byte(`broken flag\`), []string{"broken", "flag"}},
|
||||||
|
+ {[]byte(`extra broken flag \`), []string{"extra", "broken", "flag"}},
|
||||||
|
{[]byte("\textra whitespace\r\n"), []string{"extra", "whitespace"}},
|
||||||
|
{[]byte(" \r\n "), nil},
|
||||||
|
+ {[]byte(`"-r:foo" "-L/usr/white space/lib" "-lfoo bar" "-lbar baz"`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}},
|
||||||
|
+ {[]byte(`"-lextra fun arg\\"`), []string{`-lextra fun arg\`}},
|
||||||
|
+ {[]byte(`" \r\n "`), []string{` \r\n `}},
|
||||||
|
+ {[]byte(`""`), nil},
|
||||||
|
+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='"/test/share/doc"'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=\"/test/share/doc\""}},
|
||||||
|
+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED="/test/share/doc"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}},
|
||||||
|
+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED=\"/test/share/doc\"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=\"/test/share/doc\""}},
|
||||||
|
+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='/test/share/doc'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}},
|
||||||
|
+ {[]byte(`-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\ world`), []string{"-Dhello=10", "-Dworld=+32", "-DDEFINED_FROM_PKG_CONFIG=hello world"}},
|
||||||
|
} {
|
||||||
|
- got := splitPkgConfigOutput(test.in)
|
||||||
|
+ got, err := splitPkgConfigOutput(test.in)
|
||||||
|
+ if err != nil {
|
||||||
|
+ t.Errorf("splitPkgConfigOutput(%v) = %v; function returned error %v", test.in, got, err)
|
||||||
|
+ }
|
||||||
|
if !reflect.DeepEqual(got, test.want) {
|
||||||
|
t.Errorf("splitPkgConfigOutput(%v) = %v; want %v", test.in, got, test.want)
|
||||||
|
}
|
||||||
|
diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
|
||||||
|
index 60e2a3aa48..c5a438aac9 100644
|
||||||
|
--- a/src/cmd/go/internal/work/exec.go
|
||||||
|
+++ b/src/cmd/go/internal/work/exec.go
|
||||||
|
@@ -855,36 +855,67 @@ func (b *Builder) PkgconfigCmd() string {
|
||||||
|
}
|
||||||
|
|
||||||
|
// splitPkgConfigOutput parses the pkg-config output into a slice of
|
||||||
|
-// flags. pkg-config always uses \ to escape special characters.
|
||||||
|
-func splitPkgConfigOutput(out []byte) []string {
|
||||||
|
+// flags. Implementing algorithm from pkgconf/libpkgconf/argvsplit.c
|
||||||
|
+func splitPkgConfigOutput(out []byte) ([]string, error) {
|
||||||
|
if len(out) == 0 {
|
||||||
|
- return nil
|
||||||
|
+ return nil, nil
|
||||||
|
}
|
||||||
|
var flags []string
|
||||||
|
- flag := make([]byte, len(out))
|
||||||
|
- r, w := 0, 0
|
||||||
|
+ flag := make([]byte, 0, len(out))
|
||||||
|
+ r := 0
|
||||||
|
+ escaped := false
|
||||||
|
+ var quote byte = 0
|
||||||
|
+
|
||||||
|
for r < len(out) {
|
||||||
|
- switch out[r] {
|
||||||
|
- case ' ', '\t', '\r', '\n':
|
||||||
|
- if w > 0 {
|
||||||
|
- flags = append(flags, string(flag[:w]))
|
||||||
|
+ if escaped {
|
||||||
|
+ if quote == '"' {
|
||||||
|
+ switch out[r] {
|
||||||
|
+ case '$', '`', '"', '\\':
|
||||||
|
+ default:
|
||||||
|
+ flag = append(flag, '\\')
|
||||||
|
+ }
|
||||||
|
+ flag = append(flag, out[r])
|
||||||
|
+ } else {
|
||||||
|
+ flag = append(flag, out[r])
|
||||||
|
}
|
||||||
|
- w = 0
|
||||||
|
- case '\\':
|
||||||
|
- r++
|
||||||
|
- fallthrough
|
||||||
|
- default:
|
||||||
|
- if r < len(out) {
|
||||||
|
- flag[w] = out[r]
|
||||||
|
- w++
|
||||||
|
+ escaped = false
|
||||||
|
+ } else if quote != 0 {
|
||||||
|
+ if out[r] == quote {
|
||||||
|
+ quote = 0
|
||||||
|
+ } else {
|
||||||
|
+ switch out[r] {
|
||||||
|
+ case '\\':
|
||||||
|
+ if quote == '\'' {
|
||||||
|
+ break
|
||||||
|
+ }
|
||||||
|
+ escaped = true
|
||||||
|
+ default:
|
||||||
|
+ flag = append(flag, out[r])
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ } else if !(strings.IndexByte(" \t\n\v\f\r", out[r]) >= 0) {
|
||||||
|
+ switch out[r] {
|
||||||
|
+ case '\\':
|
||||||
|
+ escaped = true
|
||||||
|
+ case '\'', '"':
|
||||||
|
+ quote = out[r]
|
||||||
|
+ default:
|
||||||
|
+ flag = append(flag, out[r])
|
||||||
|
}
|
||||||
|
+ } else if len(flag) != 0 {
|
||||||
|
+ flags = append(flags, string(flag))
|
||||||
|
+ flag = flag[:0]
|
||||||
|
}
|
||||||
|
r++
|
||||||
|
}
|
||||||
|
- if w > 0 {
|
||||||
|
- flags = append(flags, string(flag[:w]))
|
||||||
|
+
|
||||||
|
+ if quote != 0 {
|
||||||
|
+ return flags, errors.New("unterminated quoted string in pkgconf output " + string(out))
|
||||||
|
+ } else if len(flag) != 0 {
|
||||||
|
+ flags = append(flags, string(flag))
|
||||||
|
}
|
||||||
|
- return flags
|
||||||
|
+
|
||||||
|
+ return flags, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calls pkg-config if needed and returns the cflags/ldflags needed to build the package.
|
||||||
|
@@ -899,7 +930,13 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string,
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(out) > 0 {
|
||||||
|
- cflags = splitPkgConfigOutput(out)
|
||||||
|
+ cflags, err = splitPkgConfigOutput(out)
|
||||||
|
+ if err != nil {
|
||||||
|
+ b.showOutput(nil, p.Dir, b.PkgconfigCmd()+" --libs "+strings.Join(pkgs, " "), string(out))
|
||||||
|
+ b.Print(err.Error() + "\n")
|
||||||
|
+ err = errPrintedOutput
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
out, err = b.runOut(p.Dir, p.ImportPath, nil, b.PkgconfigCmd(), "--libs", pkgs)
|
||||||
|
if err != nil {
|
||||||
|
--
|
||||||
|
2.14.3
|
||||||
|
|
@ -1,21 +0,0 @@
|
|||||||
diff -up go/src/make.bash.verbose go/src/make.bash
|
|
||||||
--- go/src/make.bash.verbose 2017-07-11 12:00:09.513553508 +0200
|
|
||||||
+++ go/src/make.bash 2017-07-11 12:01:25.288245720 +0200
|
|
||||||
@@ -167,7 +167,7 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
|
|
||||||
# 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
|
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ echo "##### Building packages and comman
|
|
||||||
|
|
||||||
old_bin_files=$(cd $GOROOT/bin && echo *)
|
|
||||||
|
|
||||||
-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
|
|
||||||
|
|
||||||
# Check that there are no new files in $GOROOT/bin other than go and gofmt
|
|
||||||
# and $GOOS_$GOARCH (a directory used when cross-compiling).
|
|
100
golang.spec
100
golang.spec
@ -101,12 +101,12 @@
|
|||||||
%global gohostarch s390x
|
%global gohostarch s390x
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%global go_api 1.9
|
%global go_api 1.10
|
||||||
%global go_version 1.9.2
|
%global go_version 1.10beta1
|
||||||
|
|
||||||
Name: golang
|
Name: golang
|
||||||
Version: 1.9.2
|
Version: 1.10
|
||||||
Release: 1%{?dist}
|
Release: 0.beta1.1%{?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
|
||||||
@ -131,37 +131,50 @@ BuildRequires: pcre-devel, glibc-static, perl-interpreter, procps-ng
|
|||||||
|
|
||||||
Provides: go = %{version}-%{release}
|
Provides: go = %{version}-%{release}
|
||||||
|
|
||||||
# Bundled/Vendored provides
|
# Bundled/Vendored provides generated by
|
||||||
Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305))
|
# 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/curve25519))
|
Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305))
|
||||||
Provides: bundled(golang(golang.org/x/crypto/poly1305))
|
Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305/internal/chacha20))
|
||||||
Provides: bundled(golang(golang.org/x/net/http2))
|
Provides: bundled(golang(golang.org/x/crypto/cryptobyte))
|
||||||
Provides: bundled(golang(golang.org/x/net/http2/hpack))
|
Provides: bundled(golang(golang.org/x/crypto/cryptobyte/asn1))
|
||||||
Provides: bundled(golang(golang.org/x/net/idna))
|
Provides: bundled(golang(golang.org/x/crypto/curve25519))
|
||||||
Provides: bundled(golang(golang.org/x/net/lex))
|
Provides: bundled(golang(golang.org/x/crypto/poly1305))
|
||||||
Provides: bundled(golang(golang.org/x/net/lex/httplex))
|
Provides: bundled(golang(golang.org/x/net/http2/hpack))
|
||||||
Provides: bundled(golang(golang.org/x/net/lif))
|
Provides: bundled(golang(golang.org/x/net/idna))
|
||||||
Provides: bundled(golang(golang.org/x/net/route))
|
Provides: bundled(golang(golang.org/x/net/internal/nettest))
|
||||||
Provides: bundled(golang(golang.org/x/text/transform))
|
Provides: bundled(golang(golang.org/x/net/lex/httplex))
|
||||||
Provides: bundled(golang(golang.org/x/text/unicode))
|
Provides: bundled(golang(golang.org/x/net/nettest))
|
||||||
Provides: bundled(golang(golang.org/x/text/unicode/norm))
|
Provides: bundled(golang(golang.org/x/net/proxy))
|
||||||
Provides: bundled(golang(golang.org/x/text/width))
|
Provides: bundled(golang(golang.org/x/text/secure))
|
||||||
Provides: bundled(golang(golang.org/x/arch/arm))
|
Provides: bundled(golang(golang.org/x/text/secure/bidirule))
|
||||||
Provides: bundled(golang(golang.org/x/arch/arm/armasm))
|
Provides: bundled(golang(golang.org/x/text/transform))
|
||||||
Provides: bundled(golang(golang.org/x/arch/ppc64))
|
Provides: bundled(golang(golang.org/x/text/unicode))
|
||||||
Provides: bundled(golang(golang.org/x/arch/ppc64/ppc64asm))
|
Provides: bundled(golang(golang.org/x/text/unicode/bidi))
|
||||||
Provides: bundled(golang(golang.org/x/arch/x86))
|
Provides: bundled(golang(golang.org/x/text/unicode/norm))
|
||||||
Provides: bundled(golang(golang.org/x/arch/x86/x86asm))
|
Provides: bundled(golang(github.com/google/pprof))
|
||||||
|
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/proftest))
|
||||||
|
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/profile))
|
||||||
|
Provides: bundled(golang(github.com/google/pprof/third.party/svg))
|
||||||
|
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))
|
||||||
|
|
||||||
Requires: %{name}-bin = %{version}-%{release}
|
Requires: %{name}-bin = %{version}-%{release}
|
||||||
Requires: %{name}-src = %{version}-%{release}
|
Requires: %{name}-src = %{version}-%{release}
|
||||||
Requires: go-srpm-macros
|
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
|
|
||||||
|
|
||||||
# we had been just removing the zoneinfo.zip, but that caused tests to fail for users that
|
# 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.
|
# 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
|
Patch215: ./go1.5-zoneinfo_testing_only.patch
|
||||||
@ -169,12 +182,8 @@ Patch215: ./go1.5-zoneinfo_testing_only.patch
|
|||||||
# Proposed patch by mmunday https://golang.org/cl/35262
|
# Proposed patch by mmunday https://golang.org/cl/35262
|
||||||
Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch
|
Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch
|
||||||
|
|
||||||
Patch220: s390x-ignore-L0syms.patch
|
# Proposed patch by jcajka https://golang.org/cl/86541
|
||||||
|
Patch221: golang-1.10-pkgconfig-fix.patch
|
||||||
# https://github.com/golang/go/commit/ca8c361d867d62bd46013c5abbaaad0b2ca6077f
|
|
||||||
Patch221: use-buildmode-pie-for-pie-testing.patch
|
|
||||||
# https://github.com/hyangah/go/commit/3502496d03bcd842fd7aac95ec0d7096d581cd26
|
|
||||||
Patch222: use-no-pie-where-needed.patch
|
|
||||||
|
|
||||||
# Having documentation separate was broken
|
# Having documentation separate was broken
|
||||||
Obsoletes: %{name}-docs < 1.1-4
|
Obsoletes: %{name}-docs < 1.1-4
|
||||||
@ -297,20 +306,11 @@ Requires: %{name} = %{version}-%{release}
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n go
|
%setup -q -n go
|
||||||
|
|
||||||
# increase verbosity of build
|
|
||||||
%patch0 -p1 -b .verbose
|
|
||||||
|
|
||||||
# use the arch dependent path in the bootstrap
|
|
||||||
%patch212 -p1 -b .bootstrap
|
|
||||||
|
|
||||||
%patch215 -p1
|
%patch215 -p1
|
||||||
|
|
||||||
%patch219 -p1
|
%patch219 -p1
|
||||||
|
|
||||||
%patch220 -p1
|
%patch221 -p1
|
||||||
|
|
||||||
%patch221 -p1 -b pie
|
|
||||||
%patch222 -p1
|
|
||||||
|
|
||||||
cp %{SOURCE1} ./src/runtime/
|
cp %{SOURCE1} ./src/runtime/
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ export GO_LDFLAGS="-linkmode internal"
|
|||||||
%if !%{cgo_enabled}
|
%if !%{cgo_enabled}
|
||||||
export CGO_ENABLED=0
|
export CGO_ENABLED=0
|
||||||
%endif
|
%endif
|
||||||
./make.bash --no-clean
|
./make.bash --no-clean -v
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# build shared std lib
|
# build shared std lib
|
||||||
@ -356,7 +356,7 @@ GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{race}
|
%if %{race}
|
||||||
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std
|
GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race -v -x std
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -547,6 +547,10 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jan 08 2018 Jakub Čajka <jcajka@redhat.com> - 1.9.2-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
|
* Thu Oct 26 2017 Jakub Čajka <jcajka@redhat.com> - 1.9.2-1
|
||||||
- Rebase to 1.9.2
|
- Rebase to 1.9.2
|
||||||
- execute correctly pie tests
|
- execute correctly pie tests
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
diff --git a/src/cmd/link/internal/ld/ldelf.go b/src/cmd/link/internal/ld/ldelf.go
|
|
||||||
index d4f9fc4..87dabaa 100644
|
|
||||||
--- a/src/cmd/link/internal/ld/ldelf.go
|
|
||||||
+++ b/src/cmd/link/internal/ld/ldelf.go
|
|
||||||
@@ -799,6 +799,13 @@ func ldelf(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if sect.name == ".debug_str" && sym.name == "L0" && sym.type_ == 0 {
|
|
||||||
+ // introduced by https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=49fced1206db40c71208c201165d65f92c69cebe on s390x
|
|
||||||
+ // TODO investigate from where they are actually coming from, could be possible issue with elf parsing as seeing 0x1 in name is weird
|
|
||||||
+ // See issue https://github.com/golang/go/issues/20996
|
|
||||||
+ continue
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if strings.HasPrefix(sym.name, ".LASF") { // gcc on s390x does this
|
|
||||||
continue
|
|
||||||
}
|
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (go1.9.2.src.tar.gz) = 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5
|
SHA512 (go1.10beta1.src.tar.gz) = ad479336f2ad90ca3dfb782e96c954d3c876fac69664666310817e31b471b6591f983aa8ab8eb321be8354fb0de7f5a901c10a192a06333535ccaebc14184d9b
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
diff -up go/src/cmd/dist/test.go.pie go/src/cmd/dist/test.go
|
|
||||||
--- go/src/cmd/dist/test.go.pie 2017-10-25 20:30:21.000000000 +0200
|
|
||||||
+++ go/src/cmd/dist/test.go 2017-11-03 16:47:55.290829798 +0100
|
|
||||||
@@ -852,6 +852,16 @@ func (t *tester) supportedBuildmode(mode
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
+ case "pie":
|
|
||||||
+ switch pair {
|
|
||||||
+ case "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-s390x",
|
|
||||||
+ "android-amd64", "android-arm", "android-arm64", "android-386":
|
|
||||||
+ return true
|
|
||||||
+ case "darwin-amd64":
|
|
||||||
+ return true
|
|
||||||
+ }
|
|
||||||
+ return false
|
|
||||||
+
|
|
||||||
default:
|
|
||||||
log.Fatalf("internal error: unknown buildmode %s", mode)
|
|
||||||
return false
|
|
||||||
@@ -953,24 +963,16 @@ func (t *tester) cgoTest(dt *distTest) e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if pair != "freebsd-amd64" { // clang -pie fails to link misc/cgo/test
|
|
||||||
- cmd := t.dirCmd("misc/cgo/test",
|
|
||||||
- cc, "-xc", "-o", "/dev/null", "-pie", "-")
|
|
||||||
+ if t.supportedBuildmode("pie") {
|
|
||||||
+ cmd = t.addCmd(dt, "misc/cgo/test", "go", "test", "-buildmode=pie")
|
|
||||||
cmd.Env = env
|
|
||||||
- cmd.Stdin = strings.NewReader("int main() {}")
|
|
||||||
- if err := cmd.Run(); err != nil {
|
|
||||||
- fmt.Println("No support for -pie found, skip cgo PIE test.")
|
|
||||||
- } else {
|
|
||||||
- cmd = t.addCmd(dt, "misc/cgo/test", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`)
|
|
||||||
- cmd.Env = env
|
|
||||||
|
|
||||||
- cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`)
|
|
||||||
- cmd.Env = env
|
|
||||||
+ cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-buildmode=pie")
|
|
||||||
+ cmd.Env = env
|
|
||||||
|
|
||||||
- cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`)
|
|
||||||
- cmd.Env = env
|
|
||||||
+ cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-buildmode=pie")
|
|
||||||
+ cmd.Env = env
|
|
||||||
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
From 3502496d03bcd842fd7aac95ec0d7096d581cd26 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Lynn Boger <laboger@linux.vnet.ibm.com>
|
|
||||||
Date: Wed, 11 Oct 2017 16:02:59 -0400
|
|
||||||
Subject: [PATCH] misc/cgo/testcarchive: use -no-pie where needed
|
|
||||||
|
|
||||||
Starting in gcc 6, -pie is passed to the linker by default
|
|
||||||
on some platforms, including ppc64le. If the objects
|
|
||||||
being linked are not built for -pie then in some cases the
|
|
||||||
executable could be in error. To avoid that problem, -no-pie
|
|
||||||
should be used with gcc to override the default -pie option
|
|
||||||
and generate a correct executable that can be run without error.
|
|
||||||
|
|
||||||
Fixes #22126
|
|
||||||
|
|
||||||
Change-Id: I4a052bba8b9b3bd6706f5d27ca9a7cebcb504c95
|
|
||||||
Reviewed-on: https://go-review.googlesource.com/70072
|
|
||||||
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
|
|
||||||
TryBot-Result: Gobot Gobot <gobot@golang.org>
|
|
||||||
Reviewed-by: Ian Lance Taylor <iant@golang.org>
|
|
||||||
---
|
|
||||||
misc/cgo/testcarchive/carchive_test.go | 20 +++++++++++++++++++-
|
|
||||||
1 file changed, 19 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/misc/cgo/testcarchive/carchive_test.go b/misc/cgo/testcarchive/carchive_test.go
|
|
||||||
index b5123154e79..ac637c06007 100644
|
|
||||||
--- a/misc/cgo/testcarchive/carchive_test.go
|
|
||||||
+++ b/misc/cgo/testcarchive/carchive_test.go
|
|
||||||
@@ -6,6 +6,7 @@ package carchive_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bufio"
|
|
||||||
+ "bytes"
|
|
||||||
"debug/elf"
|
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
|
||||||
@@ -609,9 +610,26 @@ func TestCompileWithoutShared(t *testing.T) {
|
|
||||||
}
|
|
||||||
|
|
||||||
exe := "./testnoshared" + exeSuffix
|
|
||||||
- ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a")
|
|
||||||
+
|
|
||||||
+ // In some cases, -no-pie is needed here, but not accepted everywhere. First try
|
|
||||||
+ // if -no-pie is accepted. See #22126.
|
|
||||||
+ ccArgs := append(cc, "-o", exe, "-no-pie", "main5.c", "libgo2.a")
|
|
||||||
t.Log(ccArgs)
|
|
||||||
out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput()
|
|
||||||
+
|
|
||||||
+ // If -no-pie unrecognized, try -nopie if this is possibly clang
|
|
||||||
+ if err != nil && bytes.Contains(out, []byte("unknown")) && !strings.Contains(cc[0], "gcc") {
|
|
||||||
+ ccArgs = append(cc, "-o", exe, "-nopie", "main5.c", "libgo2.a")
|
|
||||||
+ t.Log(ccArgs)
|
|
||||||
+ out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput()
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Don't use either -no-pie or -nopie
|
|
||||||
+ if err != nil && bytes.Contains(out, []byte("unrecognized")) {
|
|
||||||
+ ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a")
|
|
||||||
+ t.Log(ccArgs)
|
|
||||||
+ out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput()
|
|
||||||
+ }
|
|
||||||
t.Logf("%s", out)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
Loading…
Reference in New Issue
Block a user