[Pkg-golang-commits] [golang] 03/04: Disable 0002-reproducible-BUILD_PATH_PREFIX_MAP.patch for now. Remove all other patches.

Michael Hudson-Doyle mwhudson-guest at moszumanska.debian.org
Fri Dec 8 01:48:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

mwhudson-guest pushed a commit to branch golang-1.10
in repository golang.

commit a631fff8675c9dc47becb846cd3d41770bbb2fe1
Author: Michael Hudson-Doyle <michael.hudson at canonical.com>
Date:   Fri Dec 8 14:35:10 2017 +1300

    Disable 0002-reproducible-BUILD_PATH_PREFIX_MAP.patch for now. Remove all other patches.
---
 .../patches/0003-Do-not-use-SP-as-index-reg.patch  | 56 ------------
 ...md-dist-use-buildmode-pie-for-pie-testing.patch | 99 ----------------------
 ...-buildmode-pie-in-testCgoPprofPIE-instead.patch | 39 ---------
 ...-cgo-testcarchive-use-no-pie-where-needed.patch | 61 -------------
 debian/patches/series                              |  6 +-
 5 files changed, 1 insertion(+), 260 deletions(-)

diff --git a/debian/patches/0003-Do-not-use-SP-as-index-reg.patch b/debian/patches/0003-Do-not-use-SP-as-index-reg.patch
deleted file mode 100644
index 8285b2a..0000000
--- a/debian/patches/0003-Do-not-use-SP-as-index-reg.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Author: Keith Randall <khr at golang.org>
-Date: Wed Oct 25 13:46:38 2017 -0700
-Description: cmd/compile: make sure not to use SP as an index register
- ...because that's an illegal addressing mode.
-Reviewed-on: https://go-review.googlesource.com/73551
-Bug-Upstream: https://github.com/golang/go/issues/22429
-
-diff --git a/src/cmd/compile/internal/x86/387.go b/src/cmd/compile/internal/x86/387.go
-index cdac000..7a36224 100644
---- a/src/cmd/compile/internal/x86/387.go
-+++ b/src/cmd/compile/internal/x86/387.go
-@@ -46,6 +46,9 @@
- 		case ssa.Op386MOVSSloadidx1, ssa.Op386MOVSDloadidx1:
- 			p.From.Scale = 1
- 			p.From.Index = v.Args[1].Reg()
-+			if p.From.Index == x86.REG_SP {
-+				p.From.Reg, p.From.Index = p.From.Index, p.From.Reg
-+			}
- 		case ssa.Op386MOVSSloadidx4:
- 			p.From.Scale = 4
- 			p.From.Index = v.Args[1].Reg()
-@@ -95,6 +98,9 @@
- 		case ssa.Op386MOVSSstoreidx1, ssa.Op386MOVSDstoreidx1:
- 			p.To.Scale = 1
- 			p.To.Index = v.Args[1].Reg()
-+			if p.To.Index == x86.REG_SP {
-+				p.To.Reg, p.To.Index = p.To.Index, p.To.Reg
-+			}
- 		case ssa.Op386MOVSSstoreidx4:
- 			p.To.Scale = 4
- 			p.To.Index = v.Args[1].Reg()
-
-diff --git a/test/fixedbugs/issue22429.go b/test/fixedbugs/issue22429.go
-new file mode 100644
-index 0000000..289b434
---- /dev/null
-+++ b/test/fixedbugs/issue22429.go
-@@ -0,0 +1,18 @@
-+// compile
-+
-+// Copyright 2017 The Go Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style
-+// license that can be found in the LICENSE file.
-+
-+// Make sure SSA->assembly pass can handle SP as an index register.
-+
-+package p
-+
-+type T struct {
-+	a,b,c,d float32
-+}
-+
-+func f(a *[8]T, i,j,k int) float32 {
-+	b := *a
-+	return b[i].a + b[j].b + b[k].c
-+}
diff --git a/debian/patches/0004-cmd-dist-use-buildmode-pie-for-pie-testing.patch b/debian/patches/0004-cmd-dist-use-buildmode-pie-for-pie-testing.patch
deleted file mode 100644
index 4914f4a..0000000
--- a/debian/patches/0004-cmd-dist-use-buildmode-pie-for-pie-testing.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From ca8c361d867d62bd46013c5abbaaad0b2ca6077f Mon Sep 17 00:00:00 2001
-From: Lynn Boger <laboger at linux.vnet.ibm.com>
-Date: Thu, 28 Sep 2017 10:26:39 -0400
-Subject: [PATCH] cmd/dist: use -buildmode=pie for pie testing
-
-Some tests in misc/cgo/test are run with various options including
-'-linkmode=external "-extldflags=-pie"'. On ppc64x passing -pie to
-the external linker with code that was not compiled as position
-independent is incorrect. This works by luck in many cases but is
-not guaranteed to work. I suspect it is an issue on other targets
-as well.
-
-This will now run the tests using -buildmode=pie for the platforms
-that support that buildmode option.
-
-Fixes #21954
-
-Change-Id: I25fc7573f2d3cb5b0d1c691a0ac91aef7715404f
-Reviewed-on: https://go-review.googlesource.com/66870
-Run-TryBot: Lynn Boger <laboger at linux.vnet.ibm.com>
-TryBot-Result: Gobot Gobot <gobot at golang.org>
-Reviewed-by: Ian Lance Taylor <iant at golang.org>
----
- src/cmd/dist/test.go | 41 ++++++++++++++---------------------------
- 1 file changed, 14 insertions(+), 27 deletions(-)
-
---- a/src/cmd/dist/test.go
-+++ b/src/cmd/dist/test.go
-@@ -852,6 +852,16 @@
- 			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
-@@ -928,49 +938,15 @@
- 			// static linking on FreeBSD/ARM with clang. (cgo depends on
- 			// -fPIC fundamentally.)
- 		default:
--			cc := mustEnv("CC")
--			cmd := t.dirCmd("misc/cgo/test",
--				cc, "-xc", "-o", "/dev/null", "-static", "-")
--			cmd.Env = env
--			cmd.Stdin = strings.NewReader("int main() {}")
--			if err := cmd.Run(); err != nil {
--				fmt.Println("No support for static linking found (lacks libc.a?), skip cgo static linking test.")
--			} else {
--				if t.goos != "android" {
--					cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
--					cmd.Env = env
--				}
--
--				cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test")
-+			if t.supportedBuildmode("pie") {
-+				cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", "-buildmode=pie")
- 				cmd.Env = env
- 
--				cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external`)
-+				cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-buildmode=pie")
- 				cmd.Env = env
- 
--				if t.goos != "android" {
--					cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
--					cmd.Env = env
--				}
--			}
--
--			if pair != "freebsd-amd64" { // clang -pie fails to link misc/cgo/test
--				cmd := t.dirCmd("misc/cgo/test",
--					cc, "-xc", "-o", "/dev/null", "-pie", "-")
-+				cmd = t.addCmd(dt, "misc/cgo/nocgo", "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/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`)
--					cmd.Env = env
--
--				}
- 			}
- 		}
- 	}
diff --git a/debian/patches/0005-runtime-use-buildmode-pie-in-testCgoPprofPIE-instead.patch b/debian/patches/0005-runtime-use-buildmode-pie-in-testCgoPprofPIE-instead.patch
deleted file mode 100644
index 7b1d941..0000000
--- a/debian/patches/0005-runtime-use-buildmode-pie-in-testCgoPprofPIE-instead.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 58de9f358375e87f07605852530383fee0a4b671 Mon Sep 17 00:00:00 2001
-From: Lynn Boger <laboger at linux.vnet.ibm.com>
-Date: Fri, 27 Oct 2017 10:06:40 -0400
-Subject: [PATCH] runtime: use -buildmode=pie in testCgoPprofPIE  instead of
- -extldflags=-pie
-
-Errors occur in runtime test testCgoPprofPIE when the test
-is built by passing -pie to the external linker with code
-that was not built as PIC. This occurs on ppc64le because
-non-PIC is the default, and fails only on newer distros
-where the address range used for programs is high enough
-to cause relocation overflow. This test should be built
-with -buildmode=pie since that correctly generates PIC
-with -pie.
-
-Related issues are #21954 and #22126.
-
-Updates #22459
-
-Change-Id: Ib641440bc9f94ad2b97efcda14a4b482647be8f7
-Reviewed-on: https://go-review.googlesource.com/73970
-Run-TryBot: Lynn Boger <laboger at linux.vnet.ibm.com>
-TryBot-Result: Gobot Gobot <gobot at golang.org>
-Reviewed-by: Ian Lance Taylor <iant at golang.org>
----
- src/runtime/crash_cgo_test.go | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/runtime/crash_cgo_test.go
-+++ b/src/runtime/crash_cgo_test.go
-@@ -330,7 +330,7 @@
- }
- 
- func TestCgoPprofPIE(t *testing.T) {
--	testCgoPprof(t, "-ldflags=-extldflags=-pie", "CgoPprof")
-+	testCgoPprof(t, "-buildmode=pie", "CgoPprof")
- }
- 
- func TestCgoPprofThread(t *testing.T) {
diff --git a/debian/patches/0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch b/debian/patches/0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch
deleted file mode 100644
index 3abd4b4..0000000
--- a/debian/patches/0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From c15c44ec48fa278330b5d205cf7b4508250496fe Mon Sep 17 00:00:00 2001
-From: Lynn Boger <laboger at 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 at linux.vnet.ibm.com>
-TryBot-Result: Gobot Gobot <gobot at golang.org>
-Reviewed-by: Ian Lance Taylor <iant at golang.org>
----
- misc/cgo/testcarchive/carchive_test.go | 20 +++++++++++++++++++-
- 1 file changed, 19 insertions(+), 1 deletion(-)
-
---- a/misc/cgo/testcarchive/carchive_test.go
-+++ b/misc/cgo/testcarchive/carchive_test.go
-@@ -6,6 +6,7 @@
- 
- import (
- 	"bufio"
-+	"bytes"
- 	"debug/elf"
- 	"fmt"
- 	"io/ioutil"
-@@ -605,9 +606,26 @@
- 	}
- 
- 	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)
diff --git a/debian/patches/series b/debian/patches/series
index 47c2abc..56765d3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1 @@
-0002-reproducible-BUILD_PATH_PREFIX_MAP.patch
-0003-Do-not-use-SP-as-index-reg.patch
-0004-cmd-dist-use-buildmode-pie-for-pie-testing.patch
-0005-runtime-use-buildmode-pie-in-testCgoPprofPIE-instead.patch
-0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch
+#0002-reproducible-BUILD_PATH_PREFIX_MAP.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-golang/golang.git



More information about the pkg-golang-commits mailing list