Commit a2a8a046 authored by Daniel Theophanes's avatar Daniel Theophanes Committed by Ian Lance Taylor

cmd/internal/obj/x86: look for go cmd in GOBIN if present.

If GOBIN is not empty the build moves the go executable
to a new path. When this test runs it fails to find the
go cmd in the GOROOT.

Change-Id: I100def0fbcb9691b13776f795b1d1725e36d8102
Reviewed-on: https://go-review.googlesource.com/8735Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent fae4a128
...@@ -97,8 +97,13 @@ func asmOutput(t *testing.T, s string) []byte { ...@@ -97,8 +97,13 @@ func asmOutput(t *testing.T, s string) []byte {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
gofolder := filepath.Join(build.Default.GOROOT, "bin")
if gobin := os.Getenv("GOBIN"); len(gobin) != 0 {
gofolder = gobin
}
cmd := exec.Command( cmd := exec.Command(
build.Default.GOROOT+"/bin/go", "tool", "asm", "-S", "-dynlink", filepath.Join(gofolder, "go"), "tool", "asm", "-S", "-dynlink",
"-o", filepath.Join(tmpdir, "output.6"), tmpfile.Name()) "-o", filepath.Join(tmpdir, "output.6"), tmpfile.Name())
var env []string var env []string
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment