diff options
author | George Burgess IV <gbiv@google.com> | 2024-05-01 15:46:18 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-05-06 14:44:13 +0000 |
commit | d8a32d1c78696827014365e1180a566113651d8f (patch) | |
tree | f6d79e382dbdf0ad949071c72edb085874456733 | |
parent | d234c9dc27b23d86c2af783a549ef3918e011548 (diff) | |
download | toolchain-utils-d8a32d1c78696827014365e1180a566113651d8f.tar.gz |
go: remove patch/ subdir
These are patches to Go's sources, which are entirely unused by CrOS
(and for very old versions of Go, so we can infer that Android doesn't
care)
BUG=b:337837895
TEST=None
Change-Id: Iaa1a847edfc3c99651b15d45b483b47c27d3b0cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5507041
Reviewed-by: Bob Haarman <inglorion@chromium.org>
Tested-by: George Burgess <gbiv@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
-rw-r--r-- | go/patch/go-1.10.2/go0.patch | 45 | ||||
-rw-r--r-- | go/patch/go-1.10.2/go1.patch | 67 | ||||
-rw-r--r-- | go/patch/go-1.10.2/go2.patch | 359 | ||||
-rw-r--r-- | go/patch/go-1.10.2/go3.patch | 980 | ||||
-rw-r--r-- | go/patch/go-1.10.2/go4.patch | 199 | ||||
-rw-r--r-- | go/patch/go-1.10.2/go5.patch | 160 | ||||
-rw-r--r-- | go/patch/go-1.10.2/go6.patch | 230 | ||||
-rw-r--r-- | go/patch/go-1.10.3/go0.patch | 27 | ||||
-rw-r--r-- | go/patch/go-1.10.3/go1.patch | 50 | ||||
-rw-r--r-- | go/patch/go-1.10.3/go2.patch | 267 | ||||
-rw-r--r-- | go/patch/go-1.10.3/go3.patch | 732 | ||||
-rw-r--r-- | go/patch/go-1.10.3/go4.patch | 199 | ||||
-rw-r--r-- | go/patch/go-1.10.3/go5.patch | 106 | ||||
-rw-r--r-- | go/patch/go-1.10.3/go6.patch | 142 | ||||
-rw-r--r-- | go/patch/go-1.11.2/go0.patch | 27 | ||||
-rw-r--r-- | go/patch/go-1.11.2/go1.patch | 50 | ||||
-rw-r--r-- | go/patch/go-1.11.2/go2.patch | 277 | ||||
-rw-r--r-- | go/patch/go-1.11.2/go3.patch | 730 | ||||
-rw-r--r-- | go/patch/go-1.11.2/go4.patch | 199 | ||||
-rw-r--r-- | go/patch/go-1.11.2/go5.patch | 106 | ||||
-rw-r--r-- | go/patch/go-1.11.2/go6.patch | 149 |
21 files changed, 0 insertions, 5101 deletions
diff --git a/go/patch/go-1.10.2/go0.patch b/go/patch/go-1.10.2/go0.patch deleted file mode 100644 index c539865e..00000000 --- a/go/patch/go-1.10.2/go0.patch +++ /dev/null @@ -1,45 +0,0 @@ -testenv: look for "go" executable in path. - ---- src/go/build/deps_test.go -+++ src/go/build/deps_test.go -@@ -182,17 +182,17 @@ var pkgDeps = map[string][]string{ - "runtime/debug": {"L2", "fmt", "io/ioutil", "os", "time"}, - "runtime/pprof": {"L2", "compress/gzip", "context", "encoding/binary", "fmt", "io/ioutil", "os", "text/tabwriter", "time"}, - "runtime/trace": {"L0"}, - "text/tabwriter": {"L2"}, - - "testing": {"L2", "flag", "fmt", "internal/race", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"}, - "testing/iotest": {"L2", "log"}, - "testing/quick": {"L2", "flag", "fmt", "reflect", "time"}, -- "internal/testenv": {"L2", "OS", "flag", "testing", "syscall"}, -+ "internal/testenv": {"L2", "OS", "os/exec", "flag", "testing", "syscall"}, - - // L4 is defined as L3+fmt+log+time, because in general once - // you're using L3 packages, use of fmt, log, or time is not a big deal. - "L4": { - "L3", - "fmt", - "log", - "time", ---- src/internal/testenv/testenv.go -+++ src/internal/testenv/testenv.go -@@ -43,16 +43,19 @@ func HasGoBuild() bool { - switch runtime.GOOS { - case "android", "nacl": - return false - case "darwin": - if strings.HasPrefix(runtime.GOARCH, "arm") { - return false - } - } -+ if _, err := exec.LookPath("go"); err != nil { -+ return false -+ } - return true - } - - // MustHaveGoBuild checks that the current system can build programs with ``go build'' - // and then run them with os.StartProcess or exec.Command. - // If not, MustHaveGoBuild calls t.Skip with an explanation. - func MustHaveGoBuild(t testing.TB) { - if os.Getenv("GO_GCFLAGS") != "" { diff --git a/go/patch/go-1.10.2/go1.patch b/go/patch/go-1.10.2/go1.patch deleted file mode 100644 index e32268ac..00000000 --- a/go/patch/go-1.10.2/go1.patch +++ /dev/null @@ -1,67 +0,0 @@ -test: enable some tests on android/arm64. - ---- test/chanlinear.go -+++ test/chanlinear.go -@@ -1,9 +1,9 @@ --// +build darwin linux -+// +build darwin linux android - // run - - // Copyright 2014 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. - - // Test that dequeueing from a pending channel doesn't - // take linear time. ---- test/fixedbugs/bug385_64.go -+++ test/fixedbugs/bug385_64.go -@@ -1,9 +1,9 @@ --// +build amd64 -+// +build amd64 arm64 - // errorcheck - - // Copyright 2011 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. - - // Issue 2444 - // Issue 4666: issue with arrays of exactly 4GB. ---- test/fixedbugs/issue10607.go -+++ test/fixedbugs/issue10607.go -@@ -1,9 +1,9 @@ --// +build linux,!ppc64 -+// +build linux,!ppc64 android - // run - - // Copyright 2015 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. - - // Test that a -B option is passed through when using both internal - // and external linking mode. ---- test/maplinear.go -+++ test/maplinear.go -@@ -1,9 +1,9 @@ --// +build darwin linux -+// +build darwin linux android - // run - - // Copyright 2013 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. - - // Test that maps don't go quadratic for NaNs and other values. - ---- test/recover4.go -+++ test/recover4.go -@@ -1,9 +1,9 @@ --// +build linux darwin -+// +build linux android darwin - // run - - // Copyright 2015 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. - - // Test that if a slice access causes a fault, a deferred func - // sees the most recent value of the variables it accesses. diff --git a/go/patch/go-1.10.2/go2.patch b/go/patch/go-1.10.2/go2.patch deleted file mode 100644 index 20f04791..00000000 --- a/go/patch/go-1.10.2/go2.patch +++ /dev/null @@ -1,359 +0,0 @@ -test: add -target flag. - ---- test/run.go -+++ test/run.go -@@ -34,19 +34,19 @@ import ( - - var ( - verbose = flag.Bool("v", false, "verbose. if set, parallelism is set to 1.") - keep = flag.Bool("k", false, "keep. keep temporary directory.") - numParallel = flag.Int("n", runtime.NumCPU(), "number of parallel tests to run") - summary = flag.Bool("summary", false, "show summary of results") - showSkips = flag.Bool("show_skips", false, "show skipped tests") - runSkips = flag.Bool("run_skips", false, "run skipped tests (ignore skip and build tags)") -- linkshared = flag.Bool("linkshared", false, "") - updateErrors = flag.Bool("update_errors", false, "update error messages in test file based on compiler output") - runoutputLimit = flag.Int("l", defaultRunOutputLimit(), "number of parallel runoutput tests to run") -+ target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") - - shard = flag.Int("shard", 0, "shard index to run. Only applicable if -shards is non-zero.") - shards = flag.Int("shards", 0, "number of shards. If 0, all tests are run. This is used by the continuous build.") - ) - - var ( - goos, goarch string - -@@ -189,48 +189,49 @@ func goFiles(dir string) []string { - } - sort.Strings(names) - return names - } - - type runCmd func(...string) ([]byte, error) - - func compileFile(runcmd runCmd, longname string, flags []string) (out []byte, err error) { -- cmd := []string{"go", "tool", "compile", "-e"} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e"} - cmd = append(cmd, flags...) -- if *linkshared { -- cmd = append(cmd, "-dynlink", "-installsuffix=dynlink") -- } - cmd = append(cmd, longname) - return runcmd(cmd...) - } - - func compileInDir(runcmd runCmd, dir string, flags []string, names ...string) (out []byte, err error) { -- cmd := []string{"go", "tool", "compile", "-e", "-D", ".", "-I", "."} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e", "-D", ".", "-I", "."} - cmd = append(cmd, flags...) -- if *linkshared { -- cmd = append(cmd, "-dynlink", "-installsuffix=dynlink") -- } - for _, name := range names { - cmd = append(cmd, filepath.Join(dir, name)) - } - return runcmd(cmd...) - } - - func linkFile(runcmd runCmd, goname string) (err error) { - pfile := strings.Replace(goname, ".go", ".o", -1) -- cmd := []string{"go", "tool", "link", "-w", "-o", "a.exe", "-L", "."} -- if *linkshared { -- cmd = append(cmd, "-linkshared", "-installsuffix=dynlink") -- } -- cmd = append(cmd, pfile) -- _, err = runcmd(cmd...) -+ _, err = runcmd(findGoCmd(), "tool", "link", "-w", "-o", "a.exe", "-L", ".", pfile) - return - } - -+func goRun(runcmd runCmd, flags []string, goname string, args ...string) (out []byte, err error) { -+ cmd := []string{findGoCmd(), "run", goGcflags()} -+ if len(findExecCmd()) > 0 { -+ cmd = append(cmd, "-exec") -+ cmd = append(cmd, findExecCmd()...) -+ } -+ cmd = append(cmd, flags...) -+ cmd = append(cmd, goname) -+ cmd = append(cmd, args...) -+ return runcmd(cmd...) -+} -+ - // skipError describes why a test was skipped. - type skipError string - - func (s skipError) Error() string { return string(s) } - - func check(err error) { - if err != nil { - log.Fatal(err) -@@ -590,18 +591,17 @@ func (t *test) run() { - - long := filepath.Join(cwd, t.goFileName()) - switch action { - default: - t.err = fmt.Errorf("unimplemented action %q", action) - - case "errorcheck": - // TODO(gri) remove need for -C (disable printing of columns in error messages) -- cmdline := []string{"go", "tool", "compile", "-C", "-e", "-o", "a.o"} -- // No need to add -dynlink even if linkshared if we're just checking for errors... -+ cmdline := []string{findGoCmd(), "tool", "compile", "-C", "-e", "-o", "a.o"} - cmdline = append(cmdline, flags...) - cmdline = append(cmdline, long) - out, err := runcmd(cmdline...) - if wantError { - if err == nil { - t.err = fmt.Errorf("compilation succeeded unexpectedly\n%s", out) - return - } -@@ -704,17 +704,17 @@ func (t *test) run() { - } - if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { - t.err = fmt.Errorf("incorrect output\n%s", out) - } - } - } - - case "build": -- _, err := runcmd("go", "build", goGcflags(), "-o", "a.exe", long) -+ _, err := runcmd(findGoCmd(), "build", goGcflags(), "-o", "a.exe", long) - if err != nil { - t.err = err - } - - case "builddir": - // Build an executable from all the .go and .s files in a subdirectory. - useTmp = true - longdir := filepath.Join(cwd, t.goDirName()) -@@ -730,177 +730,132 @@ func (t *test) run() { - case ".go": - gos = append(gos, file) - case ".s": - asms = append(asms, file) - } - - } - var objs []string -- cmd := []string{"go", "tool", "compile", "-e", "-D", ".", "-I", ".", "-o", "go.o"} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e", "-D", ".", "-I", ".", "-o", "go.o"} - if len(asms) > 0 { - cmd = append(cmd, "-asmhdr", "go_asm.h") - } - for _, file := range gos { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } - _, err := runcmd(cmd...) - if err != nil { - t.err = err - break - } - objs = append(objs, "go.o") - if len(asms) > 0 { -- cmd = []string{"go", "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} -+ cmd = []string{findGoCmd(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} - for _, file := range asms { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } - _, err = runcmd(cmd...) - if err != nil { - t.err = err - break - } - objs = append(objs, "asm.o") - } -- cmd = []string{"go", "tool", "pack", "c", "all.a"} -+ cmd = []string{findGoCmd(), "tool", "pack", "c", "all.a"} - cmd = append(cmd, objs...) - _, err = runcmd(cmd...) - if err != nil { - t.err = err - break - } -- cmd = []string{"go", "tool", "link", "all.a"} -+ cmd = []string{findGoCmd(), "tool", "link", "all.a"} - _, err = runcmd(cmd...) - if err != nil { - t.err = err - break - } - - case "buildrun": // build binary, then run binary, instead of go run. Useful for timeout tests where failure mode is infinite loop. - // TODO: not supported on NaCl - useTmp = true -- cmd := []string{"go", "build", goGcflags(), "-o", "a.exe"} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -+ cmd := []string{findGoCmd(), "build", goGcflags(), "-o", "a.exe"} - longdirgofile := filepath.Join(filepath.Join(cwd, t.dir), t.gofile) - cmd = append(cmd, flags...) - cmd = append(cmd, longdirgofile) - out, err := runcmd(cmd...) - if err != nil { - t.err = err - return - } -- cmd = []string{"./a.exe"} -+ cmd = []string{} -+ if len(findExecCmd()) > 0 { -+ cmd = append(cmd, findExecCmd()...) -+ } -+ cmd = append(cmd, "./a.exe") - out, err = runcmd(append(cmd, args...)...) - if err != nil { - t.err = err - return - } - - if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { - t.err = fmt.Errorf("incorrect output\n%s", out) - } - - case "run": - useTmp = false -- var out []byte -- var err error -- if len(flags)+len(args) == 0 && goGcflags() == "" && !*linkshared { -- // If we're not using special go command flags, -- // skip all the go command machinery. -- // This avoids any time the go command would -- // spend checking whether, for example, the installed -- // package runtime is up to date. -- // Because we run lots of trivial test programs, -- // the time adds up. -- pkg := filepath.Join(t.tempDir, "pkg.a") -- if _, err := runcmd("go", "tool", "compile", "-o", pkg, t.goFileName()); err != nil { -- t.err = err -- return -- } -- exe := filepath.Join(t.tempDir, "test.exe") -- cmd := []string{"go", "tool", "link", "-s", "-w"} -- cmd = append(cmd, "-o", exe, pkg) -- if _, err := runcmd(cmd...); err != nil { -- t.err = err -- return -- } -- out, err = runcmd(append([]string{exe}, args...)...) -- } else { -- cmd := []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, flags...) -- cmd = append(cmd, t.goFileName()) -- out, err = runcmd(append(cmd, args...)...) -- } -+ out, err := goRun(runcmd, flags, t.goFileName(), args...) - if err != nil { - t.err = err - return - } - if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { - t.err = fmt.Errorf("incorrect output\n%s", out) - } - - case "runoutput": - rungatec <- true - defer func() { - <-rungatec - }() - useTmp = false -- cmd := []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, t.goFileName()) -- out, err := runcmd(append(cmd, args...)...) -+ out, err := goRun(runcmd, nil, t.goFileName(), args...) - if err != nil { - t.err = err - return - } - tfile := filepath.Join(t.tempDir, "tmp__.go") - if err := ioutil.WriteFile(tfile, out, 0666); err != nil { - t.err = fmt.Errorf("write tempfile:%s", err) - return - } -- cmd = []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, tfile) -- out, err = runcmd(cmd...) -+ out, err = goRun(runcmd, nil, tfile) - if err != nil { - t.err = err - return - } - if string(out) != t.expectedOutput() { - t.err = fmt.Errorf("incorrect output\n%s", out) - } - - case "errorcheckoutput": - useTmp = false -- cmd := []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, t.goFileName()) -- out, err := runcmd(append(cmd, args...)...) -+ out, err := goRun(runcmd, nil, t.goFileName(), args...) - if err != nil { - t.err = err - return - } - tfile := filepath.Join(t.tempDir, "tmp__.go") - err = ioutil.WriteFile(tfile, out, 0666) - if err != nil { - t.err = fmt.Errorf("write tempfile:%s", err) - return - } -- cmdline := []string{"go", "tool", "compile", "-e", "-o", "a.o"} -+ cmdline := []string{findGoCmd(), "tool", "compile", "-e", "-o", "a.o"} - cmdline = append(cmdline, flags...) - cmdline = append(cmdline, tfile) - out, err = runcmd(cmdline...) - if wantError { - if err == nil { - t.err = fmt.Errorf("compilation succeeded unexpectedly\n%s", out) - return - } -@@ -917,26 +872,37 @@ func (t *test) run() { - - var execCmd []string - - func findExecCmd() []string { - if execCmd != nil { - return execCmd - } - execCmd = []string{} // avoid work the second time -+ if *target != "" { -+ execCmd = []string{"go_" + *target + "_exec"} -+ return execCmd -+ } - if goos == runtime.GOOS && goarch == runtime.GOARCH { - return execCmd - } - path, err := exec.LookPath(fmt.Sprintf("go_%s_%s_exec", goos, goarch)) - if err == nil { - execCmd = []string{path} - } - return execCmd - } - -+func findGoCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func (t *test) String() string { - return filepath.Join(t.dir, t.gofile) - } - - func (t *test) makeTempDir() { - var err error - t.tempDir, err = ioutil.TempDir("", "") - check(err) diff --git a/go/patch/go-1.10.2/go3.patch b/go/patch/go-1.10.2/go3.patch deleted file mode 100644 index 62247a03..00000000 --- a/go/patch/go-1.10.2/go3.patch +++ /dev/null @@ -1,980 +0,0 @@ -test: add runtarget action. - ---- test/fixedbugs/bug248.go -+++ test/fixedbugs/bug248.go -@@ -1,38 +1,57 @@ - // +build !nacl,!plan9,!windows --// run -+// runtarget - - // Copyright 2009 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(cmd ...string) { -+ if *target == "" { -+ run(cmd[0], cmd[1:]...) -+ } else { -+ run("go_"+*target+"_exec", cmd...) -+ } -+} -+ - func main() { -+ flag.Parse() - // TODO: If we get rid of errchk, re-enable this test on Windows. - errchk, err := filepath.Abs("errchk") - check(err) - - err = os.Chdir(filepath.Join("fixedbugs", "bug248.dir")) - check(err) - -- run("go", "tool", "compile", "bug0.go") -- run("go", "tool", "compile", "bug1.go") -- run("go", "tool", "compile", "bug2.go") -- run(errchk, "go", "tool", "compile", "-e", "bug3.go") -- run("go", "tool", "link", "bug2.o") -- run(fmt.Sprintf(".%ca.out", filepath.Separator)) -+ run(goCmd(), "tool", "compile", "bug0.go") -+ run(goCmd(), "tool", "compile", "bug1.go") -+ run(goCmd(), "tool", "compile", "bug2.go") -+ run(errchk, goCmd(), "tool", "compile", "-e", "bug3.go") -+ run(goCmd(), "tool", "link", "bug2.o") -+ goRun(fmt.Sprintf(".%ca.out", filepath.Separator)) - - os.Remove("bug0.o") - os.Remove("bug1.o") - os.Remove("bug2.o") - os.Remove("a.out") - } - - func run(name string, args ...string) { ---- test/fixedbugs/bug302.go -+++ test/fixedbugs/bug302.go -@@ -1,28 +1,39 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -- run("go", "tool", "compile", filepath.Join("fixedbugs", "bug302.dir", "p.go")) -- run("go", "tool", "pack", "grc", "pp.a", "p.o") -- run("go", "tool", "compile", "-I", ".", filepath.Join("fixedbugs", "bug302.dir", "main.go")) -+ flag.Parse() -+ run(goCmd(), "tool", "compile", filepath.Join("fixedbugs", "bug302.dir", "p.go")) -+ run(goCmd(), "tool", "pack", "grc", "pp.a", "p.o") -+ run(goCmd(), "tool", "compile", "-I", ".", filepath.Join("fixedbugs", "bug302.dir", "main.go")) - os.Remove("p.o") - os.Remove("pp.a") - os.Remove("main.o") - } - - func run(cmd string, args ...string) { - out, err := exec.Command(cmd, args...).CombinedOutput() - if err != nil { ---- test/fixedbugs/bug345.go -+++ test/fixedbugs/bug345.go -@@ -1,34 +1,45 @@ - // +build !nacl,!plan9,!windows --// run -+// runtarget - - // Copyright 2011 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -+ flag.Parse() - // TODO: If we get rid of errchk, re-enable this test on Plan 9 and Windows. - errchk, err := filepath.Abs("errchk") - check(err) - - err = os.Chdir(filepath.Join(".", "fixedbugs", "bug345.dir")) - check(err) - -- run("go", "tool", "compile", "io.go") -- run(errchk, "go", "tool", "compile", "-e", "main.go") -+ run(goCmd(), "tool", "compile", "io.go") -+ run(errchk, goCmd(), "tool", "compile", "-e", "main.go") - os.Remove("io.o") - } - - func run(name string, args ...string) { - cmd := exec.Command(name, args...) - out, err := cmd.CombinedOutput() - if err != nil { - fmt.Println(string(out)) ---- test/fixedbugs/bug369.go -+++ test/fixedbugs/bug369.go -@@ -1,35 +1,54 @@ - // +build !nacl,!windows --// run -+// runtarget - - // Copyright 2011 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. - - // Test that compiling with optimization turned on produces faster code. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(cmd ...string) { -+ if *target == "" { -+ run(cmd[0], cmd[1:]...) -+ } else { -+ run("go_"+*target+"_exec", cmd...) -+ } -+} -+ - func main() { -+ flag.Parse() - err := os.Chdir(filepath.Join(".", "fixedbugs", "bug369.dir")) - check(err) - -- run("go", "tool", "compile", "-N", "-o", "slow.o", "pkg.go") -- run("go", "tool", "compile", "-o", "fast.o", "pkg.go") -- run("go", "tool", "compile", "-o", "main.o", "main.go") -- run("go", "tool", "link", "-o", "a.exe", "main.o") -- run("." + string(filepath.Separator) + "a.exe") -+ run(goCmd(), "tool", "compile", "-N", "-o", "slow.o", "pkg.go") -+ run(goCmd(), "tool", "compile", "-o", "fast.o", "pkg.go") -+ run(goCmd(), "tool", "compile", "-o", "main.o", "main.go") -+ run(goCmd(), "tool", "link", "-o", "a.exe", "main.o") -+ goRun("." + string(filepath.Separator) + "a.exe") - - os.Remove("slow.o") - os.Remove("fast.o") - os.Remove("main.o") - os.Remove("a.exe") - } - - func run(name string, args ...string) { ---- test/fixedbugs/bug429_run.go -+++ test/fixedbugs/bug429_run.go -@@ -1,29 +1,49 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 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. - - // Run the bug429.go test. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- cmd := exec.Command("go", "run", filepath.Join("fixedbugs", "bug429.go")) -+ flag.Parse() -+ cmd := goRun(filepath.Join("fixedbugs", "bug429.go")) - out, err := cmd.CombinedOutput() - if err == nil { - fmt.Println("expected deadlock") - os.Exit(1) - } - - want := "fatal error: all goroutines are asleep - deadlock!" - got := string(out) ---- test/fixedbugs/issue10607.go -+++ test/fixedbugs/issue10607.go -@@ -1,31 +1,51 @@ - // +build linux,!ppc64 android --// run -+// runtarget - - // Copyright 2015 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. - - // Test that a -B option is passed through when using both internal - // and external linking mode. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- test("internal") -+ flag.Parse() -+ // test("internal") - test("external") - } - - func test(linkmode string) { -- out, err := exec.Command("go", "run", "-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput() -+ out, err := goRun("-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput() - if err != nil { - fmt.Printf("BUG: linkmode=%s %v\n%s\n", linkmode, err, out) - os.Exit(1) - } - } ---- test/fixedbugs/issue11771.go -+++ test/fixedbugs/issue11771.go -@@ -1,31 +1,42 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2015 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. - - // Issue 11771: Magic comments should ignore carriage returns. - - package main - - import ( - "bytes" -+ "flag" - "fmt" - "io/ioutil" - "log" - "os" - "os/exec" - "path/filepath" - "runtime" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -+ flag.Parse() - if runtime.Compiler != "gc" { - return - } - - dir, err := ioutil.TempDir("", "go-issue11771") - if err != nil { - log.Fatalf("creating temp dir: %v\n", err) - } -@@ -47,17 +58,17 @@ func main() { - func x() { - } - `) - - if err := ioutil.WriteFile(filepath.Join(dir, "x.go"), buf.Bytes(), 0666); err != nil { - log.Fatal(err) - } - -- cmd := exec.Command("go", "tool", "compile", "x.go") -+ cmd := exec.Command(goCmd(), "tool", "compile", "x.go") - cmd.Dir = dir - output, err := cmd.CombinedOutput() - if err == nil { - log.Fatal("compile succeeded unexpectedly") - } - if !bytes.Contains(output, []byte("only allowed in runtime")) { - log.Fatalf("wrong error message from compiler; got:\n%s\n", output) - } ---- test/fixedbugs/issue9355.go -+++ test/fixedbugs/issue9355.go -@@ -1,34 +1,45 @@ --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -+ flag.Parse() - if runtime.Compiler != "gc" || runtime.GOOS == "nacl" { - return - } - - err := os.Chdir(filepath.Join("fixedbugs", "issue9355.dir")) - check(err) - -- out := run("go", "tool", "compile", "-S", "a.go") -+ out := run(goCmd(), "tool", "compile", "-S", "a.go") - os.Remove("a.o") - - // 6g/8g print the offset as dec, but 5g/9g print the offset as hex. - patterns := []string{ - `rel 0\+\d t=1 \"\"\.x\+8\r?\n`, // y = &x.b - `rel 0\+\d t=1 \"\"\.x\+(28|1c)\r?\n`, // z = &x.d.q - `rel 0\+\d t=1 \"\"\.b\+5\r?\n`, // c = &b[5] - `rel 0\+\d t=1 \"\"\.x\+(88|58)\r?\n`, // w = &x.f[3].r ---- test/fixedbugs/issue9862_run.go -+++ test/fixedbugs/issue9862_run.go -@@ -1,26 +1,46 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2015 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. - - // Check for compile or link error. - - package main - - import ( -+ "flag" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- out, err := exec.Command("go", "run", "fixedbugs/issue9862.go").CombinedOutput() -+ flag.Parse() -+ out, err := goRun("fixedbugs/issue9862.go").CombinedOutput() - outstr := string(out) - if err == nil { - println("go run issue9862.go succeeded, should have failed\n", outstr) - return - } - if !strings.Contains(outstr, "symbol too large") { - println("go run issue9862.go gave unexpected error; want symbol too large:\n", outstr) - } ---- test/linkmain_run.go -+++ test/linkmain_run.go -@@ -1,26 +1,36 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 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. - - // Run the sinit test. - - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func cleanup() { - os.Remove("linkmain.o") - os.Remove("linkmain.a") - os.Remove("linkmain1.o") - os.Remove("linkmain1.a") - os.Remove("linkmain.exe") - } - -@@ -46,21 +56,23 @@ func runFail(cmdline string) { - fmt.Println(string(out)) - fmt.Println("SHOULD HAVE FAILED!") - cleanup() - os.Exit(1) - } - } - - func main() { -+ flag.Parse() -+ - // helloworld.go is package main -- run("go tool compile -o linkmain.o helloworld.go") -- run("go tool compile -pack -o linkmain.a helloworld.go") -- run("go tool link -o linkmain.exe linkmain.o") -- run("go tool link -o linkmain.exe linkmain.a") -+ run(goCmd() + " tool compile -o linkmain.o helloworld.go") -+ run(goCmd() + " tool compile -pack -o linkmain.a helloworld.go") -+ run(goCmd() + " tool link -o linkmain.exe linkmain.o") -+ run(goCmd() + " tool link -o linkmain.exe linkmain.a") - - // linkmain.go is not -- run("go tool compile -o linkmain1.o linkmain.go") -- run("go tool compile -pack -o linkmain1.a linkmain.go") -- runFail("go tool link -o linkmain.exe linkmain1.o") -- runFail("go tool link -o linkmain.exe linkmain1.a") -+ run(goCmd() + " tool compile -o linkmain1.o linkmain.go") -+ run(goCmd() + " tool compile -pack -o linkmain1.a linkmain.go") -+ runFail(goCmd() + " tool link -o linkmain.exe linkmain1.o") -+ runFail(goCmd() + " tool link -o linkmain.exe linkmain1.a") - cleanup() - } ---- test/linkobj.go -+++ test/linkobj.go -@@ -1,31 +1,50 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2016 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. - - // Test the compiler -linkobj flag. - - package main - - import ( -+ "flag" - "fmt" - "io/ioutil" - "log" - "os" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(cmd ...string) string { -+ if *target == "" { -+ return run(cmd...) -+ } else { -+ return run(append([]string{"go_"+*target+"_exec"}, cmd...)...) -+ } -+} -+ - var pwd, tmpdir string - - func main() { -+ flag.Parse() - dir, err := ioutil.TempDir("", "go-test-linkobj-") - if err != nil { - log.Fatal(err) - } - pwd, err = os.Getwd() - if err != nil { - log.Fatal(err) - } -@@ -71,33 +90,33 @@ func main() { - - // The compiler expects the files being read to have the right suffix. - o := "o" - if round == 1 { - o = "a" - } - - // inlining is disabled to make sure that the link objects contain needed code. -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p1."+o, "-linkobj", "p1.lo", "p1.go") -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p2."+o, "-linkobj", "p2.lo", "p2.go") -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p3."+o, "-linkobj", "p3.lo", "p3.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p1."+o, "-linkobj", "p1.lo", "p1.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p2."+o, "-linkobj", "p2.lo", "p2.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p3."+o, "-linkobj", "p3.lo", "p3.go") - - cp("p1."+o, "p1.oo") - cp("p2."+o, "p2.oo") - cp("p3."+o, "p3.oo") - cp("p1.lo", "p1."+o) - cp("p2.lo", "p2."+o) - cp("p3.lo", "p3."+o) -- out := runFail("go", "tool", "link", "p2."+o) -+ out := runFail(goCmd(), "tool", "link", "p2."+o) - if !strings.Contains(out, "not package main") { - fatalf("link p2.o failed but not for package main:\n%s", out) - } - -- run("go", "tool", "link", "-L", ".", "-o", "a.out.exe", "p3."+o) -- out = run("./a.out.exe") -+ run(goCmd(), "tool", "link", "-L", ".", "-o", "a.out.exe", "p3."+o) -+ out = goRun("./a.out.exe") - if !strings.Contains(out, "hello from p1\nhello from p2\nhello from main\n") { - fatalf("running main, incorrect output:\n%s", out) - } - - // ensure that mistaken future round can't use these - os.Remove("p1.o") - os.Remove("a.out.exe") - } ---- test/linkx_run.go -+++ test/linkx_run.go -@@ -1,35 +1,55 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 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. - - // Run the linkx test. - - package main - - import ( - "bytes" -+ "flag" - "fmt" - "os" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -+ flag.Parse() - // test(" ") // old deprecated & removed syntax - test("=") // new syntax - } - - func test(sep string) { - // Successful run -- cmd := exec.Command("go", "run", "-ldflags=-X main.tbd"+sep+"hello -X main.overwrite"+sep+"trumped -X main.nosuchsymbol"+sep+"neverseen", "linkx.go") -+ cmd := goRun("-ldflags=-X main.tbd"+sep+"hello -X main.overwrite"+sep+"trumped -X main.nosuchsymbol"+sep+"neverseen", "linkx.go") - var out, errbuf bytes.Buffer - cmd.Stdout = &out - cmd.Stderr = &errbuf - err := cmd.Run() - if err != nil { - fmt.Println(errbuf.String()) - fmt.Println(out.String()) - fmt.Println(err) -@@ -39,25 +59,25 @@ func test(sep string) { - want := "hello\ntrumped\n" - got := out.String() - if got != want { - fmt.Printf("got %q want %q\n", got, want) - os.Exit(1) - } - - // Issue 8810 -- cmd = exec.Command("go", "run", "-ldflags=-X main.tbd", "linkx.go") -+ cmd = goRun("-ldflags=-X main.tbd", "linkx.go") - _, err = cmd.CombinedOutput() - if err == nil { - fmt.Println("-X linker flag should not accept keys without values") - os.Exit(1) - } - - // Issue 9621 -- cmd = exec.Command("go", "run", "-ldflags=-X main.b=false -X main.x=42", "linkx.go") -+ cmd = goRun("-ldflags=-X main.b=false -X main.x=42", "linkx.go") - outx, err := cmd.CombinedOutput() - if err == nil { - fmt.Println("-X linker flag should not overwrite non-strings") - os.Exit(1) - } - outstr := string(outx) - if !strings.Contains(outstr, "main.b") { - fmt.Printf("-X linker flag did not diagnose overwrite of main.b:\n%s\n", outstr) ---- test/nosplit.go -+++ test/nosplit.go -@@ -1,31 +1,49 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - - package main - - import ( - "bytes" -+ "flag" - "fmt" - "io/ioutil" - "log" - "os" - "os/exec" - "path/filepath" - "regexp" -- "runtime" - "strconv" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goArch() string { -+ goarch, err := exec.Command(goCmd(), "env", "GOARCH").Output() -+ if err != nil { -+ bug() -+ fmt.Printf("running go env GOARCH: %v\n", err) -+ } -+ return strings.TrimSpace(string(goarch)) -+} -+ - var tests = ` - # These are test cases for the linker analysis that detects chains of - # nosplit functions that would cause a stack overflow. - # - # Lines beginning with # are comments. - # - # Each test case describes a sequence of functions, one per line. - # Each function definition is the function name, then the frame size, -@@ -189,22 +207,23 @@ var ( - commentRE = regexp.MustCompile(`(?m)^#.*`) - rejectRE = regexp.MustCompile(`(?s)\A(.+?)((\n|; *)REJECT(.*))?\z`) - lineRE = regexp.MustCompile(`(\w+) (\d+)( nosplit)?(.*)`) - callRE = regexp.MustCompile(`\bcall (\w+)\b`) - callindRE = regexp.MustCompile(`\bcallind\b`) - ) - - func main() { -- goarch := os.Getenv("GOARCH") -+ flag.Parse() -+ goarch := goArch() - if goarch == "" { -- goarch = runtime.GOARCH -+ return - } - -- version, err := exec.Command("go", "tool", "compile", "-V").Output() -+ version, err := exec.Command(goCmd(), "tool", "compile", "-V").Output() - if err != nil { - bug() - fmt.Printf("running go tool compile -V: %v\n", err) - return - } - if s := string(version); goarch == "amd64" && strings.Contains(s, "X:") && !strings.Contains(s, "framepointer") { - // Skip this test if framepointer is NOT enabled on AMD64 - return -@@ -340,17 +359,17 @@ TestCases: - - if err := ioutil.WriteFile(filepath.Join(dir, "asm.s"), buf.Bytes(), 0666); err != nil { - log.Fatal(err) - } - if err := ioutil.WriteFile(filepath.Join(dir, "main.go"), gobuf.Bytes(), 0666); err != nil { - log.Fatal(err) - } - -- cmd := exec.Command("go", "build") -+ cmd := exec.Command(goCmd(), "build") - cmd.Dir = dir - output, err := cmd.CombinedOutput() - if err == nil { - nok++ - if reject { - bug() - fmt.Printf("accepted incorrectly:\n\t%s\n", indent(strings.TrimSpace(stanza))) - } ---- test/run.go -+++ test/run.go -@@ -222,16 +222,26 @@ func goRun(runcmd runCmd, flags []string, goname string, args ...string) (out [] - cmd = append(cmd, findExecCmd()...) - } - cmd = append(cmd, flags...) - cmd = append(cmd, goname) - cmd = append(cmd, args...) - return runcmd(cmd...) - } - -+func goRunTarget(runcmd runCmd, goname string, args ...string) (out []byte, err error) { -+ cmd := []string{"go_local", "run"} -+ cmd = append(cmd, goname) -+ if *target != "" { -+ cmd = append(cmd, "-target", *target) -+ } -+ cmd = append(cmd, args...) -+ return runcmd(cmd...) -+} -+ - // skipError describes why a test was skipped. - type skipError string - - func (s skipError) Error() string { return string(s) } - - func check(err error) { - if err != nil { - log.Fatal(err) -@@ -484,17 +494,17 @@ func (t *test) run() { - } - - // TODO: Clean up/simplify this switch statement. - switch action { - case "rundircmpout": - action = "rundir" - case "cmpout": - action = "run" // the run case already looks for <dir>/<test>.out files -- case "compile", "compiledir", "build", "builddir", "run", "buildrun", "runoutput", "rundir": -+ case "compile", "compiledir", "build", "builddir", "run", "runtarget", "buildrun", "runoutput", "rundir": - // nothing to do - case "errorcheckandrundir": - wantError = false // should be no error if also will run - case "errorcheckwithauto": - action = "errorcheck" - wantAuto = true - wantError = true - case "errorcheck", "errorcheckdir", "errorcheckoutput": -@@ -807,16 +817,27 @@ func (t *test) run() { - if err != nil { - t.err = err - return - } - if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { - t.err = fmt.Errorf("incorrect output\n%s", out) - } - -+ case "runtarget": -+ useTmp = false -+ out, err := goRunTarget(runcmd, t.goFileName(), args...) -+ if err != nil { -+ t.err = err -+ return -+ } -+ if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { -+ t.err = fmt.Errorf("incorrect output\n%s", out) -+ } -+ - case "runoutput": - rungatec <- true - defer func() { - <-rungatec - }() - useTmp = false - out, err := goRun(runcmd, nil, t.goFileName(), args...) - if err != nil { ---- test/sinit_run.go -+++ test/sinit_run.go -@@ -1,28 +1,39 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 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. - - // Run the sinit test. - - package main - - import ( - "bytes" -+ "flag" - "fmt" - "os" - "os/exec" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -- cmd := exec.Command("go", "tool", "compile", "-S", "sinit.go") -+ flag.Parse() -+ cmd := exec.Command(goCmd(), "tool", "compile", "-S", "sinit.go") - out, err := cmd.CombinedOutput() - if err != nil { - fmt.Println(string(out)) - fmt.Println(err) - os.Exit(1) - } - os.Remove("sinit.o") - diff --git a/go/patch/go-1.10.2/go4.patch b/go/patch/go-1.10.2/go4.patch deleted file mode 100644 index 290de390..00000000 --- a/go/patch/go-1.10.2/go4.patch +++ /dev/null @@ -1,199 +0,0 @@ -runtime, crypto/x509: add -target flag. - ---- src/crypto/x509/x509_test.go -+++ src/crypto/x509/x509_test.go -@@ -13,29 +13,32 @@ import ( - "crypto/rsa" - _ "crypto/sha256" - _ "crypto/sha512" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/base64" - "encoding/hex" - "encoding/pem" -+ "flag" - "fmt" - "internal/testenv" - "math/big" - "net" - "net/url" - "os/exec" - "reflect" - "runtime" - "strings" - "testing" - "time" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ - func TestParsePKCS1PrivateKey(t *testing.T) { - block, _ := pem.Decode([]byte(pemPrivateKey)) - priv, err := ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - t.Errorf("Failed to parse private key: %s", err) - return - } - if priv.PublicKey.N.Cmp(rsaPrivateKey.PublicKey.N) != 0 || -@@ -1089,17 +1092,23 @@ func TestParsePEMCRL(t *testing.T) { - } - - // Can't check the signature here without a package cycle. - } - - func TestImports(t *testing.T) { - testenv.MustHaveGoRun(t) - -- if err := exec.Command(testenv.GoToolPath(t), "run", "x509_test_import.go").Run(); err != nil { -+ var cmd *exec.Cmd -+ if *target == "" { -+ cmd = exec.Command(testenv.GoToolPath(t), "run", "x509_test_import.go") -+ } else { -+ cmd = exec.Command("go_"+*target, "run", "-exec", "go_"+*target+"_exec", "x509_test_import.go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VXdNVFJhb0RBd0xqQWZCZ05WSFNNRUdEQVdnQlQxVERGNlVRTS9MTmVMDQpsNWx2cUhHUXEzZzltekFMQmdOVkhSUUVCQUlDQUlRd0RRWUpLb1pJaHZjTkFRRUZCUUFEZ1lFQUZVNUFzNk16DQpxNVBSc2lmYW9iUVBHaDFhSkx5QytNczVBZ2MwYld5QTNHQWR4dXI1U3BQWmVSV0NCamlQL01FSEJXSkNsQkhQDQpHUmNxNXlJZDNFakRrYUV5eFJhK2k2N0x6dmhJNmMyOUVlNks5cFNZd2ppLzdSVWhtbW5Qclh0VHhsTDBsckxyDQptUVFKNnhoRFJhNUczUUE0Q21VZHNITnZicnpnbUNZcHZWRT0NCi0tLS0tRU5EIFg1MDkgQ1JMLS0tLS0NCg0K" - ---- src/runtime/crash_cgo_test.go -+++ src/runtime/crash_cgo_test.go -@@ -279,17 +279,17 @@ func testCgoPprof(t *testing.T, buildArg, runArg string) { - } - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprogcgo", buildArg) - if err != nil { - t.Fatal(err) - } - -- got, err := testenv.CleanCmdEnv(exec.Command(exe, runArg)).CombinedOutput() -+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, runArg)).CombinedOutput() - if err != nil { - if testenv.Builder() == "linux-amd64-alpine" { - // See Issue 18243 and Issue 19938. - t.Skipf("Skipping failing test on Alpine (golang.org/issue/18243). Ignoring error: %v", err) - } - t.Fatal(err) - } - fn := strings.TrimSpace(string(got)) ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -17,16 +17,35 @@ import ( - "runtime" - "strconv" - "strings" - "sync" - "testing" - "time" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd(t *testing.T) string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return testenv.GoToolPath(t) -+} -+ -+func goExecCmd(name string, arg ...string) *exec.Cmd { -+ var cmd []string -+ if *target != "" { -+ cmd = append(cmd, "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, name) -+ cmd = append(cmd, arg...) -+ return exec.Command(cmd[0], cmd[1:]...) -+} -+ - var toRemove []string - - func TestMain(m *testing.M) { - status := m.Run() - for _, file := range toRemove { - os.RemoveAll(file) - } - os.Exit(status) -@@ -50,17 +69,17 @@ func runTestProg(t *testing.T, binary, name string, env ...string) string { - - testenv.MustHaveGoBuild(t) - - exe, err := buildTestProg(t, binary) - if err != nil { - t.Fatal(err) - } - -- cmd := testenv.CleanCmdEnv(exec.Command(exe, name)) -+ cmd := testenv.CleanCmdEnv(goExecCmd(exe, name)) - cmd.Env = append(cmd.Env, env...) - if testing.Short() { - cmd.Env = append(cmd.Env, "RUNTIME_TEST_SHORT=1") - } - var b bytes.Buffer - cmd.Stdout = &b - cmd.Stderr = &b - if err := cmd.Start(); err != nil { -@@ -125,17 +144,17 @@ func buildTestProg(t *testing.T, binary string, flags ...string) (string, error) - name += "_" + strings.Join(flags, "_") - } - target, ok := testprog.target[name] - if ok { - return target.exe, target.err - } - - exe := filepath.Join(testprog.dir, name+".exe") -- cmd := exec.Command(testenv.GoToolPath(t), append([]string{"build", "-o", exe}, flags...)...) -+ cmd := exec.Command(goCmd(t), append([]string{"build", "-o", exe}, flags...)...) - cmd.Dir = "testdata/" + binary - out, err := testenv.CleanCmdEnv(cmd).CombinedOutput() - if err != nil { - target.err = fmt.Errorf("building %s %v: %v\n%s", binary, flags, err, out) - testprog.target[name] = target - return "", target.err - } - target.exe = exe -@@ -456,17 +475,17 @@ func TestPanicLoop(t *testing.T) { - func TestMemPprof(t *testing.T) { - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } - -- got, err := testenv.CleanCmdEnv(exec.Command(exe, "MemProf")).CombinedOutput() -+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, "MemProf")).CombinedOutput() - if err != nil { - t.Fatal(err) - } - fn := strings.TrimSpace(string(got)) - defer os.Remove(fn) - - for try := 0; try < 2; try++ { - cmd := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "tool", "pprof", "-alloc_space", "-top")) ---- src/runtime/crash_unix_test.go -+++ src/runtime/crash_unix_test.go -@@ -244,17 +244,17 @@ func testPanicSystemstackInternal() { - } - - func TestSignalExitStatus(t *testing.T) { - testenv.MustHaveGoBuild(t) - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } -- err = testenv.CleanCmdEnv(exec.Command(exe, "SignalExitStatus")).Run() -+ err = testenv.CleanCmdEnv(goExecCmd(exe, "SignalExitStatus")).Run() - if err == nil { - t.Error("test program succeeded unexpectedly") - } else if ee, ok := err.(*exec.ExitError); !ok { - t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err) - } else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok { - t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys()) - } else if !ws.Signaled() || ws.Signal() != syscall.SIGTERM { - t.Errorf("got %v; expected SIGTERM", ee) diff --git a/go/patch/go-1.10.2/go5.patch b/go/patch/go-1.10.2/go5.patch deleted file mode 100644 index 7189c89e..00000000 --- a/go/patch/go-1.10.2/go5.patch +++ /dev/null @@ -1,160 +0,0 @@ -runtime: deadlock detection does not work when using external linker. - ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -214,32 +214,37 @@ func testDeadlock(t *testing.T, name string) { - output := runTestProg(t, "testprog", name) - want := "fatal error: all goroutines are asleep - deadlock!\n" - if !strings.HasPrefix(output, want) { - t.Fatalf("output does not start with %q:\n%s", want, output) - } - } - - func TestSimpleDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "SimpleDeadlock") - } - - func TestInitDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "InitDeadlock") - } - - func TestLockedDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "LockedDeadlock") - } - - func TestLockedDeadlock2(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "LockedDeadlock2") - } - - func TestGoexitDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "GoexitDeadlock") - want := "no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.Contains(output, want) { - t.Fatalf("output:\n%s\n\nwant output containing: %s", output, want) - } - } - - func TestStackOverflow(t *testing.T) { -@@ -266,16 +271,17 @@ panic: again - ` - if !strings.HasPrefix(output, want) { - t.Fatalf("output does not start with %q:\n%s", want, output) - } - - } - - func TestGoexitCrash(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "GoexitExit") - want := "no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.Contains(output, want) { - t.Fatalf("output:\n%s\n\nwant output containing: %s", output, want) - } - } - - func TestGoexitDefer(t *testing.T) { -@@ -324,16 +330,17 @@ func TestBreakpoint(t *testing.T) { - // "runtime.Breakpoint(...)" instead of "runtime.Breakpoint()". - want := "runtime.Breakpoint(" - if !strings.Contains(output, want) { - t.Fatalf("output:\n%s\n\nwant output containing: %s", output, want) - } - } - - func TestGoexitInPanic(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - // see issue 8774: this code used to trigger an infinite recursion - output := runTestProg(t, "testprog", "GoexitInPanic") - want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.HasPrefix(output, want) { - t.Fatalf("output does not start with %q:\n%s", want, output) - } - } - -@@ -388,16 +395,17 @@ func TestPanicAfterGoexit(t *testing.T) { - output := runTestProg(t, "testprog", "PanicAfterGoexit") - want := "panic: hello" - if !strings.HasPrefix(output, want) { - t.Fatalf("output does not start with %q:\n%s", want, output) - } - } - - func TestRecoveredPanicAfterGoexit(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "RecoveredPanicAfterGoexit") - want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.HasPrefix(output, want) { - t.Fatalf("output does not start with %q:\n%s", want, output) - } - } - - func TestRecoverBeforePanicAfterGoexit(t *testing.T) { ---- src/runtime/proc_test.go -+++ src/runtime/proc_test.go -@@ -349,19 +349,20 @@ func TestGCFairness2(t *testing.T) { - want := "OK\n" - if output != want { - t.Fatalf("want %s, got %s\n", want, output) - } - } - - func TestNumGoroutine(t *testing.T) { - output := runTestProg(t, "testprog", "NumGoroutine") -- want := "1\n" -- if output != want { -- t.Fatalf("want %q, got %q", want, output) -+ want1 := "1\n" -+ want2 := "2\n" -+ if output != want1 && output != want2 { -+ t.Fatalf("want %q, got %q", want1, output) - } - - buf := make([]byte, 1<<20) - - // Try up to 10 times for a match before giving up. - // This is a fundamentally racy check but it's important - // to notice if NumGoroutine and Stack are _always_ out of sync. - for i := 0; ; i++ { ---- test/fixedbugs/bug429_run.go -+++ test/fixedbugs/bug429_run.go -@@ -1,10 +1,10 @@ - // +build !nacl --// runtarget -+// skip - - // Copyright 2014 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. - - // Run the bug429.go test. - - package main ---- test/goprint.go -+++ test/goprint.go -@@ -3,19 +3,14 @@ - // Copyright 2011 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. - - // Test that println can be the target of a go statement. - - package main - --import ( -- "runtime" -- "time" --) -+import "time" - - func main() { - go println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255)) -- for runtime.NumGoroutine() > 1 { -- time.Sleep(10*time.Millisecond) -- } -+ time.Sleep(100*time.Millisecond) - } diff --git a/go/patch/go-1.10.2/go6.patch b/go/patch/go-1.10.2/go6.patch deleted file mode 100644 index 9f32ed84..00000000 --- a/go/patch/go-1.10.2/go6.patch +++ /dev/null @@ -1,230 +0,0 @@ -all: disable some tests that have trouble running remotely. - ---- src/encoding/gob/encoder_test.go -+++ src/encoding/gob/encoder_test.go -@@ -1125,20 +1125,17 @@ func TestBadData(t *testing.T) { - if !strings.Contains(err.Error(), test.error) { - t.Errorf("#%d: decode: expected %q error, got %s", i, test.error, err.Error()) - } - } - } - - // TestHugeWriteFails tests that enormous messages trigger an error. - func TestHugeWriteFails(t *testing.T) { -- if testing.Short() { -- // Requires allocating a monster, so don't do this from all.bash. -- t.Skip("skipping huge allocation in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - huge := make([]byte, tooBig) - huge[0] = 7 // Make sure it's not all zeros. - buf := new(bytes.Buffer) - err := NewEncoder(buf).Encode(huge) - if err == nil { - t.Fatalf("expected error for huge slice") - } - if !strings.Contains(err.Error(), "message too big") { ---- src/runtime/crash_cgo_test.go -+++ src/runtime/crash_cgo_test.go -@@ -246,20 +246,17 @@ func TestCgoCCodeSIGPROF(t *testing.T) { - got := runTestProg(t, "testprogcgo", "CgoCCodeSIGPROF") - want := "OK\n" - if got != want { - t.Errorf("expected %q got %v", want, got) - } - } - - func TestCgoCrashTraceback(t *testing.T) { -- t.Parallel() -- if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") { -- t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) -- } -+ t.Skipf("skip running remotely") - got := runTestProg(t, "testprogcgo", "CrashTraceback") - for i := 1; i <= 3; i++ { - if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) { - t.Errorf("missing cgo symbolizer:%d", i) - } - } - } - -@@ -268,20 +265,17 @@ func TestCgoTracebackContext(t *testing.T) { - got := runTestProg(t, "testprogcgo", "TracebackContext") - want := "OK\n" - if got != want { - t.Errorf("expected %q got %v", want, got) - } - } - - func testCgoPprof(t *testing.T, buildArg, runArg string) { -- t.Parallel() -- if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") { -- t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) -- } -+ t.Skipf("skip pprof test") - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprogcgo", buildArg) - if err != nil { - t.Fatal(err) - } - - got, err := testenv.CleanCmdEnv(goExecCmd(exe, runArg)).CombinedOutput() ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -476,16 +476,17 @@ func TestPanicDeadlockSyscall(t *testing.T) { - func TestPanicLoop(t *testing.T) { - output := runTestProg(t, "testprog", "PanicLoop") - if want := "panic while printing panic value"; !strings.Contains(output, want) { - t.Errorf("output does not contain %q:\n%s", want, output) - } - } - - func TestMemPprof(t *testing.T) { -+ t.Skipf("skip pprof test") - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } - - got, err := testenv.CleanCmdEnv(goExecCmd(exe, "MemProf")).CombinedOutput() ---- src/runtime/crash_unix_test.go -+++ src/runtime/crash_unix_test.go -@@ -169,19 +169,17 @@ func loop(i int, c chan bool) { - - func TestPanicSystemstack(t *testing.T) { - // Test that GOTRACEBACK=crash prints both the system and user - // stack of other threads. - - // The GOTRACEBACK=crash handler takes 0.1 seconds even if - // it's not writing a core file and potentially much longer if - // it is. Skip in short mode. -- if testing.Short() { -- t.Skip("Skipping in short mode (GOTRACEBACK=crash is slow)") -- } -+ t.Skip("Skipping (GOTRACEBACK=crash hangs on arm)") - - if runtime.Sigisblocked(int(syscall.SIGQUIT)) { - t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196") - } - - t.Parallel() - cmd := exec.Command(os.Args[0], "testPanicSystemstackInternal") - cmd = testenv.CleanCmdEnv(cmd) -@@ -239,16 +237,17 @@ func init() { - } - - func testPanicSystemstackInternal() { - runtime.BlockOnSystemStack() - os.Exit(1) // Should be unreachable. - } - - func TestSignalExitStatus(t *testing.T) { -+ t.Skipf("skip running remotely") - testenv.MustHaveGoBuild(t) - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } - err = testenv.CleanCmdEnv(goExecCmd(exe, "SignalExitStatus")).Run() - if err == nil { - t.Error("test program succeeded unexpectedly") ---- src/runtime/fastlog2_test.go -+++ src/runtime/fastlog2_test.go -@@ -11,21 +11,17 @@ import ( - ) - - func TestFastLog2(t *testing.T) { - // Compute the euclidean distance between math.Log2 and the FastLog2 - // implementation over the range of interest for heap sampling. - const randomBitCount = 26 - var e float64 - -- inc := 1 -- if testing.Short() { -- // Check 1K total values, down from 64M. -- inc = 1 << 16 -- } -+ inc := 1 << 16 - for i := 1; i < 1<<randomBitCount; i += inc { - l, fl := math.Log2(float64(i)), runtime.Fastlog2(float64(i)) - d := l - fl - e += d * d - } - e = math.Sqrt(e) - - if e > 1.0 { ---- src/runtime/hash_test.go -+++ src/runtime/hash_test.go -@@ -156,19 +156,17 @@ func TestSmhasherZeros(t *testing.T) { - for i := 0; i <= N; i++ { - h.addB(b[:i]) - } - h.check(t) - } - - // Strings with up to two nonzero bytes all have distinct hashes. - func TestSmhasherTwoNonzero(t *testing.T) { -- if testing.Short() { -- t.Skip("Skipping in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - h := newHashSet() - for n := 2; n <= 16; n++ { - twoNonZero(h, n) - } - h.check(t) - } - func twoNonZero(h *HashSet, n int) { - b := make([]byte, n) -@@ -259,19 +257,17 @@ func setbits(h *HashSet, b []byte, i int, k int) { - setbits(h, b, j+1, k-1) - b[j/8] &= byte(^(1 << uint(j&7))) - } - } - - // Test all possible combinations of n blocks from the set s. - // "permutation" is a bad name here, but it is what Smhasher uses. - func TestSmhasherPermutation(t *testing.T) { -- if testing.Short() { -- t.Skip("Skipping in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - permutation(t, []uint32{0, 1, 2, 3, 4, 5, 6, 7}, 8) - permutation(t, []uint32{0, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}, 8) - permutation(t, []uint32{0, 1}, 20) - permutation(t, []uint32{0, 1 << 31}, 20) - permutation(t, []uint32{0, 1, 2, 3, 4, 5, 6, 7, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}, 6) - } - func permutation(t *testing.T, s []uint32, n int) { - b := make([]byte, n*4) ---- src/runtime/pprof/pprof_test.go -+++ src/runtime/pprof/pprof_test.go -@@ -278,24 +278,17 @@ func profileOk(t *testing.T, need []string, prof bytes.Buffer, duration time.Dur - return ok - } - - // Fork can hang if preempted with signals frequently enough (see issue 5517). - // Ensure that we do not do this. - func TestCPUProfileWithFork(t *testing.T) { - testenv.MustHaveExec(t) - -- heap := 1 << 30 -- if runtime.GOOS == "android" { -- // Use smaller size for Android to avoid crash. -- heap = 100 << 20 -- } -- if testing.Short() { -- heap = 100 << 20 -- } -+ heap := 100 << 20 - // This makes fork slower. - garbage := make([]byte, heap) - // Need to touch the slice, otherwise it won't be paged in. - done := make(chan bool) - go func() { - for i := range garbage { - garbage[i] = 42 - } diff --git a/go/patch/go-1.10.3/go0.patch b/go/patch/go-1.10.3/go0.patch deleted file mode 100644 index f80045c0..00000000 --- a/go/patch/go-1.10.3/go0.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git src/go/build/deps_test.go src/go/build/deps_test.go -index 29dbe47d29..53e0e287bc 100644 ---- src/go/build/deps_test.go -+++ src/go/build/deps_test.go -@@ -191,7 +191,7 @@ var pkgDeps = map[string][]string{ - "testing": {"L2", "flag", "fmt", "internal/race", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"}, - "testing/iotest": {"L2", "log"}, - "testing/quick": {"L2", "flag", "fmt", "reflect", "time"}, -- "internal/testenv": {"L2", "OS", "flag", "testing", "syscall"}, -+ "internal/testenv": {"L2", "OS", "os.exec", "flag", "testing", "syscall"}, - - // L4 is defined as L3+fmt+log+time, because in general once - // you're using L3 packages, use of fmt, log, or time is not a big deal. -diff --git src/internal/testenv/testenv.go src/internal/testenv/testenv.go -index 8f69fe0da5..d52b85e122 100644 ---- src/internal/testenv/testenv.go -+++ src/internal/testenv/testenv.go -@@ -48,6 +48,9 @@ func HasGoBuild() bool { - return false - } - } -+ if _, err := exec.LookPath("go"); err != nil { -+ return false -+ } - return true - } - diff --git a/go/patch/go-1.10.3/go1.patch b/go/patch/go-1.10.3/go1.patch deleted file mode 100644 index e05fcce4..00000000 --- a/go/patch/go-1.10.3/go1.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git test/chanlinear.go test/chanlinear.go -index 55fee4ab9b..89533da282 100644 ---- test/chanlinear.go -+++ test/chanlinear.go -@@ -1,4 +1,4 @@ --// +build darwin linux -+// +build darwin linux android - // run - - // Copyright 2014 The Go Authors. All rights reserved. -diff --git a/test/fixedbugs/bug385_64.go b/test/fixedbugs/bug385_64.go -index 0f941ca2f4..3bcd62f3ad 100644 ---- test/fixedbugs/bug385_64.go -+++ test/fixedbugs/bug385_64.go -@@ -1,4 +1,4 @@ --// +build amd64 -+// +build amd64 arm64 - // errorcheck - - // Copyright 2011 The Go Authors. All rights reserved. -diff --git test/fixedbugs/issue10607.go test/fixedbugs/issue10607.go -index 8831547da8..9ee6c72bc6 100644 ---- test/fixedbugs/issue10607.go -+++ test/fixedbugs/issue10607.go -@@ -1,4 +1,4 @@ --// +build linux,!ppc64 -+// +build linux,!ppc64 android - // run - - // Copyright 2015 The Go Authors. All rights reserved. -diff --git test/maplinear.go test/maplinear.go -index 34d0914914..afddab627d 100644 ---- test/maplinear.go -+++ test/maplinear.go -@@ -1,4 +1,4 @@ --// +build darwin linux -+// +build darwin linux android - // run - - // Copyright 2013 The Go Authors. All rights reserved. -diff --git test/recover4.go test/recover4.go -index 67ed970ecb..95a89dab00 100644 ---- test/recover4.go -+++ test/recover4.go -@@ -1,4 +1,4 @@ --// +build linux darwin -+// +build linux android darwin - // run - - // Copyright 2015 The Go Authors. All rights reserved. diff --git a/go/patch/go-1.10.3/go2.patch b/go/patch/go-1.10.3/go2.patch deleted file mode 100644 index bbd2b744..00000000 --- a/go/patch/go-1.10.3/go2.patch +++ /dev/null @@ -1,267 +0,0 @@ -diff --git test/run.go test/run.go -index 22ec7576f8..ac5d3c3e8d 100644 ---- test/run.go -+++ test/run.go -@@ -39,9 +39,9 @@ var ( - summary = flag.Bool("summary", false, "show summary of results") - showSkips = flag.Bool("show_skips", false, "show skipped tests") - runSkips = flag.Bool("run_skips", false, "run skipped tests (ignore skip and build tags)") -- linkshared = flag.Bool("linkshared", false, "") - updateErrors = flag.Bool("update_errors", false, "update error messages in test file based on compiler output") - runoutputLimit = flag.Int("l", defaultRunOutputLimit(), "number of parallel runoutput tests to run") -+ target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") - - shard = flag.Int("shard", 0, "shard index to run. Only applicable if -shards is non-zero.") - shards = flag.Int("shards", 0, "number of shards. If 0, all tests are run. This is used by the continuous build.") -@@ -194,21 +194,15 @@ func goFiles(dir string) []string { - type runCmd func(...string) ([]byte, error) - - func compileFile(runcmd runCmd, longname string, flags []string) (out []byte, err error) { -- cmd := []string{"go", "tool", "compile", "-e"} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e"} - cmd = append(cmd, flags...) -- if *linkshared { -- cmd = append(cmd, "-dynlink", "-installsuffix=dynlink") -- } - cmd = append(cmd, longname) - return runcmd(cmd...) - } - - func compileInDir(runcmd runCmd, dir string, flags []string, names ...string) (out []byte, err error) { -- cmd := []string{"go", "tool", "compile", "-e", "-D", ".", "-I", "."} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e", "-D", ".", "-I", "."} - cmd = append(cmd, flags...) -- if *linkshared { -- cmd = append(cmd, "-dynlink", "-installsuffix=dynlink") -- } - for _, name := range names { - cmd = append(cmd, filepath.Join(dir, name)) - } -@@ -217,15 +211,24 @@ func compileInDir(runcmd runCmd, dir string, flags []string, names ...string) (o - - func linkFile(runcmd runCmd, goname string) (err error) { - pfile := strings.Replace(goname, ".go", ".o", -1) -- cmd := []string{"go", "tool", "link", "-w", "-o", "a.exe", "-L", "."} -- if *linkshared { -- cmd = append(cmd, "-linkshared", "-installsuffix=dynlink") -- } -- cmd = append(cmd, pfile) -- _, err = runcmd(cmd...) -+ cmd := []string{findGoCmd, "tool", "link", "-w", "-o", "a.exe", "-L", "."} -+ _, err = runcmd(findGoCmd(), "tool", "link", "-w", "-o", "a.exe", "-L", ".", pfile) - return - } - -+ -+func goRun(runcmd runCmd, flags []string, goname string, args ...string) (out []byte, err error) { -+ cmd := []string{findGoCmd(), "run", goGcflags()} -+ if len(findExecCmd()) > 0 { -+ cmd = append(cmd, "-exec") -+ cmd = append(cmd, findExecCmd()...) -+ } -+ cmd = append(cmd, flags...) -+ cmd = append(cmd, goname) -+ cmd = append(cmd, args...) -+ return runcmd(cmd...) -+} -+ - // skipError describes why a test was skipped. - type skipError string - -@@ -595,7 +598,7 @@ func (t *test) run() { - - case "errorcheck": - // TODO(gri) remove need for -C (disable printing of columns in error messages) -- cmdline := []string{"go", "tool", "compile", "-C", "-e", "-o", "a.o"} -+ cmdline := []string{findGoCmd(), "tool", "compile", "-C", "-e", "-o", "a.o"} - // No need to add -dynlink even if linkshared if we're just checking for errors... - cmdline = append(cmdline, flags...) - cmdline = append(cmdline, long) -@@ -709,7 +712,7 @@ func (t *test) run() { - } - - case "build": -- _, err := runcmd("go", "build", goGcflags(), "-o", "a.exe", long) -+ _, err := runcmd(findGoCmd(), "build", goGcflags(), "-o", "a.exe", long) - if err != nil { - t.err = err - } -@@ -735,7 +738,7 @@ func (t *test) run() { - - } - var objs []string -- cmd := []string{"go", "tool", "compile", "-e", "-D", ".", "-I", ".", "-o", "go.o"} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e", "-D", ".", "-I", ".", "-o", "go.o"} - if len(asms) > 0 { - cmd = append(cmd, "-asmhdr", "go_asm.h") - } -@@ -749,7 +752,7 @@ func (t *test) run() { - } - objs = append(objs, "go.o") - if len(asms) > 0 { -- cmd = []string{"go", "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} -+ cmd = []string{findGoCmd(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} - for _, file := range asms { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } -@@ -760,14 +763,14 @@ func (t *test) run() { - } - objs = append(objs, "asm.o") - } -- cmd = []string{"go", "tool", "pack", "c", "all.a"} -+ cmd = []string{findGoCmd(), "tool", "pack", "c", "all.a"} - cmd = append(cmd, objs...) - _, err = runcmd(cmd...) - if err != nil { - t.err = err - break - } -- cmd = []string{"go", "tool", "link", "all.a"} -+ cmd = []string{findGoCmd(), "tool", "link", "-o", "a.exe", "all.a"} - _, err = runcmd(cmd...) - if err != nil { - t.err = err -@@ -777,10 +780,7 @@ func (t *test) run() { - case "buildrun": // build binary, then run binary, instead of go run. Useful for timeout tests where failure mode is infinite loop. - // TODO: not supported on NaCl - useTmp = true -- cmd := []string{"go", "build", goGcflags(), "-o", "a.exe"} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -+ cmd := []string{findGoCmd(), "build", goGcflags(), "-o", "a.exe"} - longdirgofile := filepath.Join(filepath.Join(cwd, t.dir), t.gofile) - cmd = append(cmd, flags...) - cmd = append(cmd, longdirgofile) -@@ -789,7 +789,12 @@ func (t *test) run() { - t.err = err - return - } -- cmd = []string{"./a.exe"} -+ cmd = []string{} -+ if len(findExecCmd()) > 0 { -+ cmd = append(cmd, findExecCmd()...) -+ } -+ cmd = append(cmd, "./a.exe") -+ - out, err = runcmd(append(cmd, args...)...) - if err != nil { - t.err = err -@@ -802,38 +807,7 @@ func (t *test) run() { - - case "run": - useTmp = false -- var out []byte -- var err error -- if len(flags)+len(args) == 0 && goGcflags() == "" && !*linkshared { -- // If we're not using special go command flags, -- // skip all the go command machinery. -- // This avoids any time the go command would -- // spend checking whether, for example, the installed -- // package runtime is up to date. -- // Because we run lots of trivial test programs, -- // the time adds up. -- pkg := filepath.Join(t.tempDir, "pkg.a") -- if _, err := runcmd("go", "tool", "compile", "-o", pkg, t.goFileName()); err != nil { -- t.err = err -- return -- } -- exe := filepath.Join(t.tempDir, "test.exe") -- cmd := []string{"go", "tool", "link", "-s", "-w"} -- cmd = append(cmd, "-o", exe, pkg) -- if _, err := runcmd(cmd...); err != nil { -- t.err = err -- return -- } -- out, err = runcmd(append([]string{exe}, args...)...) -- } else { -- cmd := []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, flags...) -- cmd = append(cmd, t.goFileName()) -- out, err = runcmd(append(cmd, args...)...) -- } -+ out, err := goRun(runcmd, flags, t.goFileName(), args...) - if err != nil { - t.err = err - return -@@ -848,12 +822,7 @@ func (t *test) run() { - <-rungatec - }() - useTmp = false -- cmd := []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, t.goFileName()) -- out, err := runcmd(append(cmd, args...)...) -+ out, err := goRun(runcmd, nil, t.goFileName(), args...) - if err != nil { - t.err = err - return -@@ -863,12 +832,7 @@ func (t *test) run() { - t.err = fmt.Errorf("write tempfile:%s", err) - return - } -- cmd = []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, tfile) -- out, err = runcmd(cmd...) -+ out, err = goRun(runcmd, nil, tfile) - if err != nil { - t.err = err - return -@@ -879,12 +843,7 @@ func (t *test) run() { - - case "errorcheckoutput": - useTmp = false -- cmd := []string{"go", "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, t.goFileName()) -- out, err := runcmd(append(cmd, args...)...) -+ out, err := goRun(runcmd, nil, t.goFileName(), args...) - if err != nil { - t.err = err - return -@@ -895,7 +854,7 @@ func (t *test) run() { - t.err = fmt.Errorf("write tempfile:%s", err) - return - } -- cmdline := []string{"go", "tool", "compile", "-e", "-o", "a.o"} -+ cmdline := []string{findGoCmd(), "tool", "compile", "-e", "-o", "a.o"} - cmdline = append(cmdline, flags...) - cmdline = append(cmdline, tfile) - out, err = runcmd(cmdline...) -@@ -922,6 +881,11 @@ func findExecCmd() []string { - return execCmd - } - execCmd = []string{} // avoid work the second time -+ if *target != "" { -+ execCmd = []string{"go_" + *target + "_exec"} -+ return execCmd -+ } -+ - if goos == runtime.GOOS && goarch == runtime.GOARCH { - return execCmd - } -@@ -932,6 +896,14 @@ func findExecCmd() []string { - return execCmd - } - -+func findGoCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+ - func (t *test) String() string { - return filepath.Join(t.dir, t.gofile) - } diff --git a/go/patch/go-1.10.3/go3.patch b/go/patch/go-1.10.3/go3.patch deleted file mode 100644 index 223ccb85..00000000 --- a/go/patch/go-1.10.3/go3.patch +++ /dev/null @@ -1,732 +0,0 @@ -diff --git test/fixedbugs/bug302.go test/fixedbugs/bug302.go -index e4de25d5d0..ea566e6e44 100644 ---- test/fixedbugs/bug302.go -+++ test/fixedbugs/bug302.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -8,16 +8,27 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -- run("go", "tool", "compile", filepath.Join("fixedbugs", "bug302.dir", "p.go")) -- run("go", "tool", "pack", "grc", "pp.a", "p.o") -- run("go", "tool", "compile", "-I", ".", filepath.Join("fixedbugs", "bug302.dir", "main.go")) -+ flag.Parse() -+ run(goCmd(), "tool", "compile", filepath.Join("fixedbugs", "bug302.dir", "p.go")) -+ run(goCmd(), "tool", "pack", "grc", "pp.a", "p.o") -+ run(goCmd(), "tool", "compile", "-I", ".", filepath.Join("fixedbugs", "bug302.dir", "main.go")) - os.Remove("p.o") - os.Remove("pp.a") - os.Remove("main.o") -diff --git test/fixedbugs/bug369.go test/fixedbugs/bug369.go -index 60162ab1cb..4470d5a076 100644 ---- test/fixedbugs/bug369.go -+++ test/fixedbugs/bug369.go -@@ -1,5 +1,5 @@ - // +build !nacl,!windows --// run -+// runtarget - - // Copyright 2011 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,21 +10,40 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(cmd ...string) { -+ if *target == "" { -+ run(cmd[0], cmd[1:]...) -+ } else { -+ run("go_"+*target+"_exec", cmd...) -+ } -+} -+ - func main() { -+ flag.Parse() - err := os.Chdir(filepath.Join(".", "fixedbugs", "bug369.dir")) - check(err) - -- run("go", "tool", "compile", "-N", "-o", "slow.o", "pkg.go") -- run("go", "tool", "compile", "-o", "fast.o", "pkg.go") -- run("go", "tool", "compile", "-o", "main.o", "main.go") -- run("go", "tool", "link", "-o", "a.exe", "main.o") -- run("." + string(filepath.Separator) + "a.exe") -+ run(goCmd(), "tool", "compile", "-N", "-o", "slow.o", "pkg.go") -+ run(goCmd(), "tool", "compile", "-o", "fast.o", "pkg.go") -+ run(goCmd(), "tool", "compile", "-o", "main.o", "main.go") -+ run(goCmd(), "tool", "link", "-o", "a.exe", "main.o") -+ goRun("." + string(filepath.Separator) + "a.exe") - - os.Remove("slow.o") - os.Remove("fast.o") -diff --git test/fixedbugs/bug429_run.go test/fixedbugs/bug429_run.go -index 284033d1f7..e8d18b13e8 100644 ---- test/fixedbugs/bug429_run.go -+++ test/fixedbugs/bug429_run.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,6 +10,7 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" -@@ -17,8 +18,27 @@ import ( - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- cmd := exec.Command("go", "run", filepath.Join("fixedbugs", "bug429.go")) -+ flag.Parse() -+ cmd := goRun(filepath.Join("fixedbugs", "bug429.go")) - out, err := cmd.CombinedOutput() - if err == nil { - fmt.Println("expected deadlock") -diff --git test/fixedbugs/issue10607.go test/fixedbugs/issue10607.go -index 9ee6c72bc6..e819a3085a 100644 ---- test/fixedbugs/issue10607.go -+++ test/fixedbugs/issue10607.go -@@ -1,5 +1,5 @@ - // +build linux,!ppc64 android --// run -+// runtarget - - // Copyright 2015 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,19 +11,39 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- test("internal") -+ flag.Parse() -+ //test("internal") - test("external") - } - - func test(linkmode string) { -- out, err := exec.Command("go", "run", "-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput() -+ out, err := goRun("-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput() - if err != nil { - fmt.Printf("BUG: linkmode=%s %v\n%s\n", linkmode, err, out) - os.Exit(1) -diff --git test/fixedbugs/issue11771.go test/fixedbugs/issue11771.go -index d91fc5d966..4f55ce6982 100644 ---- test/fixedbugs/issue11771.go -+++ test/fixedbugs/issue11771.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2015 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,6 +11,7 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "io/ioutil" - "log" -@@ -20,7 +21,17 @@ import ( - "runtime" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -+ flag.Parse() - if runtime.Compiler != "gc" { - return - } -@@ -52,7 +63,7 @@ func x() { - log.Fatal(err) - } - -- cmd := exec.Command("go", "tool", "compile", "x.go") -+ cmd := exec.Command(goCmd(), "tool", "compile", "x.go") - cmd.Dir = dir - output, err := cmd.CombinedOutput() - if err == nil { -diff --git test/fixedbugs/issue9355.go test/fixedbugs/issue9355.go -index 10f8c73069..87356c7402 100644 ---- test/fixedbugs/issue9355.go -+++ test/fixedbugs/issue9355.go -@@ -1,4 +1,4 @@ --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -7,6 +7,7 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" -@@ -15,7 +16,17 @@ import ( - "runtime" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -+ flag.Parse() - if runtime.Compiler != "gc" || runtime.GOOS == "nacl" { - return - } -@@ -23,7 +34,7 @@ func main() { - err := os.Chdir(filepath.Join("fixedbugs", "issue9355.dir")) - check(err) - -- out := run("go", "tool", "compile", "-S", "a.go") -+ out := run(goCmd(), "tool", "compile", "-S", "a.go") - os.Remove("a.o") - - // 6g/8g print the offset as dec, but 5g/9g print the offset as hex. -diff --git test/fixedbugs/issue9862_run.go test/fixedbugs/issue9862_run.go -index be22f40580..a72a59fda2 100644 ---- test/fixedbugs/issue9862_run.go -+++ test/fixedbugs/issue9862_run.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2015 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,12 +10,32 @@ - package main - - import ( -+ "flag" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- out, err := exec.Command("go", "run", "fixedbugs/issue9862.go").CombinedOutput() -+ flag.Parse() -+ out, err := goRun("fixedbugs/issue9862.go").CombinedOutput() - outstr := string(out) - if err == nil { - println("go run issue9862.go succeeded, should have failed\n", outstr) -diff --git test/linkmain_run.go test/linkmain_run.go -index 55de481a81..03666e6b29 100644 ---- test/linkmain_run.go -+++ test/linkmain_run.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,12 +10,22 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func cleanup() { - os.Remove("linkmain.o") - os.Remove("linkmain.a") -@@ -51,16 +61,17 @@ func runFail(cmdline string) { - } - - func main() { -+ flag.Parse() - // helloworld.go is package main -- run("go tool compile -o linkmain.o helloworld.go") -- run("go tool compile -pack -o linkmain.a helloworld.go") -- run("go tool link -o linkmain.exe linkmain.o") -- run("go tool link -o linkmain.exe linkmain.a") -+ run(goCmd() + " tool compile -o linkmain.o helloworld.go") -+ run(goCmd() + " tool compile -pack -o linkmain.a helloworld.go") -+ run(goCmd() + " tool link -o linkmain.exe linkmain.o") -+ run(goCmd() + " tool link -o linkmain.exe linkmain.a") - - // linkmain.go is not -- run("go tool compile -o linkmain1.o linkmain.go") -- run("go tool compile -pack -o linkmain1.a linkmain.go") -- runFail("go tool link -o linkmain.exe linkmain1.o") -- runFail("go tool link -o linkmain.exe linkmain1.a") -+ run(goCmd() + " tool compile -o linkmain1.o linkmain.go") -+ run(goCmd() + " tool compile -pack -o linkmain1.a linkmain.go") -+ runFail(goCmd() + " tool link -o linkmain.exe linkmain1.o") -+ runFail(goCmd() + " tool link -o linkmain.exe linkmain1.a") - cleanup() - } -diff --git test/linkobj.go test/linkobj.go -index 8a86aa872f..0d1964e7fb 100644 ---- test/linkobj.go -+++ test/linkobj.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2016 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,6 +10,7 @@ - package main - - import ( -+ "flag" - "fmt" - "io/ioutil" - "log" -@@ -18,9 +19,27 @@ import ( - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(cmd ...string) string { -+ if *target == "" { -+ return run(cmd...) -+ } else { -+ return run(append([]string{"go_"+*target+"_exec"}, cmd...)...) -+ } -+} -+ - var pwd, tmpdir string - - func main() { -+ flag.Parse() - dir, err := ioutil.TempDir("", "go-test-linkobj-") - if err != nil { - log.Fatal(err) -@@ -37,28 +56,28 @@ func main() { - - writeFile("p1.go", ` - package p1 -- -+ - func F() { - println("hello from p1") - } - `) - writeFile("p2.go", ` - package p2 -- -+ - import "./p1" - - func F() { - p1.F() - println("hello from p2") - } -- -+ - func main() {} - `) - writeFile("p3.go", ` - package main - - import "./p2" -- -+ - func main() { - p2.F() - println("hello from main") -@@ -76,9 +95,9 @@ func main() { - } - - // inlining is disabled to make sure that the link objects contain needed code. -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p1."+o, "-linkobj", "p1.lo", "p1.go") -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p2."+o, "-linkobj", "p2.lo", "p2.go") -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p3."+o, "-linkobj", "p3.lo", "p3.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p1."+o, "-linkobj", "p1.lo", "p1.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p2."+o, "-linkobj", "p2.lo", "p2.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p3."+o, "-linkobj", "p3.lo", "p3.go") - - cp("p1."+o, "p1.oo") - cp("p2."+o, "p2.oo") -@@ -86,13 +105,13 @@ func main() { - cp("p1.lo", "p1."+o) - cp("p2.lo", "p2."+o) - cp("p3.lo", "p3."+o) -- out := runFail("go", "tool", "link", "p2."+o) -+ out := runFail(goCmd(), "tool", "link", "p2."+o) - if !strings.Contains(out, "not package main") { - fatalf("link p2.o failed but not for package main:\n%s", out) - } - -- run("go", "tool", "link", "-L", ".", "-o", "a.out.exe", "p3."+o) -- out = run("./a.out.exe") -+ run(goCmd(), "tool", "link", "-L", ".", "-o", "a.out.exe", "p3."+o) -+ out = goRun("./a.out.exe") - if !strings.Contains(out, "hello from p1\nhello from p2\nhello from main\n") { - fatalf("running main, incorrect output:\n%s", out) - } -diff --git test/linkx_run.go test/linkx_run.go -index cc249c9cfc..530159ab9d 100644 ---- test/linkx_run.go -+++ test/linkx_run.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,20 +11,40 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "os" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -+ flag.Parse() - // test(" ") // old deprecated & removed syntax - test("=") // new syntax - } - - func test(sep string) { - // Successful run -- cmd := exec.Command("go", "run", "-ldflags=-X main.tbd"+sep+"hello -X main.overwrite"+sep+"trumped -X main.nosuchsymbol"+sep+"neverseen", "linkx.go") -+ cmd := goRun("-ldflags=-X main.tbd"+sep+"hello -X main.overwrite"+sep+"trumped -X main.nosuchsymbol"+sep+"neverseen", "linkx.go") - var out, errbuf bytes.Buffer - cmd.Stdout = &out - cmd.Stderr = &errbuf -@@ -44,7 +64,7 @@ func test(sep string) { - } - - // Issue 8810 -- cmd = exec.Command("go", "run", "-ldflags=-X main.tbd", "linkx.go") -+ cmd = goRun("-ldflags=-X main.tbd", "linkx.go") - _, err = cmd.CombinedOutput() - if err == nil { - fmt.Println("-X linker flag should not accept keys without values") -@@ -52,7 +72,7 @@ func test(sep string) { - } - - // Issue 9621 -- cmd = exec.Command("go", "run", "-ldflags=-X main.b=false -X main.x=42", "linkx.go") -+ cmd = goRun("-ldflags=-X main.b=false -X main.x=42", "linkx.go") - outx, err := cmd.CombinedOutput() - if err == nil { - fmt.Println("-X linker flag should not overwrite non-strings") -diff --git test/nosplit.go test/nosplit.go -index e6cecebde3..fed1c0e510 100644 ---- test/nosplit.go -+++ test/nosplit.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -9,6 +9,7 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "io/ioutil" - "log" -@@ -21,6 +22,24 @@ import ( - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goArch() string { -+ goarch, err := exec.Command(goCmd(), "env", "GOARCH").Output() -+ if err != nil { -+ bug() -+ fmt.Printf("running go env GOARCH: %v\n", err) -+ } -+ return strings.TrimSpace(string(goarch)) -+} -+ - var tests = ` - # These are test cases for the linker analysis that detects chains of - # nosplit functions that would cause a stack overflow. -@@ -194,12 +213,13 @@ var ( - ) - - func main() { -- goarch := os.Getenv("GOARCH") -+ flag.Parse() -+ goarch := goArch() - if goarch == "" { -- goarch = runtime.GOARCH -+ return - } - -- version, err := exec.Command("go", "tool", "compile", "-V").Output() -+ version, err := exec.Command(goCmd(), "tool", "compile", "-V").Output() - if err != nil { - bug() - fmt.Printf("running go tool compile -V: %v\n", err) -@@ -345,7 +365,7 @@ TestCases: - log.Fatal(err) - } - -- cmd := exec.Command("go", "build") -+ cmd := exec.Command(goCmd(), "build") - cmd.Dir = dir - output, err := cmd.CombinedOutput() - if err == nil { -diff --git test/run.go test/run.go -index ac5d3c3e8d..62041226b0 100644 ---- test/run.go -+++ test/run.go -@@ -229,6 +229,16 @@ func goRun(runcmd runCmd, flags []string, goname string, args ...string) (out [] - return runcmd(cmd...) - } - -+func goRunTarget(runcmd runCmd, goname string, args ...string) (out []byte, err error) { -+ cmd := []string{"go_local", "run"} -+ cmd = append(cmd, goname) -+ if *target != "" { -+ cmd = append(cmd, "-target", *target) -+ } -+ cmd = append(cmd, args...) -+ return runcmd(cmd...) -+} -+ - // skipError describes why a test was skipped. - type skipError string - -@@ -491,7 +501,7 @@ func (t *test) run() { - action = "rundir" - case "cmpout": - action = "run" // the run case already looks for <dir>/<test>.out files -- case "compile", "compiledir", "build", "builddir", "run", "buildrun", "runoutput", "rundir": -+ case "compile", "compiledir", "build", "builddir", "run", "runtarget", "buildrun", "runoutput", "rundir": - // nothing to do - case "errorcheckandrundir": - wantError = false // should be no error if also will run -@@ -816,6 +826,17 @@ func (t *test) run() { - t.err = fmt.Errorf("incorrect output\n%s", out) - } - -+ case "runtarget": -+ useTmp = false -+ out, err := goRunTarget(runcmd, t.goFileName(), args...) -+ if err != nil { -+ t.err = err -+ return -+ } -+ if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { -+ t.err = fmt.Errorf("incorrect output\n%s", out) -+ } -+ - case "runoutput": - rungatec <- true - defer func() { -diff --git test/sinit_run.go test/sinit_run.go -index c9afd3b777..dc885ecffd 100644 ---- test/sinit_run.go -+++ test/sinit_run.go -@@ -1,5 +1,5 @@ - // +build !nacl --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,13 +11,24 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "os" - "os/exec" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -- cmd := exec.Command("go", "tool", "compile", "-S", "sinit.go") -+ flag.Parse() -+ cmd := exec.Command(goCmd(), "tool", "compile", "-S", "sinit.go") - out, err := cmd.CombinedOutput() - if err != nil { - fmt.Println(string(out)) diff --git a/go/patch/go-1.10.3/go4.patch b/go/patch/go-1.10.3/go4.patch deleted file mode 100644 index 290de390..00000000 --- a/go/patch/go-1.10.3/go4.patch +++ /dev/null @@ -1,199 +0,0 @@ -runtime, crypto/x509: add -target flag. - ---- src/crypto/x509/x509_test.go -+++ src/crypto/x509/x509_test.go -@@ -13,29 +13,32 @@ import ( - "crypto/rsa" - _ "crypto/sha256" - _ "crypto/sha512" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/base64" - "encoding/hex" - "encoding/pem" -+ "flag" - "fmt" - "internal/testenv" - "math/big" - "net" - "net/url" - "os/exec" - "reflect" - "runtime" - "strings" - "testing" - "time" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ - func TestParsePKCS1PrivateKey(t *testing.T) { - block, _ := pem.Decode([]byte(pemPrivateKey)) - priv, err := ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - t.Errorf("Failed to parse private key: %s", err) - return - } - if priv.PublicKey.N.Cmp(rsaPrivateKey.PublicKey.N) != 0 || -@@ -1089,17 +1092,23 @@ func TestParsePEMCRL(t *testing.T) { - } - - // Can't check the signature here without a package cycle. - } - - func TestImports(t *testing.T) { - testenv.MustHaveGoRun(t) - -- if err := exec.Command(testenv.GoToolPath(t), "run", "x509_test_import.go").Run(); err != nil { -+ var cmd *exec.Cmd -+ if *target == "" { -+ cmd = exec.Command(testenv.GoToolPath(t), "run", "x509_test_import.go") -+ } else { -+ cmd = exec.Command("go_"+*target, "run", "-exec", "go_"+*target+"_exec", "x509_test_import.go") -+ } -+ if err := cmd.Run(); err != nil { - t.Errorf("failed to run x509_test_import.go: %s", err) - } - } - - const derCRLBase64 = "MIINqzCCDJMCAQEwDQYJKoZIhvcNAQEFBQAwVjEZMBcGA1UEAxMQUEtJIEZJTk1FQ0NBTklDQTEVMBMGA1UEChMMRklOTUVDQ0FOSUNBMRUwEwYDVQQLEwxGSU5NRUNDQU5JQ0ExCzAJBgNVBAYTAklUFw0xMTA1MDQxNjU3NDJaFw0xMTA1MDQyMDU3NDJaMIIMBzAhAg4Ze1od49Lt1qIXBydAzhcNMDkwNzE2MDg0MzIyWjAAMCECDl0HSL9bcZ1Ci/UHJ0DPFw0wOTA3MTYwODQzMTNaMAAwIQIOESB9tVAmX3c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Fg1MDkgQ1JMLS0tLS0NCg0K" - ---- src/runtime/crash_cgo_test.go -+++ src/runtime/crash_cgo_test.go -@@ -279,17 +279,17 @@ func testCgoPprof(t *testing.T, buildArg, runArg string) { - } - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprogcgo", buildArg) - if err != nil { - t.Fatal(err) - } - -- got, err := testenv.CleanCmdEnv(exec.Command(exe, runArg)).CombinedOutput() -+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, runArg)).CombinedOutput() - if err != nil { - if testenv.Builder() == "linux-amd64-alpine" { - // See Issue 18243 and Issue 19938. - t.Skipf("Skipping failing test on Alpine (golang.org/issue/18243). Ignoring error: %v", err) - } - t.Fatal(err) - } - fn := strings.TrimSpace(string(got)) ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -17,16 +17,35 @@ import ( - "runtime" - "strconv" - "strings" - "sync" - "testing" - "time" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd(t *testing.T) string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return testenv.GoToolPath(t) -+} -+ -+func goExecCmd(name string, arg ...string) *exec.Cmd { -+ var cmd []string -+ if *target != "" { -+ cmd = append(cmd, "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, name) -+ cmd = append(cmd, arg...) -+ return exec.Command(cmd[0], cmd[1:]...) -+} -+ - var toRemove []string - - func TestMain(m *testing.M) { - status := m.Run() - for _, file := range toRemove { - os.RemoveAll(file) - } - os.Exit(status) -@@ -50,17 +69,17 @@ func runTestProg(t *testing.T, binary, name string, env ...string) string { - - testenv.MustHaveGoBuild(t) - - exe, err := buildTestProg(t, binary) - if err != nil { - t.Fatal(err) - } - -- cmd := testenv.CleanCmdEnv(exec.Command(exe, name)) -+ cmd := testenv.CleanCmdEnv(goExecCmd(exe, name)) - cmd.Env = append(cmd.Env, env...) - if testing.Short() { - cmd.Env = append(cmd.Env, "RUNTIME_TEST_SHORT=1") - } - var b bytes.Buffer - cmd.Stdout = &b - cmd.Stderr = &b - if err := cmd.Start(); err != nil { -@@ -125,17 +144,17 @@ func buildTestProg(t *testing.T, binary string, flags ...string) (string, error) - name += "_" + strings.Join(flags, "_") - } - target, ok := testprog.target[name] - if ok { - return target.exe, target.err - } - - exe := filepath.Join(testprog.dir, name+".exe") -- cmd := exec.Command(testenv.GoToolPath(t), append([]string{"build", "-o", exe}, flags...)...) -+ cmd := exec.Command(goCmd(t), append([]string{"build", "-o", exe}, flags...)...) - cmd.Dir = "testdata/" + binary - out, err := testenv.CleanCmdEnv(cmd).CombinedOutput() - if err != nil { - target.err = fmt.Errorf("building %s %v: %v\n%s", binary, flags, err, out) - testprog.target[name] = target - return "", target.err - } - target.exe = exe -@@ -456,17 +475,17 @@ func TestPanicLoop(t *testing.T) { - func TestMemPprof(t *testing.T) { - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } - -- got, err := testenv.CleanCmdEnv(exec.Command(exe, "MemProf")).CombinedOutput() -+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, "MemProf")).CombinedOutput() - if err != nil { - t.Fatal(err) - } - fn := strings.TrimSpace(string(got)) - defer os.Remove(fn) - - for try := 0; try < 2; try++ { - cmd := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "tool", "pprof", "-alloc_space", "-top")) ---- src/runtime/crash_unix_test.go -+++ src/runtime/crash_unix_test.go -@@ -244,17 +244,17 @@ func testPanicSystemstackInternal() { - } - - func TestSignalExitStatus(t *testing.T) { - testenv.MustHaveGoBuild(t) - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } -- err = testenv.CleanCmdEnv(exec.Command(exe, "SignalExitStatus")).Run() -+ err = testenv.CleanCmdEnv(goExecCmd(exe, "SignalExitStatus")).Run() - if err == nil { - t.Error("test program succeeded unexpectedly") - } else if ee, ok := err.(*exec.ExitError); !ok { - t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err) - } else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok { - t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys()) - } else if !ws.Signaled() || ws.Signal() != syscall.SIGTERM { - t.Errorf("got %v; expected SIGTERM", ee) diff --git a/go/patch/go-1.10.3/go5.patch b/go/patch/go-1.10.3/go5.patch deleted file mode 100644 index 658b0346..00000000 --- a/go/patch/go-1.10.3/go5.patch +++ /dev/null @@ -1,106 +0,0 @@ -diff --git src/runtime/crash_test.go src/runtime/crash_test.go -index e34f0fa95f..ea1eb4150a 100644 ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -219,22 +219,27 @@ func testDeadlock(t *testing.T, name string) { - } - - func TestSimpleDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "SimpleDeadlock") - } - - func TestInitDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "InitDeadlock") - } - - func TestLockedDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "LockedDeadlock") - } - - func TestLockedDeadlock2(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "LockedDeadlock2") - } - - func TestGoexitDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "GoexitDeadlock") - want := "no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.Contains(output, want) { -@@ -271,6 +276,7 @@ panic: again - } - - func TestGoexitCrash(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "GoexitExit") - want := "no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.Contains(output, want) { -@@ -329,6 +335,7 @@ func TestBreakpoint(t *testing.T) { - } - - func TestGoexitInPanic(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - // see issue 8774: this code used to trigger an infinite recursion - output := runTestProg(t, "testprog", "GoexitInPanic") - want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!" -@@ -393,6 +400,7 @@ func TestPanicAfterGoexit(t *testing.T) { - } - - func TestRecoveredPanicAfterGoexit(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "RecoveredPanicAfterGoexit") - want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.HasPrefix(output, want) { -diff --git src/runtime/proc_test.go src/runtime/proc_test.go -index 2ece829071..942d65eedb 100644 ---- src/runtime/proc_test.go -+++ src/runtime/proc_test.go -@@ -354,9 +354,10 @@ func TestGCFairness2(t *testing.T) { - - func TestNumGoroutine(t *testing.T) { - output := runTestProg(t, "testprog", "NumGoroutine") -- want := "1\n" -- if output != want { -- t.Fatalf("want %q, got %q", want, output) -+ want1 := "1\n" -+ want2 := "2\n" -+ if output != want1 && output != want2 { -+ t.Fatalf("want %q, got %q", want1, output) - } - - buf := make([]byte, 1<<20) -diff --git test/fixedbugs/bug429_run.go test/fixedbugs/bug429_run.go -index e8d18b13e8..6a555286cf 100644 ---- test/fixedbugs/bug429_run.go -+++ test/fixedbugs/bug429_run.go -@@ -1,5 +1,5 @@ - // +build !nacl --// runtarget -+// skip - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -diff --git test/goprint.go test/goprint.go -index 0648c77e7d..147f0c91db 100644 ---- test/goprint.go -+++ test/goprint.go -@@ -8,14 +8,9 @@ - - package main - --import ( -- "runtime" -- "time" --) -+import "time" - - func main() { - go println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255)) -- for runtime.NumGoroutine() > 1 { -- time.Sleep(10*time.Millisecond) -- } -+ time.Sleep(100*time.Millisecond) - } diff --git a/go/patch/go-1.10.3/go6.patch b/go/patch/go-1.10.3/go6.patch deleted file mode 100644 index 5fb512a9..00000000 --- a/go/patch/go-1.10.3/go6.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git src/encoding/gob/encoder_test.go src/encoding/gob/encoder_test.go -index a1ca252ccd..c66e623499 100644 ---- src/encoding/gob/encoder_test.go -+++ src/encoding/gob/encoder_test.go -@@ -1130,10 +1130,7 @@ func TestBadData(t *testing.T) { - - // TestHugeWriteFails tests that enormous messages trigger an error. - func TestHugeWriteFails(t *testing.T) { -- if testing.Short() { -- // Requires allocating a monster, so don't do this from all.bash. -- t.Skip("skipping huge allocation in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - huge := make([]byte, tooBig) - huge[0] = 7 // Make sure it's not all zeros. - buf := new(bytes.Buffer) -diff --git src/runtime/crash_cgo_test.go src/runtime/crash_cgo_test.go -index 998055972a..60fe2a52d2 100644 ---- src/runtime/crash_cgo_test.old -+++ src/runtime/crash_cgo_test.go -@@ -251,10 +251,7 @@ func TestCgoCCodeSIGPROF(t *testing.T) { - } - - func TestCgoCrashTraceback(t *testing.T) { -- t.Parallel() -- if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") { -- t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) -- } -+ t.Skipf("skip running remotely") - got := runTestProg(t, "testprogcgo", "CrashTraceback") - for i := 1; i <= 3; i++ { - if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) { -@@ -273,10 +270,7 @@ func TestCgoTracebackContext(t *testing.T) { - } - - func testCgoPprof(t *testing.T, buildArg, runArg string) { -- t.Parallel() -- if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") { -- t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) -- } -+ t.Skipf("skip pprof test") - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprogcgo", buildArg) -diff --git src/runtime/crash_test.go src/runtime/crash_test.go -index 3607992788..e53ffb6a81 100644 ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -481,6 +481,7 @@ func TestPanicLoop(t *testing.T) { - } - - func TestMemPprof(t *testing.T) { -+ t.Skipf("skip pprof test") - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprog") -diff --git src/runtime/crash_unix_test.go src/runtime/crash_unix_test.go -index 02891ec1ad..fd2723f16e 100644 ---- src/runtime/crash_unix_test.go -+++ src/runtime/crash_unix_test.go -@@ -174,9 +174,7 @@ func TestPanicSystemstack(t *testing.T) { - // The GOTRACEBACK=crash handler takes 0.1 seconds even if - // it's not writing a core file and potentially much longer if - // it is. Skip in short mode. -- if testing.Short() { -- t.Skip("Skipping in short mode (GOTRACEBACK=crash is slow)") -- } -+ t.Skip("Skipping (GOTRACEBACK=crash hangs on arm)") - - if runtime.Sigisblocked(int(syscall.SIGQUIT)) { - t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196") -@@ -244,6 +242,7 @@ func testPanicSystemstackInternal() { - } - - func TestSignalExitStatus(t *testing.T) { -+ t.Skipf("skip running remotely") - testenv.MustHaveGoBuild(t) - exe, err := buildTestProg(t, "testprog") - if err != nil { -diff --git src/runtime/fastlog2_test.go src/runtime/fastlog2_test.go -index ae0f40b2bb..a93933d7ac 100644 ---- src/runtime/fastlog2_test.go -+++ src/runtime/fastlog2_test.go -@@ -16,11 +16,7 @@ func TestFastLog2(t *testing.T) { - const randomBitCount = 26 - var e float64 - -- inc := 1 -- if testing.Short() { -- // Check 1K total values, down from 64M. -- inc = 1 << 16 -- } -+ inc := 1 << 16 - for i := 1; i < 1<<randomBitCount; i += inc { - l, fl := math.Log2(float64(i)), runtime.Fastlog2(float64(i)) - d := l - fl -diff --git src/runtime/hash_test.go src/runtime/hash_test.go -index 1400579cda..4c5de7fbef 100644 ---- src/runtime/hash_test.go -+++ src/runtime/hash_test.go -@@ -161,9 +161,7 @@ func TestSmhasherZeros(t *testing.T) { - - // Strings with up to two nonzero bytes all have distinct hashes. - func TestSmhasherTwoNonzero(t *testing.T) { -- if testing.Short() { -- t.Skip("Skipping in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - h := newHashSet() - for n := 2; n <= 16; n++ { - twoNonZero(h, n) -@@ -264,9 +262,7 @@ func setbits(h *HashSet, b []byte, i int, k int) { - // Test all possible combinations of n blocks from the set s. - // "permutation" is a bad name here, but it is what Smhasher uses. - func TestSmhasherPermutation(t *testing.T) { -- if testing.Short() { -- t.Skip("Skipping in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - permutation(t, []uint32{0, 1, 2, 3, 4, 5, 6, 7}, 8) - permutation(t, []uint32{0, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}, 8) - permutation(t, []uint32{0, 1}, 20) -diff --git src/runtime/pprof/pprof_test.go src/runtime/pprof/pprof_test.go -index 44d514393e..f46f00894c 100644 ---- src/runtime/pprof/pprof_test.go -+++ src/runtime/pprof/pprof_test.go -@@ -283,14 +283,7 @@ func profileOk(t *testing.T, need []string, prof bytes.Buffer, duration time.Dur - func TestCPUProfileWithFork(t *testing.T) { - testenv.MustHaveExec(t) - -- heap := 1 << 30 -- if runtime.GOOS == "android" { -- // Use smaller size for Android to avoid crash. -- heap = 100 << 20 -- } -- if testing.Short() { -- heap = 100 << 20 -- } -+ heap = 100 << 20 - // This makes fork slower. - garbage := make([]byte, heap) - // Need to touch the slice, otherwise it won't be paged in. diff --git a/go/patch/go-1.11.2/go0.patch b/go/patch/go-1.11.2/go0.patch deleted file mode 100644 index f80045c0..00000000 --- a/go/patch/go-1.11.2/go0.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git src/go/build/deps_test.go src/go/build/deps_test.go -index 29dbe47d29..53e0e287bc 100644 ---- src/go/build/deps_test.go -+++ src/go/build/deps_test.go -@@ -191,7 +191,7 @@ var pkgDeps = map[string][]string{ - "testing": {"L2", "flag", "fmt", "internal/race", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"}, - "testing/iotest": {"L2", "log"}, - "testing/quick": {"L2", "flag", "fmt", "reflect", "time"}, -- "internal/testenv": {"L2", "OS", "flag", "testing", "syscall"}, -+ "internal/testenv": {"L2", "OS", "os.exec", "flag", "testing", "syscall"}, - - // L4 is defined as L3+fmt+log+time, because in general once - // you're using L3 packages, use of fmt, log, or time is not a big deal. -diff --git src/internal/testenv/testenv.go src/internal/testenv/testenv.go -index 8f69fe0da5..d52b85e122 100644 ---- src/internal/testenv/testenv.go -+++ src/internal/testenv/testenv.go -@@ -48,6 +48,9 @@ func HasGoBuild() bool { - return false - } - } -+ if _, err := exec.LookPath("go"); err != nil { -+ return false -+ } - return true - } - diff --git a/go/patch/go-1.11.2/go1.patch b/go/patch/go-1.11.2/go1.patch deleted file mode 100644 index e05fcce4..00000000 --- a/go/patch/go-1.11.2/go1.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git test/chanlinear.go test/chanlinear.go -index 55fee4ab9b..89533da282 100644 ---- test/chanlinear.go -+++ test/chanlinear.go -@@ -1,4 +1,4 @@ --// +build darwin linux -+// +build darwin linux android - // run - - // Copyright 2014 The Go Authors. All rights reserved. -diff --git a/test/fixedbugs/bug385_64.go b/test/fixedbugs/bug385_64.go -index 0f941ca2f4..3bcd62f3ad 100644 ---- test/fixedbugs/bug385_64.go -+++ test/fixedbugs/bug385_64.go -@@ -1,4 +1,4 @@ --// +build amd64 -+// +build amd64 arm64 - // errorcheck - - // Copyright 2011 The Go Authors. All rights reserved. -diff --git test/fixedbugs/issue10607.go test/fixedbugs/issue10607.go -index 8831547da8..9ee6c72bc6 100644 ---- test/fixedbugs/issue10607.go -+++ test/fixedbugs/issue10607.go -@@ -1,4 +1,4 @@ --// +build linux,!ppc64 -+// +build linux,!ppc64 android - // run - - // Copyright 2015 The Go Authors. All rights reserved. -diff --git test/maplinear.go test/maplinear.go -index 34d0914914..afddab627d 100644 ---- test/maplinear.go -+++ test/maplinear.go -@@ -1,4 +1,4 @@ --// +build darwin linux -+// +build darwin linux android - // run - - // Copyright 2013 The Go Authors. All rights reserved. -diff --git test/recover4.go test/recover4.go -index 67ed970ecb..95a89dab00 100644 ---- test/recover4.go -+++ test/recover4.go -@@ -1,4 +1,4 @@ --// +build linux darwin -+// +build linux android darwin - // run - - // Copyright 2015 The Go Authors. All rights reserved. diff --git a/go/patch/go-1.11.2/go2.patch b/go/patch/go-1.11.2/go2.patch deleted file mode 100644 index 362a53fe..00000000 --- a/go/patch/go-1.11.2/go2.patch +++ /dev/null @@ -1,277 +0,0 @@ -diff --git test/run.go test/run.go -index ad38d420c9..e2b93d35da 100644 ---- test/run.go -+++ test/run.go -@@ -36,13 +36,13 @@ var ( - summary = flag.Bool("summary", false, "show summary of results") - showSkips = flag.Bool("show_skips", false, "show skipped tests") - runSkips = flag.Bool("run_skips", false, "run skipped tests (ignore skip and build tags)") -- linkshared = flag.Bool("linkshared", false, "") - updateErrors = flag.Bool("update_errors", false, "update error messages in test file based on compiler output") - runoutputLimit = flag.Int("l", defaultRunOutputLimit(), "number of parallel runoutput tests to run") - - shard = flag.Int("shard", 0, "shard index to run. Only applicable if -shards is non-zero.") - shards = flag.Int("shards", 0, "number of shards. If 0, all tests are run. This is used by the continuous build.") - ) -+ target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") - - var ( - goos, goarch string -@@ -207,25 +207,19 @@ func goFiles(dir string) []string { - type runCmd func(...string) ([]byte, error) - - func compileFile(runcmd runCmd, longname string, flags []string) (out []byte, err error) { -- cmd := []string{goTool(), "tool", "compile", "-e"} -+ cmd := []string{findGoCmd, "tool", "compile", "-e"} - cmd = append(cmd, flags...) -- if *linkshared { -- cmd = append(cmd, "-dynlink", "-installsuffix=dynlink") -- } - cmd = append(cmd, longname) - return runcmd(cmd...) - } - - func compileInDir(runcmd runCmd, dir string, flags []string, localImports bool, names ...string) (out []byte, err error) { -- cmd := []string{goTool(), "tool", "compile", "-e"} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e"} - if localImports { - // Set relative path for local imports and import search path to current dir. - cmd = append(cmd, "-D", ".", "-I", ".") - } - cmd = append(cmd, flags...) -- if *linkshared { -- cmd = append(cmd, "-dynlink", "-installsuffix=dynlink") -- } - for _, name := range names { - cmd = append(cmd, filepath.Join(dir, name)) - } -@@ -234,15 +228,28 @@ func compileInDir(runcmd runCmd, dir string, flags []string, localImports bool, - - func linkFile(runcmd runCmd, goname string) (err error) { - pfile := strings.Replace(goname, ".go", ".o", -1) -- cmd := []string{goTool(), "tool", "link", "-w", "-o", "a.exe", "-L", "."} -+ cmd := []string{findGoCmd(), "tool", "link", "-w", "-o", "a.exe", "-L", "."} - if *linkshared { - cmd = append(cmd, "-linkshared", "-installsuffix=dynlink") - } - cmd = append(cmd, pfile) -- _, err = runcmd(cmd...) -+ _, err = runcmd(findGoCmd(), "tool", "link", "-w", "-o", "a.exe", "-L", ".", pfile) - return - } - -+ -+func goRun(runcmd runCmd, flags []string, goname string, args ...string) (out []byte, err error) { -+ cmd := []string{findGoCmd(), "run", goGcflags()} -+ if len(findExecCmd()) > 0 { -+ cmd = append(cmd, "-exec") -+ cmd = append(cmd, findExecCmd()...) -+ } -+ cmd = append(cmd, flags...) -+ cmd = append(cmd, goname) -+ cmd = append(cmd, args...) -+ return runcmd(cmd...) -+} -+ - // skipError describes why a test was skipped. - type skipError string - -@@ -646,7 +653,7 @@ func (t *test) run() { - // Fail if wantError is true and compilation was successful and vice versa. - // Match errors produced by gc against errors in comments. - // TODO(gri) remove need for -C (disable printing of columns in error messages) -- cmdline := []string{goTool(), "tool", "compile", "-C", "-e", "-o", "a.o"} -+ cmdline := []string{findGoCmd(), "tool", "compile", "-C", "-e", "-o", "a.o"} - // No need to add -dynlink even if linkshared if we're just checking for errors... - cmdline = append(cmdline, flags...) - cmdline = append(cmdline, long) -@@ -773,7 +780,7 @@ func (t *test) run() { - - case "build": - // Build Go file. -- _, err := runcmd(goTool(), "build", goGcflags(), "-o", "a.exe", long) -+ _, err := runcmd(findGoCmd(), "build", goGcflags(), "-o", "a.exe", long) - if err != nil { - t.err = err - } -@@ -799,7 +806,7 @@ func (t *test) run() { - - } - var objs []string -- cmd := []string{goTool(), "tool", "compile", "-e", "-D", ".", "-I", ".", "-o", "go.o"} -+ cmd := []string{findGoCmd(), "tool", "compile", "-e", "-D", ".", "-I", ".", "-o", "go.o"} - if len(asms) > 0 { - cmd = append(cmd, "-asmhdr", "go_asm.h") - } -@@ -813,7 +820,7 @@ func (t *test) run() { - } - objs = append(objs, "go.o") - if len(asms) > 0 { -- cmd = []string{goTool(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} -+ cmd = []string{findGoCmd(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} - for _, file := range asms { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } -@@ -857,14 +864,14 @@ func (t *test) run() { - } - objs = append(objs, "asm.o") - } -- cmd = []string{goTool(), "tool", "pack", "c", "all.a"} -+ cmd = []string{findGoCmd(), "tool", "pack", "c", "all.a"} - cmd = append(cmd, objs...) - _, err = runcmd(cmd...) - if err != nil { - t.err = err - break - } -- cmd = []string{goTool(), "tool", "link", "-o", "a.exe", "all.a"} -+ cmd = []string{findGoCmd(), "tool", "link", "-o", "a.exe", "all.a"} - _, err = runcmd(cmd...) - if err != nil { - t.err = err -@@ -886,10 +893,7 @@ func (t *test) run() { - // Build an executable from Go file, then run it, verify its output. - // Useful for timeout tests where failure mode is infinite loop. - // TODO: not supported on NaCl -- cmd := []string{goTool(), "build", goGcflags(), "-o", "a.exe"} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -+ cmd := []string{findGoCmd(), "build", goGcflags(), "-o", "a.exe"} - longdirgofile := filepath.Join(filepath.Join(cwd, t.dir), t.gofile) - cmd = append(cmd, flags...) - cmd = append(cmd, longdirgofile) -@@ -898,8 +902,13 @@ func (t *test) run() { - t.err = err - return - } -- cmd = []string{"./a.exe"} -- out, err = runcmd(append(cmd, args...)...) -+ cmd = []string{} -+ if len(findExecCmd()) > 0 { -+ cmd = append(cmd, findExecCmd()...) -+ } -+ cmd = append(cmd, "./a.exe") -+ -+ out, err = runcmd(append(cmd, args...)...) - if err != nil { - t.err = err - return -@@ -914,38 +923,7 @@ func (t *test) run() { - // otherwise build an executable and run it. - // Verify the output. - useTmp = false -- var out []byte -- var err error -- if len(flags)+len(args) == 0 && goGcflags() == "" && !*linkshared { -- // If we're not using special go command flags, -- // skip all the go command machinery. -- // This avoids any time the go command would -- // spend checking whether, for example, the installed -- // package runtime is up to date. -- // Because we run lots of trivial test programs, -- // the time adds up. -- pkg := filepath.Join(t.tempDir, "pkg.a") -- if _, err := runcmd(goTool(), "tool", "compile", "-o", pkg, t.goFileName()); err != nil { -- t.err = err -- return -- } -- exe := filepath.Join(t.tempDir, "test.exe") -- cmd := []string{goTool(), "tool", "link", "-s", "-w"} -- cmd = append(cmd, "-o", exe, pkg) -- if _, err := runcmd(cmd...); err != nil { -- t.err = err -- return -- } -- out, err = runcmd(append([]string{exe}, args...)...) -- } else { -- cmd := []string{goTool(), "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, flags...) -- cmd = append(cmd, t.goFileName()) -- out, err = runcmd(append(cmd, args...)...) -- } -+ out, err := goRun(runcmd, flags, t.goFileName(), args...) - if err != nil { - t.err = err - return -@@ -962,12 +940,7 @@ func (t *test) run() { - <-rungatec - }() - useTmp = false -- cmd := []string{goTool(), "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, t.goFileName()) -- out, err := runcmd(append(cmd, args...)...) -+ out, err := goRun(runcmd, nil, t.goFileName(), args...) - if err != nil { - t.err = err - return -@@ -977,12 +950,7 @@ func (t *test) run() { - t.err = fmt.Errorf("write tempfile:%s", err) - return - } -- cmd = []string{goTool(), "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, tfile) -- out, err = runcmd(cmd...) -+ out, err = goRun(runcmd, nil, tfile) - if err != nil { - t.err = err - return -@@ -995,12 +963,7 @@ func (t *test) run() { - // Run Go file and write its output into temporary Go file. - // Compile and errorCheck generated Go file. - useTmp = false -- cmd := []string{goTool(), "run", goGcflags()} -- if *linkshared { -- cmd = append(cmd, "-linkshared") -- } -- cmd = append(cmd, t.goFileName()) -- out, err := runcmd(append(cmd, args...)...) -+ out, err := goRun(runcmd, nil, t.goFileName(), args...) - if err != nil { - t.err = err - return -@@ -1011,7 +974,7 @@ func (t *test) run() { - t.err = fmt.Errorf("write tempfile:%s", err) - return - } -- cmdline := []string{goTool(), "tool", "compile", "-e", "-o", "a.o"} -+ cmdline := []string{findGoCmd(), "tool", "compile", "-e", "-o", "a.o"} - cmdline = append(cmdline, flags...) - cmdline = append(cmdline, tfile) - out, err = runcmd(cmdline...) -@@ -1038,6 +1001,11 @@ func findExecCmd() []string { - return execCmd - } - execCmd = []string{} // avoid work the second time -+ if *target != "" { -+ execCmd = []string{"go_" + *target + "_exec"} -+ return execCmd -+ } -+ - if goos == runtime.GOOS && goarch == runtime.GOARCH { - return execCmd - } -@@ -1048,6 +1016,14 @@ func findExecCmd() []string { - return execCmd - } - -+func findGoCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+ - func (t *test) String() string { - return filepath.Join(t.dir, t.gofile) - } diff --git a/go/patch/go-1.11.2/go3.patch b/go/patch/go-1.11.2/go3.patch deleted file mode 100644 index c97cd302..00000000 --- a/go/patch/go-1.11.2/go3.patch +++ /dev/null @@ -1,730 +0,0 @@ -diff --git test/fixedbugs/bug302.go test/fixedbugs/bug302.go -index c763b87786..470841f676 100644 ---- test/fixedbugs/bug302.go -+++ test/fixedbugs/bug302.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -8,16 +8,28 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+ - func main() { -- run("go", "tool", "compile", filepath.Join("fixedbugs", "bug302.dir", "p.go")) -- run("go", "tool", "pack", "grc", "pp.a", "p.o") -- run("go", "tool", "compile", "-I", ".", filepath.Join("fixedbugs", "bug302.dir", "main.go")) -+ flag.Parse() -+ run(goCmd(), "tool", "compile", filepath.Join("fixedbugs", "bug302.dir", "p.go")) -+ run(goCmd(), "tool", "pack", "grc", "pp.a", "p.o") -+ run(goCmd(), "tool", "compile", "-I", ".", filepath.Join("fixedbugs", "bug302.dir", "main.go")) - os.Remove("p.o") - os.Remove("pp.a") - os.Remove("main.o") -diff --git test/fixedbugs/bug369.go test/fixedbugs/bug369.go -index e2a1147735..769364d503 100644 ---- test/fixedbugs/bug369.go -+++ test/fixedbugs/bug369.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js,!windows --// run -+// runtarget - - // Copyright 2011 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,21 +10,40 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(cmd ...string) { -+ if *target == "" { -+ run(cmd[0], cmd[1:]...) -+ } else { -+ run("go_"+*target+"_exec", cmd...) -+ } -+} -+ - func main() { -+ flag.Parse() - err := os.Chdir(filepath.Join(".", "fixedbugs", "bug369.dir")) - check(err) - -- run("go", "tool", "compile", "-N", "-o", "slow.o", "pkg.go") -- run("go", "tool", "compile", "-o", "fast.o", "pkg.go") -- run("go", "tool", "compile", "-o", "main.o", "main.go") -- run("go", "tool", "link", "-o", "a.exe", "main.o") -- run("." + string(filepath.Separator) + "a.exe") -+ run(goCmd(), "tool", "compile", "-N", "-o", "slow.o", "pkg.go") -+ run(goCmd(), "tool", "compile", "-o", "fast.o", "pkg.go") -+ run(goCmd(), "tool", "compile", "-o", "main.o", "main.go") -+ run(goCmd(), "tool", "link", "-o", "a.exe", "main.o") -+ goRun("." + string(filepath.Separator) + "a.exe") - - os.Remove("slow.o") - os.Remove("fast.o") -diff --git test/fixedbugs/bug429_run.go test/fixedbugs/bug429_run.go -index c6a02aae5e..30298de97b 100644 ---- test/fixedbugs/bug429_run.go -+++ test/fixedbugs/bug429_run.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,6 +10,7 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" -@@ -17,8 +18,27 @@ import ( - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- cmd := exec.Command("go", "run", filepath.Join("fixedbugs", "bug429.go")) -+ flag.Parse() -+ cmd := goRun(filepath.Join("fixedbugs", "bug429.go")) - out, err := cmd.CombinedOutput() - if err == nil { - fmt.Println("expected deadlock") -diff --git test/fixedbugs/issue10607.go test/fixedbugs/issue10607.go -index 9ee6c72bc6..e819a3085a 100644 ---- test/fixedbugs/issue10607.go -+++ test/fixedbugs/issue10607.go -@@ -1,5 +1,5 @@ - // +build linux,!ppc64 android --// run -+// runtarget - - // Copyright 2015 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,19 +11,39 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- test("internal") -+ flag.Parse() -+ //test("internal") - test("external") - } - - func test(linkmode string) { -- out, err := exec.Command("go", "run", "-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput() -+ out, err := goRun("-ldflags", "-B=0x12345678 -linkmode="+linkmode, filepath.Join("fixedbugs", "issue10607a.go")).CombinedOutput() - if err != nil { - fmt.Printf("BUG: linkmode=%s %v\n%s\n", linkmode, err, out) - os.Exit(1) -diff --git test/fixedbugs/issue11771.go test/fixedbugs/issue11771.go -index 99d7060d44..777cb7b9c4 100644 ---- test/fixedbugs/issue11771.go -+++ test/fixedbugs/issue11771.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2015 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,6 +11,7 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "io/ioutil" - "log" -@@ -19,8 +20,17 @@ import ( - "path/filepath" - "runtime" - ) -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} - - func main() { -+ flag.Parse() - if runtime.Compiler != "gc" { - return - } -@@ -52,7 +62,7 @@ func x() { - log.Fatal(err) - } - -- cmd := exec.Command("go", "tool", "compile", "x.go") -+ cmd := exec.Command(goCmd(), "tool", "compile", "x.go") - cmd.Dir = dir - output, err := cmd.CombinedOutput() - if err == nil { -diff --git test/fixedbugs/issue9355.go test/fixedbugs/issue9355.go -index 9657e64491..bad099f440 100644 ---- test/fixedbugs/issue9355.go -+++ test/fixedbugs/issue9355.go -@@ -1,4 +1,4 @@ --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -7,6 +7,7 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" -@@ -15,7 +16,17 @@ import ( - "runtime" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { -+ flag.Parse() - if runtime.Compiler != "gc" || runtime.GOOS == "nacl" || runtime.GOOS == "js" { - return - } -@@ -23,7 +34,7 @@ func main() { - err := os.Chdir(filepath.Join("fixedbugs", "issue9355.dir")) - check(err) - -- out := run("go", "tool", "compile", "-S", "a.go") -+ out := run(goCmd(), "tool", "compile", "-S", "a.go") - os.Remove("a.o") - - // 6g/8g print the offset as dec, but 5g/9g print the offset as hex. -diff --git test/fixedbugs/issue9862_run.go test/fixedbugs/issue9862_run.go -index 299e809545..02b8ea83c2 100644 ---- test/fixedbugs/issue9862_run.go -+++ test/fixedbugs/issue9862_run.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2015 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,12 +10,32 @@ - package main - - import ( -+ "flag" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -- out, err := exec.Command("go", "run", "fixedbugs/issue9862.go").CombinedOutput() -+ flag.Parse() -+ out, err := goRun("fixedbugs/issue9862.go").CombinedOutput() - outstr := string(out) - if err == nil { - println("go run issue9862.go succeeded, should have failed\n", outstr) -diff --git test/linkmain_run.go test/linkmain_run.go -index 68d53e8cad..0aa5e0fe2d 100644 ---- test/linkmain_run.go -+++ test/linkmain_run.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,12 +10,22 @@ - package main - - import ( -+ "flag" - "fmt" - "os" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func cleanup() { - os.Remove("linkmain.o") - os.Remove("linkmain.a") -@@ -51,16 +61,18 @@ func runFail(cmdline string) { - } - - func main() { -+ flag.Parse() -+ - // helloworld.go is package main -- run("go tool compile -o linkmain.o helloworld.go") -- run("go tool compile -pack -o linkmain.a helloworld.go") -- run("go tool link -o linkmain.exe linkmain.o") -- run("go tool link -o linkmain.exe linkmain.a") -+ run(goCmd() + " tool compile -o linkmain.o helloworld.go") -+ run(goCmd() + " tool compile -pack -o linkmain.a helloworld.go") -+ run(goCmd() + " tool link -o linkmain.exe linkmain.o") -+ run(goCmd() + " tool link -o linkmain.exe linkmain.a") - - // linkmain.go is not -- run("go tool compile -o linkmain1.o linkmain.go") -- run("go tool compile -pack -o linkmain1.a linkmain.go") -- runFail("go tool link -o linkmain.exe linkmain1.o") -- runFail("go tool link -o linkmain.exe linkmain1.a") -+ run(goCmd() + " tool compile -o linkmain1.o linkmain.go") -+ run(goCmd() + " tool compile -pack -o linkmain1.a linkmain.go") -+ runFail(goCmd() + " tool link -o linkmain.exe linkmain1.o") -+ runFail(goCmd() + " tool link -o linkmain.exe linkmain1.a") - cleanup() - } -diff --git test/linkobj.go test/linkobj.go -index 2902d23f4b..c17dfd3da9 100644 ---- test/linkobj.go -+++ test/linkobj.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2016 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -10,6 +10,7 @@ - package main - - import ( -+ "flag" - "fmt" - "io/ioutil" - "log" -@@ -18,9 +19,27 @@ import ( - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(cmd ...string) string { -+ if *target == "" { -+ return run(cmd...) -+ } else { -+ return run(append([]string{"go_"+*target+"_exec"}, cmd...)...) -+ } -+} -+ - var pwd, tmpdir string - - func main() { -+ flag.Parse() - dir, err := ioutil.TempDir("", "go-test-linkobj-") - if err != nil { - log.Fatal(err) -@@ -37,28 +56,28 @@ func main() { - - writeFile("p1.go", ` - package p1 -- -+ - func F() { - println("hello from p1") - } - `) - writeFile("p2.go", ` - package p2 -- -+ - import "./p1" - - func F() { - p1.F() - println("hello from p2") - } -- -+ - func main() {} - `) - writeFile("p3.go", ` - package main - - import "./p2" -- -+ - func main() { - p2.F() - println("hello from main") -@@ -76,9 +95,9 @@ func main() { - } - - // inlining is disabled to make sure that the link objects contain needed code. -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p1."+o, "-linkobj", "p1.lo", "p1.go") -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p2."+o, "-linkobj", "p2.lo", "p2.go") -- run("go", "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p3."+o, "-linkobj", "p3.lo", "p3.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p1."+o, "-linkobj", "p1.lo", "p1.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p2."+o, "-linkobj", "p2.lo", "p2.go") -+ run(goCmd(), "tool", "compile", pkg, "-D", ".", "-I", ".", "-l", "-o", "p3."+o, "-linkobj", "p3.lo", "p3.go") - - cp("p1."+o, "p1.oo") - cp("p2."+o, "p2.oo") -@@ -86,13 +105,13 @@ func main() { - cp("p1.lo", "p1."+o) - cp("p2.lo", "p2."+o) - cp("p3.lo", "p3."+o) -- out := runFail("go", "tool", "link", "p2."+o) -+ out := runFail(goCmd(), "tool", "link", "p2."+o) - if !strings.Contains(out, "not package main") { - fatalf("link p2.o failed but not for package main:\n%s", out) - } - -- run("go", "tool", "link", "-L", ".", "-o", "a.out.exe", "p3."+o) -- out = run("./a.out.exe") -+ run(goCmd(), "tool", "link", "-L", ".", "-o", "a.out.exe", "p3."+o) -+ out = goRun("./a.out.exe") - if !strings.Contains(out, "hello from p1\nhello from p2\nhello from main\n") { - fatalf("running main, incorrect output:\n%s", out) - } -diff --git test/linkx_run.go test/linkx_run.go -index ca9d31612a..631b95ee67 100644 ---- test/linkx_run.go -+++ test/linkx_run.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,20 +11,40 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "os" - "os/exec" - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goRun(args ...string) *exec.Cmd { -+ cmd := []string{"run"} -+ if *target != "" { -+ cmd = append(cmd, "-exec", "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, args...) -+ return exec.Command(goCmd(), cmd...) -+} -+ - func main() { -+ flag.Parse() - // test(" ") // old deprecated & removed syntax - test("=") // new syntax - } - - func test(sep string) { - // Successful run -- cmd := exec.Command("go", "run", "-ldflags=-X main.tbd"+sep+"hello -X main.overwrite"+sep+"trumped -X main.nosuchsymbol"+sep+"neverseen", "linkx.go") -+ cmd := goRun("-ldflags=-X main.tbd"+sep+"hello -X main.overwrite"+sep+"trumped -X main.nosuchsymbol"+sep+"neverseen", "linkx.go") - var out, errbuf bytes.Buffer - cmd.Stdout = &out - cmd.Stderr = &errbuf -@@ -44,7 +64,7 @@ func test(sep string) { - } - - // Issue 8810 -- cmd = exec.Command("go", "run", "-ldflags=-X main.tbd", "linkx.go") -+ cmd = goRun("-ldflags=-X main.tbd", "linkx.go") - _, err = cmd.CombinedOutput() - if err == nil { - fmt.Println("-X linker flag should not accept keys without values") -@@ -52,7 +72,7 @@ func test(sep string) { - } - - // Issue 9621 -- cmd = exec.Command("go", "run", "-ldflags=-X main.b=false -X main.x=42", "linkx.go") -+ cmd = goRun("-ldflags=-X main.b=false -X main.x=42", "linkx.go") - outx, err := cmd.CombinedOutput() - if err == nil { - fmt.Println("-X linker flag should not overwrite non-strings") -diff --git test/nosplit.go test/nosplit.go -index e6cd04e563..baeea80e37 100644 ---- test/nosplit.go -+++ test/nosplit.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -9,6 +9,7 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "io/ioutil" - "log" -@@ -21,6 +22,24 @@ import ( - "strings" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ -+func goArch() string { -+ goarch, err := exec.Command(goCmd(), "env", "GOARCH").Output() -+ if err != nil { -+ bug() -+ fmt.Printf("running go env GOARCH: %v\n", err) -+ } -+ return strings.TrimSpace(string(goarch)) -+} -+ - var tests = ` - # These are test cases for the linker analysis that detects chains of - # nosplit functions that would cause a stack overflow. -@@ -194,12 +213,13 @@ var ( - ) - - func main() { -- goarch := os.Getenv("GOARCH") -+ flag.Parse() -+ goarch := goArch() - if goarch == "" { -- goarch = runtime.GOARCH -+ return - } - -- version, err := exec.Command("go", "tool", "compile", "-V").Output() -+ version, err := exec.Command(goCmd(), "tool", "compile", "-V").Output() - if err != nil { - bug() - fmt.Printf("running go tool compile -V: %v\n", err) -@@ -345,7 +365,7 @@ TestCases: - log.Fatal(err) - } - -- cmd := exec.Command("go", "build") -+ cmd := exec.Command(goCmd(), "build") - cmd.Dir = dir - output, err := cmd.CombinedOutput() - if err == nil { -diff --git test/run.go test/run.go -index 2af3ee43ba..28c87c3583 100644 ---- test/run.go -+++ test/run.go -@@ -246,6 +246,16 @@ func goRun(runcmd runCmd, flags []string, goname string, args ...string) (out [] - } - - -+func goRunTarget(runcmd runCmd, goname string, args ...string) (out []byte, err error) { -+ cmd := []string{"go_local", "run"} -+ cmd = append(cmd, goname) -+ if *target != "" { -+ cmd = append(cmd, "-target", *target) -+ } -+ cmd = append(cmd, args...) -+ return runcmd(cmd...) -+} -+ - // skipError describes why a test was skipped. - type skipError string - -@@ -505,7 +515,7 @@ func (t *test) run() { - - // TODO: Clean up/simplify this switch statement. - switch action { -- case "compile", "compiledir", "build", "builddir", "buildrundir", "run", "buildrun", "runoutput", "rundir", "asmcheck": -+ case "compile", "compiledir", "build", "builddir", "buildrundir", "run", "runtarget", "buildrun", "runoutput", "rundir", "asmcheck": - // nothing to do - case "errorcheckandrundir": - wantError = false // should be no error if also will run -@@ -894,6 +904,17 @@ func (t *test) run() { - t.err = fmt.Errorf("incorrect output\n%s", out) - } - -+ case "runtarget": -+ useTmp = false -+ out, err := goRunTarget(runcmd, t.goFileName(), args...) -+ if err != nil { -+ t.err = err -+ return -+ } -+ if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { -+ t.err = fmt.Errorf("incorrect output\n%s", out) -+ } -+ - case "runoutput": - // Run Go file and write its output into temporary Go file. - // Run generated Go file and verify its output. -diff --git test/sinit_run.go test/sinit_run.go -index fdd19c492f..0b3cb76083 100644 ---- test/sinit_run.go -+++ test/sinit_run.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// run -+// runtarget - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -@@ -11,11 +11,21 @@ package main - - import ( - "bytes" -+ "flag" - "fmt" - "os" - "os/exec" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd() string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return "go" -+} -+ - func main() { - cmd := exec.Command("go", "tool", "compile", "-S", "sinit.go") - out, err := cmd.CombinedOutput() diff --git a/go/patch/go-1.11.2/go4.patch b/go/patch/go-1.11.2/go4.patch deleted file mode 100644 index 290de390..00000000 --- a/go/patch/go-1.11.2/go4.patch +++ /dev/null @@ -1,199 +0,0 @@ -runtime, crypto/x509: add -target flag. - ---- src/crypto/x509/x509_test.go -+++ src/crypto/x509/x509_test.go -@@ -13,29 +13,32 @@ import ( - "crypto/rsa" - _ "crypto/sha256" - _ "crypto/sha512" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/base64" - "encoding/hex" - "encoding/pem" -+ "flag" - "fmt" - "internal/testenv" - "math/big" - "net" - "net/url" - "os/exec" - "reflect" - "runtime" - "strings" - "testing" - "time" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ - func TestParsePKCS1PrivateKey(t *testing.T) { - block, _ := pem.Decode([]byte(pemPrivateKey)) - priv, err := ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - t.Errorf("Failed to parse private key: %s", err) - return - } - if priv.PublicKey.N.Cmp(rsaPrivateKey.PublicKey.N) != 0 || -@@ -1089,17 +1092,23 @@ func TestParsePEMCRL(t *testing.T) { - } - - // Can't check the signature here without a package cycle. - } - - func TestImports(t *testing.T) { - testenv.MustHaveGoRun(t) - -- if err := exec.Command(testenv.GoToolPath(t), "run", "x509_test_import.go").Run(); err != nil { -+ var cmd *exec.Cmd -+ if *target == "" { -+ cmd = exec.Command(testenv.GoToolPath(t), "run", "x509_test_import.go") -+ } else { -+ cmd = exec.Command("go_"+*target, "run", "-exec", "go_"+*target+"_exec", "x509_test_import.go") -+ } -+ if err := cmd.Run(); err != nil { - t.Errorf("failed to run x509_test_import.go: %s", err) - } - } - - const derCRLBase64 = "MIINqzCCDJMCAQEwDQYJKoZIhvcNAQEFBQAwVjEZMBcGA1UEAxMQUEtJIEZJTk1FQ0NBTklDQTEVMBMGA1UEChMMRklOTUVDQ0FOSUNBMRUwEwYDVQQLEwxGSU5NRUNDQU5JQ0ExCzAJBgNVBAYTAklUFw0xMTA1MDQxNjU3NDJaFw0xMTA1MDQyMDU3NDJaMIIMBzAhAg4Ze1od49Lt1qIXBydAzhcNMDkwNzE2MDg0MzIyWjAAMCECDl0HSL9bcZ1Ci/UHJ0DPFw0wOTA3MTYwODQzMTNaMAAwIQIOESB9tVAmX3cY7QcnQNAXDTA5MDcxNjA4NDUyMlowADAhAg4S1tGAQ3mHt8uVBydA1RcNMDkwODA0MTUyNTIyWjAAMCECDlQ249Y7vtC25ScHJ0DWFw0wOTA4MDQxNTI1MzdaMAAwIQIOISMop3NkA4PfYwcnQNkXDTA5MDgwNDExMDAzNFowADAhAg56/BMoS29KEShTBydA2hcNMDkwODA0MTEwMTAzWjAAMCECDnBp/22HPH5CSWoHJ0DbFw0wOTA4MDQxMDU0NDlaMAAwIQIOV9IP+8CD8bK+XAcnQNwXDTA5MDgwNDEwNTcxN1owADAhAg4v5aRz0IxWqYiXBydA3RcNMDkwODA0MTA1NzQ1WjAAMCECDlOU34VzvZAybQwHJ0DeFw0wOTA4MDQxMDU4MjFaMAAwIAINO4CD9lluIxcwBydBAxcNMDkwNzIyMTUzMTU5WjAAMCECDgOllfO8Y1QA7/wHJ0ExFw0wOTA3MjQxMTQxNDNaMAAwIQIOJBX7jbiCdRdyjgcnQUQXDTA5MDkxNjA5MzAwOFowADAhAg5iYSAgmDrlH/RZBydBRRcNMDkwOTE2MDkzMDE3WjAAMCECDmu6k6srP3jcMaQHJ0FRFw0wOTA4MDQxMDU2NDBa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TkZvd0dqQVlCZ05WDQpIUmdFRVJnUE1qQXdNakV3TWpNeE5EVXdNVFJhb0RBd0xqQWZCZ05WSFNNRUdEQVdnQlQxVERGNlVRTS9MTmVMDQpsNWx2cUhHUXEzZzltekFMQmdOVkhSUUVCQUlDQUlRd0RRWUpLb1pJaHZjTkFRRUZCUUFEZ1lFQUZVNUFzNk16DQpxNVBSc2lmYW9iUVBHaDFhSkx5QytNczVBZ2MwYld5QTNHQWR4dXI1U3BQWmVSV0NCamlQL01FSEJXSkNsQkhQDQpHUmNxNXlJZDNFakRrYUV5eFJhK2k2N0x6dmhJNmMyOUVlNks5cFNZd2ppLzdSVWhtbW5Qclh0VHhsTDBsckxyDQptUVFKNnhoRFJhNUczUUE0Q21VZHNITnZicnpnbUNZcHZWRT0NCi0tLS0tRU5EIFg1MDkgQ1JMLS0tLS0NCg0K" - ---- src/runtime/crash_cgo_test.go -+++ src/runtime/crash_cgo_test.go -@@ -279,17 +279,17 @@ func testCgoPprof(t *testing.T, buildArg, runArg string) { - } - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprogcgo", buildArg) - if err != nil { - t.Fatal(err) - } - -- got, err := testenv.CleanCmdEnv(exec.Command(exe, runArg)).CombinedOutput() -+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, runArg)).CombinedOutput() - if err != nil { - if testenv.Builder() == "linux-amd64-alpine" { - // See Issue 18243 and Issue 19938. - t.Skipf("Skipping failing test on Alpine (golang.org/issue/18243). Ignoring error: %v", err) - } - t.Fatal(err) - } - fn := strings.TrimSpace(string(got)) ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -17,16 +17,35 @@ import ( - "runtime" - "strconv" - "strings" - "sync" - "testing" - "time" - ) - -+var target = flag.String("target", "", "if non empty, use 'go_target' to compile test files and 'go_target_exec' to run the binaries") -+ -+func goCmd(t *testing.T) string { -+ if *target != "" { -+ return "go_" + *target -+ } -+ return testenv.GoToolPath(t) -+} -+ -+func goExecCmd(name string, arg ...string) *exec.Cmd { -+ var cmd []string -+ if *target != "" { -+ cmd = append(cmd, "go_"+*target+"_exec") -+ } -+ cmd = append(cmd, name) -+ cmd = append(cmd, arg...) -+ return exec.Command(cmd[0], cmd[1:]...) -+} -+ - var toRemove []string - - func TestMain(m *testing.M) { - status := m.Run() - for _, file := range toRemove { - os.RemoveAll(file) - } - os.Exit(status) -@@ -50,17 +69,17 @@ func runTestProg(t *testing.T, binary, name string, env ...string) string { - - testenv.MustHaveGoBuild(t) - - exe, err := buildTestProg(t, binary) - if err != nil { - t.Fatal(err) - } - -- cmd := testenv.CleanCmdEnv(exec.Command(exe, name)) -+ cmd := testenv.CleanCmdEnv(goExecCmd(exe, name)) - cmd.Env = append(cmd.Env, env...) - if testing.Short() { - cmd.Env = append(cmd.Env, "RUNTIME_TEST_SHORT=1") - } - var b bytes.Buffer - cmd.Stdout = &b - cmd.Stderr = &b - if err := cmd.Start(); err != nil { -@@ -125,17 +144,17 @@ func buildTestProg(t *testing.T, binary string, flags ...string) (string, error) - name += "_" + strings.Join(flags, "_") - } - target, ok := testprog.target[name] - if ok { - return target.exe, target.err - } - - exe := filepath.Join(testprog.dir, name+".exe") -- cmd := exec.Command(testenv.GoToolPath(t), append([]string{"build", "-o", exe}, flags...)...) -+ cmd := exec.Command(goCmd(t), append([]string{"build", "-o", exe}, flags...)...) - cmd.Dir = "testdata/" + binary - out, err := testenv.CleanCmdEnv(cmd).CombinedOutput() - if err != nil { - target.err = fmt.Errorf("building %s %v: %v\n%s", binary, flags, err, out) - testprog.target[name] = target - return "", target.err - } - target.exe = exe -@@ -456,17 +475,17 @@ func TestPanicLoop(t *testing.T) { - func TestMemPprof(t *testing.T) { - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } - -- got, err := testenv.CleanCmdEnv(exec.Command(exe, "MemProf")).CombinedOutput() -+ got, err := testenv.CleanCmdEnv(goExecCmd(exe, "MemProf")).CombinedOutput() - if err != nil { - t.Fatal(err) - } - fn := strings.TrimSpace(string(got)) - defer os.Remove(fn) - - for try := 0; try < 2; try++ { - cmd := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "tool", "pprof", "-alloc_space", "-top")) ---- src/runtime/crash_unix_test.go -+++ src/runtime/crash_unix_test.go -@@ -244,17 +244,17 @@ func testPanicSystemstackInternal() { - } - - func TestSignalExitStatus(t *testing.T) { - testenv.MustHaveGoBuild(t) - exe, err := buildTestProg(t, "testprog") - if err != nil { - t.Fatal(err) - } -- err = testenv.CleanCmdEnv(exec.Command(exe, "SignalExitStatus")).Run() -+ err = testenv.CleanCmdEnv(goExecCmd(exe, "SignalExitStatus")).Run() - if err == nil { - t.Error("test program succeeded unexpectedly") - } else if ee, ok := err.(*exec.ExitError); !ok { - t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err) - } else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok { - t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys()) - } else if !ws.Signaled() || ws.Signal() != syscall.SIGTERM { - t.Errorf("got %v; expected SIGTERM", ee) diff --git a/go/patch/go-1.11.2/go5.patch b/go/patch/go-1.11.2/go5.patch deleted file mode 100644 index c0807e9b..00000000 --- a/go/patch/go-1.11.2/go5.patch +++ /dev/null @@ -1,106 +0,0 @@ -diff --git src/runtime/crash_test.go src/runtime/crash_test.go -index 81cf5df42d..3607992788 100644 ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -219,22 +219,27 @@ func testDeadlock(t *testing.T, name string) { - } - - func TestSimpleDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "SimpleDeadlock") - } - - func TestInitDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "InitDeadlock") - } - - func TestLockedDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "LockedDeadlock") - } - - func TestLockedDeadlock2(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - testDeadlock(t, "LockedDeadlock2") - } - - func TestGoexitDeadlock(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "GoexitDeadlock") - want := "no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.Contains(output, want) { -@@ -271,6 +276,7 @@ panic: again - } - - func TestGoexitCrash(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "GoexitExit") - want := "no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.Contains(output, want) { -@@ -329,6 +335,7 @@ func TestBreakpoint(t *testing.T) { - } - - func TestGoexitInPanic(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - // see issue 8774: this code used to trigger an infinite recursion - output := runTestProg(t, "testprog", "GoexitInPanic") - want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!" -@@ -393,6 +400,7 @@ func TestPanicAfterGoexit(t *testing.T) { - } - - func TestRecoveredPanicAfterGoexit(t *testing.T) { -+ t.Skip("deadlock detection fails with external linker") - output := runTestProg(t, "testprog", "RecoveredPanicAfterGoexit") - want := "fatal error: no goroutines (main called runtime.Goexit) - deadlock!" - if !strings.HasPrefix(output, want) { -diff --git src/runtime/proc_test.go src/runtime/proc_test.go -index ad325987ac..d9d6feb498 100644 ---- src/runtime/proc_test.go -+++ src/runtime/proc_test.go -@@ -373,9 +373,10 @@ func TestGCFairness2(t *testing.T) { - - func TestNumGoroutine(t *testing.T) { - output := runTestProg(t, "testprog", "NumGoroutine") -- want := "1\n" -- if output != want { -- t.Fatalf("want %q, got %q", want, output) -+ want1 := "1\n" -+ want2 := "2\n" -+ if output != want1 && out != want2 { -+ t.Fatalf("want %q, got %q", want1, output) - } - - buf := make([]byte, 1<<20) -diff --git test/fixedbugs/bug429_run.go test/fixedbugs/bug429_run.go -index 30298de97b..3301a11ad9 100644 ---- test/fixedbugs/bug429_run.go -+++ test/fixedbugs/bug429_run.go -@@ -1,5 +1,5 @@ - // +build !nacl,!js --// runtarget -+// skip - - // Copyright 2014 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style -diff --git test/goprint.go test/goprint.go -index 57eeac53a8..5951d4694f 100644 ---- test/goprint.go -+++ test/goprint.go -@@ -8,14 +8,9 @@ - - package main - --import ( -- "runtime" -- "time" --) -+import "time" - - func main() { - go println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255)) -- for runtime.NumGoroutine() > 1 { -- time.Sleep(10*time.Millisecond) -- } -+ time.Sleep(100*time.Millisecond) - } diff --git a/go/patch/go-1.11.2/go6.patch b/go/patch/go-1.11.2/go6.patch deleted file mode 100644 index 04134c77..00000000 --- a/go/patch/go-1.11.2/go6.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff --git src/encoding/gob/encoder_test.go src/encoding/gob/encoder_test.go -index dc9bbcf35d..10c30a91af 100644 ---- src/encoding/gob/encoder_test.go -+++ src/encoding/gob/encoder_test.go -@@ -1131,13 +1131,7 @@ func TestBadData(t *testing.T) { - - // TestHugeWriteFails tests that enormous messages trigger an error. - func TestHugeWriteFails(t *testing.T) { -- if runtime.GOARCH == "wasm" { -- t.Skip("out of memory on wasm") -- } -- if testing.Short() { -- // Requires allocating a monster, so don't do this from all.bash. -- t.Skip("skipping huge allocation in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - huge := make([]byte, tooBig) - huge[0] = 7 // Make sure it's not all zeros. - buf := new(bytes.Buffer) -diff --git src/runtime/crash_cgo_test.go src/runtime/crash_cgo_test.go -index 9ff4bbe121..5fa1340cb2 100644 ---- src/runtime/crash_cgo_test.go -+++ src/runtime/crash_cgo_test.go -@@ -238,14 +238,7 @@ func TestCgoCCodeSIGPROF(t *testing.T) { - } - - func TestCgoCrashTraceback(t *testing.T) { -- t.Parallel() -- switch platform := runtime.GOOS + "/" + runtime.GOARCH; platform { -- case "darwin/amd64": -- case "linux/amd64": -- case "linux/ppc64le": -- default: -- t.Skipf("not yet supported on %s", platform) -- } -+ t.Skipf("skip running remotely") - got := runTestProg(t, "testprogcgo", "CrashTraceback") - for i := 1; i <= 3; i++ { - if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) { -@@ -264,10 +257,7 @@ func TestCgoTracebackContext(t *testing.T) { - } - - func testCgoPprof(t *testing.T, buildArg, runArg string) { -- t.Parallel() -- if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") { -- t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) -- } -+ t.Skipf("skip pprof test") - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprogcgo", buildArg) -diff --git src/runtime/crash_test.go src/runtime/crash_test.go -index 3607992788..e53ffb6a81 100644 ---- src/runtime/crash_test.go -+++ src/runtime/crash_test.go -@@ -481,6 +481,7 @@ func TestPanicLoop(t *testing.T) { - } - - func TestMemPprof(t *testing.T) { -+ t.Skipf("skip pprof test") - testenv.MustHaveGoRun(t) - - exe, err := buildTestProg(t, "testprog") -diff --git src/runtime/crash_unix_test.go src/runtime/crash_unix_test.go -index 02891ec1ad..fd2723f16e 100644 ---- src/runtime/crash_unix_test.go -+++ src/runtime/crash_unix_test.go -@@ -174,9 +174,7 @@ func TestPanicSystemstack(t *testing.T) { - // The GOTRACEBACK=crash handler takes 0.1 seconds even if - // it's not writing a core file and potentially much longer if - // it is. Skip in short mode. -- if testing.Short() { -- t.Skip("Skipping in short mode (GOTRACEBACK=crash is slow)") -- } -+ t.Skip("Skipping (GOTRACEBACK=crash hangs on arm)") - - if runtime.Sigisblocked(int(syscall.SIGQUIT)) { - t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196") -@@ -244,6 +242,7 @@ func testPanicSystemstackInternal() { - } - - func TestSignalExitStatus(t *testing.T) { -+ t.Skipf("skip running remotely") - testenv.MustHaveGoBuild(t) - exe, err := buildTestProg(t, "testprog") - if err != nil { -diff --git src/runtime/fastlog2_test.go src/runtime/fastlog2_test.go -index ae0f40b2bb..a93933d7ac 100644 ---- src/runtime/fastlog2_test.go -+++ src/runtime/fastlog2_test.go -@@ -16,11 +16,7 @@ func TestFastLog2(t *testing.T) { - const randomBitCount = 26 - var e float64 - -- inc := 1 -- if testing.Short() { -- // Check 1K total values, down from 64M. -- inc = 1 << 16 -- } -+ inc := 1 << 16 - for i := 1; i < 1<<randomBitCount; i += inc { - l, fl := math.Log2(float64(i)), runtime.Fastlog2(float64(i)) - d := l - fl -diff --git src/runtime/hash_test.go src/runtime/hash_test.go -index 7b8ebc4f3c..9fc5b995fc 100644 ---- src/runtime/hash_test.go -+++ src/runtime/hash_test.go -@@ -164,9 +164,7 @@ func TestSmhasherTwoNonzero(t *testing.T) { - if GOARCH == "wasm" { - t.Skip("Too slow on wasm") - } -- if testing.Short() { -- t.Skip("Skipping in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - h := newHashSet() - for n := 2; n <= 16; n++ { - twoNonZero(h, n) -@@ -273,9 +271,7 @@ func TestSmhasherPermutation(t *testing.T) { - if GOARCH == "wasm" { - t.Skip("Too slow on wasm") - } -- if testing.Short() { -- t.Skip("Skipping in short mode") -- } -+ t.Skip("skipping test due to huge memory requirement") - permutation(t, []uint32{0, 1, 2, 3, 4, 5, 6, 7}, 8) - permutation(t, []uint32{0, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}, 8) - permutation(t, []uint32{0, 1}, 20) -diff --git src/runtime/pprof/pprof_test.go src/runtime/pprof/pprof_test.go -index 44d514393e..f46f00894c 100644 ---- src/runtime/pprof/pprof_test.go -+++ src/runtime/pprof/pprof_test.go -@@ -283,14 +283,7 @@ func profileOk(t *testing.T, need []string, prof bytes.Buffer, duration time.Dur - func TestCPUProfileWithFork(t *testing.T) { - testenv.MustHaveExec(t) - -- heap := 1 << 30 -- if runtime.GOOS == "android" { -- // Use smaller size for Android to avoid crash. -- heap = 100 << 20 -- } -- if testing.Short() { -- heap = 100 << 20 -- } -+ heap = 100 << 20 - // This makes fork slower. - garbage := make([]byte, heap) - // Need to touch the slice, otherwise it won't be paged in. |