aboutsummaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
Diffstat (limited to 'go')
-rwxr-xr-xgo/chromeos/build_go11
-rwxr-xr-xgo/chromeos/go_chell11
-rwxr-xr-xgo/chromeos/go_chell_exec12
-rwxr-xr-xgo/chromeos/go_elm11
-rwxr-xr-xgo/chromeos/go_elm3211
-rwxr-xr-xgo/chromeos/go_elm32_exec12
-rwxr-xr-xgo/chromeos/go_elm_exec12
-rwxr-xr-xgo/chromeos/push_glibc4
-rwxr-xr-xgo/chromeos/setup_chromeos_testing.py250
-rwxr-xr-xgo/chromeos/target_cp4
-rwxr-xr-xgo/chromeos/target_sh2
-rw-r--r--go/patch/go-1.10.3/go0.patch27
-rw-r--r--go/patch/go-1.10.3/go1.patch50
-rw-r--r--go/patch/go-1.10.3/go2.patch267
-rw-r--r--go/patch/go-1.10.3/go3.patch732
-rw-r--r--go/patch/go-1.10.3/go4.patch199
-rw-r--r--go/patch/go-1.10.3/go5.patch106
-rw-r--r--go/patch/go-1.10.3/go6.patch142
-rw-r--r--go/patch/go-1.11.2/go0.patch27
-rw-r--r--go/patch/go-1.11.2/go1.patch50
-rw-r--r--go/patch/go-1.11.2/go2.patch277
-rw-r--r--go/patch/go-1.11.2/go3.patch730
-rw-r--r--go/patch/go-1.11.2/go4.patch199
-rw-r--r--go/patch/go-1.11.2/go5.patch106
-rw-r--r--go/patch/go-1.11.2/go6.patch149
-rw-r--r--go/patch/go0.patch (renamed from go/patch/go-1.10.2/go0.patch)0
-rw-r--r--go/patch/go1.patch (renamed from go/patch/go-1.10.2/go1.patch)0
-rw-r--r--go/patch/go2.patch (renamed from go/patch/go-1.10.2/go2.patch)0
-rw-r--r--go/patch/go3.patch (renamed from go/patch/go-1.10.2/go3.patch)0
-rw-r--r--go/patch/go4.patch (renamed from go/patch/go-1.10.2/go4.patch)0
-rw-r--r--go/patch/go5.patch (renamed from go/patch/go-1.10.2/go5.patch)0
-rw-r--r--go/patch/go6.patch (renamed from go/patch/go-1.10.2/go6.patch)0
32 files changed, 79 insertions, 3322 deletions
diff --git a/go/chromeos/build_go b/go/chromeos/build_go
index 0dec7dfd..164ea3f7 100755
--- a/go/chromeos/build_go
+++ b/go/chromeos/build_go
@@ -6,8 +6,7 @@ set -e -o pipefail
# Usage: build_go
#
# It assumes that the "x86_64-cros-linux-gnu" toolchain is already installed.
-# It assumes that the "armv7a-cros-linux-gnueabihf" toolchain is
-# already installed.
+# It assumes that the "armv7a-cros-linux-gnueabi" toolchain is already installed.
# It assumes that the "aarch64-cros-linux-gnu" toolchain is already installed.
if [[ ! -e "make.bash" && -e "src/make.bash" ]]
@@ -27,12 +26,12 @@ GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" \
# Build the Go toolchain for arm targets.
GOOS="linux" GOARCH="arm" CGO_ENABLED="1" \
- CC_FOR_TARGET="armv7a-cros-linux-gnueabihf-clang" \
- CXX_FOR_TARGET="armv7a-cros-linux-gnueabihf-clang++" \
+ CC_FOR_TARGET="armv7a-cros-linux-gnueabi-clang" \
+ CXX_FOR_TARGET="armv7a-cros-linux-gnueabi-clang++" \
./make.bash --no-clean
GOOS="linux" GOARCH="arm" CGO_ENABLED="1" \
- CC="armv7a-cros-linux-gnueabihf-clang" \
- CXX="armv7a-cros-linux-gnueabihf-clang++" \
+ CC="armv7a-cros-linux-gnueabi-clang" \
+ CXX="armv7a-cros-linux-gnueabi-clang++" \
../bin/go install -v -buildmode=pie std
# Build the Go toolchain for arm64 targets.
diff --git a/go/chromeos/go_chell b/go/chromeos/go_chell
new file mode 100755
index 00000000..ca6a7dba
--- /dev/null
+++ b/go/chromeos/go_chell
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Invoke the Go cross compiler for chell.
+# Uses ../go_target to add PIE flags.
+#
+# This is just an example for an amd64 board.
+
+GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" \
+ CC="x86_64-cros-linux-gnu-clang" \
+ CXX="x86_64-cros-linux-gnu-clang++" \
+ exec go_target "$@"
diff --git a/go/chromeos/go_chell_exec b/go/chromeos/go_chell_exec
new file mode 100755
index 00000000..8fac94bd
--- /dev/null
+++ b/go/chromeos/go_chell_exec
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Copy and remotely execute a binary on the chell device.
+#
+# For this to work, the corresponding entry must exist in
+# ~/.ssh/config and the device must already be setup for
+# password-less authentication. See setup instructions at
+# http://go/chromeos-toolchain-team/go-toolchain
+
+GOOS="linux" GOARCH="amd64" \
+ GOLOADER="/tmp/glibc/ld.so" \
+ exec go_target_exec chell "$@"
diff --git a/go/chromeos/go_elm b/go/chromeos/go_elm
new file mode 100755
index 00000000..a92d9c64
--- /dev/null
+++ b/go/chromeos/go_elm
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Invoke the Go cross compiler for elm.
+# Uses ../go_target to add PIE flags.
+#
+# This is just an example for an arm64 board.
+
+GOOS="linux" GOARCH="arm64" CGO_ENABLED="1" \
+ CC="aarch64-cros-linux-gnu-clang" \
+ CXX="aarch64-cros-linux-gnu-clang++" \
+ exec go_target "$@"
diff --git a/go/chromeos/go_elm32 b/go/chromeos/go_elm32
new file mode 100755
index 00000000..2bcb3f3b
--- /dev/null
+++ b/go/chromeos/go_elm32
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Invoke the Go cross compiler for elm32.
+# Uses ../go_target to add PIE flags.
+#
+# This is just an example for an arm board.
+
+GOOS="linux" GOARCH="arm" CGO_ENABLED="1" \
+ CC="armv7a-cros-linux-gnueabi-clang" \
+ CXX="armv7a-cros-linux-gnueabi-clang++" \
+ exec go_target "$@"
diff --git a/go/chromeos/go_elm32_exec b/go/chromeos/go_elm32_exec
new file mode 100755
index 00000000..3e115a9a
--- /dev/null
+++ b/go/chromeos/go_elm32_exec
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Copy and remotely execute a binary on the elm32 device.
+#
+# For this to work, the corresponding entry must exist in
+# ~/.ssh/config and the device must already be setup for
+# password-less authentication. See setup instructions at
+# http://go/chromeos-toolchain-team/go-toolchain
+
+GOOS="linux" GOARCH="arm" \
+ GOLOADER="/tmp/glibc32/ld.so" \
+ exec go_target_exec elm32 "$@"
diff --git a/go/chromeos/go_elm_exec b/go/chromeos/go_elm_exec
new file mode 100755
index 00000000..da244c2e
--- /dev/null
+++ b/go/chromeos/go_elm_exec
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Copy and remotely execute a binary on the elm device.
+#
+# For this to work, the corresponding entry must exist in
+# ~/.ssh/config and the device must already be setup for
+# password-less authentication. See setup instructions at
+# http://go/chromeos-toolchain-team/go-toolchain
+
+GOOS="linux" GOARCH="arm64" \
+ GOLOADER="/tmp/glibc/ld.so" \
+ exec go_target_exec elm "$@"
diff --git a/go/chromeos/push_glibc b/go/chromeos/push_glibc
index 8211d9d5..7528284c 100755
--- a/go/chromeos/push_glibc
+++ b/go/chromeos/push_glibc
@@ -13,7 +13,7 @@ set -e -o pipefail
for target in "$@"
do
echo -n "pushing glibc to ${target} ... "
- case "$(ssh -i ${HOME}/.ssh/testing_rsa ${target} uname -m)" in
+ case "$(ssh ${target} uname -m)" in
x86_64)
glibc="/usr/x86_64-cros-linux-gnu/lib64"
loader="ld-linux-x86-64.so.2"
@@ -23,7 +23,7 @@ do
aarch64)
glibc="/usr/aarch64-cros-linux-gnu/lib64"
loader="ld-linux-aarch64.so.1"
- glibc32="/usr/armv7a-cros-linux-gnueabihf/lib"
+ glibc32="/usr/armv7a-cros-linux-gnueabi/lib"
loader32="ld-linux-armhf.so.3"
;;
*)
diff --git a/go/chromeos/setup_chromeos_testing.py b/go/chromeos/setup_chromeos_testing.py
deleted file mode 100755
index b679ddfc..00000000
--- a/go/chromeos/setup_chromeos_testing.py
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
-#
-# Copyright 2018 Google Inc. All Rightes Reserved
-"""Generate board-specific scripts for Go compiler testing."""
-
-from __future__ import print_function
-
-import argparse
-import getpass
-import os
-import sys
-
-from cros_utils import command_executer
-
-SUCCESS = 0
-DEBUG = False
-
-ARCH_DATA = {'x86_64': 'amd64', 'arm32': 'arm', 'arm64': 'arm64'}
-
-CROS_TOOLCHAIN_DATA = {
- 'x86_64': 'x86_64-cros-linux-gnu',
- 'arm32': 'armv7a-cros-linux-gnueabihf',
- 'arm64': 'aarch64-cros-linux-gnu'
-}
-
-GLIBC_DATA = {'x86_64': 'glibc', 'arm32': 'glibc32', 'arm64': 'glibc'}
-
-CONFIG_TEMPLATE = """
-Host %s
- HostName %s
- User root
- UserKnownHostsFile /dev/null
- BatchMode yes
- CheckHostIP no
- StrictHostKeyChecking no
- IdentityFile %%d/.ssh/testing_rsa
-"""
-
-BASE_TEMPLATE = """#!/bin/bash
-
-# Invoke the Go cross compiler for %s.
-# Uses ../go_target to add PIE flags.
-#
-# This is just an example for an %s board.
-
-GOOS="linux" GOARCH="%s" CGO_ENABLED="1" \\
- GOROOT="/usr/lib/go/%s" \\
- CC="%s-clang" \\
- CXX="%s-clang++" \\
- exec go_target "$@"
-"""
-
-EXEC_TEMPLATE = """#!/bin/bash
-
-# Copy and remotely execute a binary on the %s device.
-#
-# For this to work, the corresponding entry must exist in
-# ~/.ssh/config and the device must already be setup for
-# password-less authentication. See setup instructions at
-# http://go/chromeos-toolchain-team/go-toolchain
-
-GOOS="linux" GOARCH="%s" \\
- GOLOADER="/tmp/%s/ld.so" \\
- exec go_target_exec %s "$@"
-"""
-
-
-def log(msg):
-
- if DEBUG:
- print(msg)
-
-
-def WriteFile(file_content, file_name):
- with open(file_name, 'w') as out_file:
- out_file.write(file_content)
-
-
-def GenerateGoHelperScripts(ce, arm_board, x86_board, chromeos_root):
- keys = ['x86_64', 'arm32', 'arm64']
- names = {
- 'x86_64': x86_board,
- 'arm64': arm_board,
- 'arm32': ("%s32" % arm_board)
- }
-
- toolchain_dir = os.path.join(chromeos_root, 'src', 'third_party',
- 'toolchain-utils', 'go', 'chromeos')
- for k in keys:
- name = names[k]
- arch = ARCH_DATA[k]
- toolchain = CROS_TOOLCHAIN_DATA[k]
- glibc = GLIBC_DATA[k]
-
- base_file = os.path.join(toolchain_dir, ("go_%s" % name))
- base_file_content = BASE_TEMPLATE % (name, arch, arch, toolchain, toolchain,
- toolchain)
- WriteFile(base_file_content, base_file)
- cmd = "chmod 755 %s" % base_file
- ce.RunCommand(cmd)
-
- exec_file = os.path.join(toolchain_dir, ("go_%s_exec" % name))
- exec_file_content = EXEC_TEMPLATE % (name, arch, glibc, name)
- WriteFile(exec_file_content, exec_file)
- cmd = "chmod 755 %s" % exec_file
- ce.RunCommand(cmd)
-
- return 0
-
-
-def UpdateChrootSshConfig(ce, arm_board, arm_dut, x86_board, x86_dut,
- chromeos_root):
- log("Entering UpdateChrootSshConfig")
- # Copy testing_rsa to .ssh and set file protections properly.
- user = getpass.getuser()
- ssh_dir = os.path.join(chromeos_root, 'chroot', 'home', user, '.ssh')
- dest_file = os.path.join(ssh_dir, 'testing_rsa')
- src_file = os.path.join(chromeos_root, 'src', 'scripts',
- 'mod_for_test_scripts', 'testing_rsa')
- if not os.path.exists(dest_file):
- if os.path.exists(src_file):
- cmd = 'cp %s %s' % (src_file, dest_file)
- ret = ce.RunCommand(cmd)
- if ret != SUCCESS:
- print('Error executing "%s". Exiting now...' % cmd)
- sys.exit(1)
- cmd = 'chmod 600 %s' % dest_file
- ret = ce.RunCommand(cmd)
- if ret != SUCCESS:
- print('Error executing %s; may need to re-run this manually.' % cmd)
- else:
- print('Cannot find %s; you will need to update testing_rsa by hand.' %
- src_file)
- else:
- log("testing_rsa exists already.")
-
- # Save ~/.ssh/config file, if not already done.
- config_file = os.path.expanduser("~/.ssh/config")
- saved_config_file = os.path.join(
- os.path.expanduser("~/.ssh"), "config.save.go-scripts")
- if not os.path.exists(saved_config_file):
- cmd = "cp %s %s" % (config_file, saved_config_file)
- ret = ce.RunCommand(cmd)
- if ret != SUCCESS:
- print("Error making save copy of ~/.ssh/config. Exiting...")
- sys.exit(1)
-
- # Update ~/.ssh/config file
- log("Reading ssh config file")
- with open(config_file, "r") as input_file:
- config_lines = input_file.read()
-
- x86_host_config = CONFIG_TEMPLATE % (x86_board, x86_dut)
- arm_names = '%s %s32' % (arm_board, arm_board)
- arm_host_config = CONFIG_TEMPLATE % (arm_names, arm_dut)
-
- config_lines += x86_host_config
- config_lines += arm_host_config
-
- log("Writing ~/.ssh/config")
- WriteFile(config_lines, config_file)
-
- return 0
-
-
-def CleanUp(ce, x86_board, arm_board, chromeos_root):
- # Find and remove go helper scripts
- keys = ['x86_64', 'arm32', 'arm64']
- names = {
- 'x86_64': x86_board,
- 'arm64': arm_board,
- 'arm32': ("%s32" % arm_board)
- }
-
- toolchain_dir = os.path.join(chromeos_root, 'src', 'third_party',
- 'toolchain-utils', 'go', 'chromeos')
- for k in keys:
- name = names[k]
- base_file = os.path.join(toolchain_dir, ("go_%s" % name))
- exec_file = os.path.join(toolchain_dir, ("go_%s_exec" % name))
- cmd = ('rm -f %s; rm -f %s' % (base_file, exec_file))
- ce.RunCommand(cmd)
-
- # Restore saved config_file
- config_file = os.path.expanduser("~/.ssh/config")
- saved_config_file = os.path.join(
- os.path.expanduser("~/.ssh"), "config.save.go-scripts")
- if not os.path.exists(saved_config_file):
- print("Could not find file: %s; unable to restore ~/.ssh/config ." %
- saved_config_file)
- else:
- cmd = "mv %s %s" % (saved_config_file, config_file)
- ce.RunCommand(cmd)
-
- return 0
-
-
-def Main(argv):
- # pylint: disable=global-statement
- global DEBUG
-
- parser = argparse.ArgumentParser()
- parser.add_argument('-a', '--arm64_board', dest='arm_board', required=True)
- parser.add_argument(
- '-b', '--x86_64_board', dest='x86_64_board', required=True)
- parser.add_argument(
- '-c', '--chromeos_root', dest='chromeos_root', required=True)
- parser.add_argument('-x', '--x86_64_dut', dest='x86_64_dut', required=True)
- parser.add_argument('-y', '--arm64_dut', dest='arm_dut', required=True)
- parser.add_argument(
- '-z', '--cleanup', dest='cleanup', default=False, action='store_true')
- parser.add_argument(
- '-v', '--verbose', dest='verbose', default=False, action='store_true')
-
- options = parser.parse_args(argv[1:])
-
- if options.verbose:
- DEBUG = True
-
- if not os.path.exists(options.chromeos_root):
- print("Invalid ChromeOS Root: %s" % options.chromeos_root)
-
- ce = command_executer.GetCommandExecuter()
- all_good = True
- for m in (options.x86_64_dut, options.arm_dut):
- cmd = 'ping -c 3 %s > /dev/null' % m
- ret = ce.RunCommand(cmd)
- if ret != SUCCESS:
- print('Machine %s is currently not responding to ping.' % m)
- all_good = False
-
- if not all_good:
- return 1
-
- if not options.cleanup:
- UpdateChrootSshConfig(ce, options.arm_board, options.arm_dut,
- options.x86_64_board, options.x86_64_dut,
- options.chromeos_root)
- GenerateGoHelperScripts(ce, options.arm_board, options.x86_64_board,
- options.chromeos_root)
- else:
- CleanUp(ce, options.x86_64_board, options.arm_board, options.chromeos_root)
-
- return 0
-
-
-if __name__ == "__main__":
- val = Main(sys.argv)
- sys.exit(val)
diff --git a/go/chromeos/target_cp b/go/chromeos/target_cp
index 10f4bf72..8e0c4055 100755
--- a/go/chromeos/target_cp
+++ b/go/chromeos/target_cp
@@ -22,7 +22,7 @@ fi
if [[ -d ${src} ]]
then
- tar -C $(dirname ${src}) -zcf - $(basename ${src}) | ssh -i ${HOME}/.ssh/testing_rsa ${target} "tar -C ${dest} -zxf -"
+ tar -C $(dirname ${src}) -zcf - $(basename ${src}) | ssh ${target} "tar -C ${dest} -zxf -"
else
- scp -i ${HOME}/.ssh/testing_rsa -q ${src} ${target}:${dest}
+ scp -q ${src} ${target}:${dest}
fi
diff --git a/go/chromeos/target_sh b/go/chromeos/target_sh
index 4c56252e..43c5fac6 100755
--- a/go/chromeos/target_sh
+++ b/go/chromeos/target_sh
@@ -8,4 +8,4 @@ set -e -o pipefail
target="$1"
shift
-ssh -i ${HOME}/.ssh/testing_rsa ${target} "$*"
+ssh ${target} "$*"
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/UHJ0DPFw0wOTA3MTYwODQzMTNaMAAwIQIOESB9tVAmX3cY7QcnQNAXDTA5MDcxNjA4NDUyMlowADAhAg4S1tGAQ3mHt8uVBydA1RcNMDkwODA0MTUyNTIyWjAAMCECDlQ249Y7vtC25ScHJ0DWFw0wOTA4MDQxNTI1MzdaMAAwIQIOISMop3NkA4PfYwcnQNkXDTA5MDgwNDExMDAzNFowADAhAg56/BMoS29KEShTBydA2hcNMDkwODA0MTEwMTAzWjAAMCECDnBp/22HPH5CSWoHJ0DbFw0wOTA4MDQxMDU0NDlaMAAwIQIOV9IP+8CD8bK+XAcnQNwXDTA5MDgwNDEwNTcxN1owADAhAg4v5aRz0IxWqYiXBydA3RcNMDkwODA0MTA1NzQ1WjAAMCECDlOU34VzvZAybQwHJ0DeFw0wOTA4MDQxMDU4MjFaMAAwIAINO4CD9lluIxcwBydBAxcNMDkwNzIyMTUzMTU5WjAAMCECDgOllfO8Y1QA7/wHJ0ExFw0wOTA3MjQxMTQxNDNaMAAwIQIOJBX7jbiCdRdyjgcnQUQXDTA5MDkxNjA5MzAwOFowADAhAg5iYSAgmDrlH/RZBydBRRcNMDkwOTE2MDkzMDE3WjAAMCECDmu6k6srP3jcMaQHJ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NTVhEVEF5TVRBeU16RTBOVEF4TkZvd0dqQVlCZ05WDQpIUmdFRVJnUE1qQXdNakV3TWpNeE5EVXdNVFJhb0RBd0xqQWZCZ05WSFNNRUdEQVdnQlQxVERGNlVRTS9MTmVMDQpsNWx2cUhHUXEzZzltekFMQmdOVkhSUUVCQUlDQUlRd0RRWUpLb1pJaHZjTkFRRUZCUUFEZ1lFQUZVNUFzNk16DQpxNVBSc2lmYW9iUVBHaDFhSkx5QytNczVBZ2MwYld5QTNHQWR4dXI1U3BQWmVSV0NCamlQL01FSEJXSkNsQkhQDQpHUmNxNXlJZDNFakRrYUV5eFJhK2k2N0x6dmhJNmMyOUVlNks5cFNZd2ppLzdSVWhtbW5Qclh0VHhsTDBsckxyDQptUVFKNnhoRFJhNUczUUE0Q21VZHNITnZicnpnbUNZcHZWRT0NCi0tLS0tRU5EIFg1MDkgQ1JMLS0tLS0NCg0K"
-
---- 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 = "MIINqzCCDJMCAQEwDQYJKoZIhvcNAQEFBQAwVjEZMBcGA1UEAxMQUEtJIEZJTk1FQ0NBTklDQTEVMBMGA1UEChMMRklOTUVDQ0FOSUNBMRUwEwYDVQQLEwxGSU5NRUNDQU5JQ0ExCzAJBgNVBAYTAklUFw0xMTA1MDQxNjU3N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NXlJZDNFakRrYUV5eFJhK2k2N0x6dmhJNmMyOUVlNks5cFNZd2ppLzdSVWhtbW5Qclh0VHhsTDBsckxyDQptUVFKNnhoRFJhNUczUUE0Q21VZHNITnZicnpnbUNZcHZWRT0NCi0tLS0tRU5EIFg1MDkgQ1JMLS0tLS0NCg0K"
-
---- 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.
diff --git a/go/patch/go-1.10.2/go0.patch b/go/patch/go0.patch
index c539865e..c539865e 100644
--- a/go/patch/go-1.10.2/go0.patch
+++ b/go/patch/go0.patch
diff --git a/go/patch/go-1.10.2/go1.patch b/go/patch/go1.patch
index e32268ac..e32268ac 100644
--- a/go/patch/go-1.10.2/go1.patch
+++ b/go/patch/go1.patch
diff --git a/go/patch/go-1.10.2/go2.patch b/go/patch/go2.patch
index 20f04791..20f04791 100644
--- a/go/patch/go-1.10.2/go2.patch
+++ b/go/patch/go2.patch
diff --git a/go/patch/go-1.10.2/go3.patch b/go/patch/go3.patch
index 62247a03..62247a03 100644
--- a/go/patch/go-1.10.2/go3.patch
+++ b/go/patch/go3.patch
diff --git a/go/patch/go-1.10.2/go4.patch b/go/patch/go4.patch
index 290de390..290de390 100644
--- a/go/patch/go-1.10.2/go4.patch
+++ b/go/patch/go4.patch
diff --git a/go/patch/go-1.10.2/go5.patch b/go/patch/go5.patch
index 7189c89e..7189c89e 100644
--- a/go/patch/go-1.10.2/go5.patch
+++ b/go/patch/go5.patch
diff --git a/go/patch/go-1.10.2/go6.patch b/go/patch/go6.patch
index 9f32ed84..9f32ed84 100644
--- a/go/patch/go-1.10.2/go6.patch
+++ b/go/patch/go6.patch