1
0
mirror of https://github.com/golang/go synced 2024-11-20 02:24:43 -07:00

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/8735
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Daniel Theophanes 2015-04-09 21:11:16 -07:00 committed by Ian Lance Taylor
parent fae4a128cb
commit a2a8a0468a

View File

@ -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