From: Daniel Theophanes Date: Fri, 10 Apr 2015 04:11:16 +0000 (-0700) Subject: cmd/internal/obj/x86: look for go cmd in GOBIN if present. X-Git-Tag: go1.5beta1~1206 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a2a8a0468a40e1c0be861c4d47bda8388bc3402e;p=gostls13.git 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 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/internal/obj/x86/obj6_test.go b/src/cmd/internal/obj/x86/obj6_test.go index 93f8f3c262..7b64fe962b 100644 --- a/src/cmd/internal/obj/x86/obj6_test.go +++ b/src/cmd/internal/obj/x86/obj6_test.go @@ -97,8 +97,13 @@ func asmOutput(t *testing.T, s string) []byte { if err != nil { t.Fatal(err) } + gofolder := filepath.Join(build.Default.GOROOT, "bin") + if gobin := os.Getenv("GOBIN"); len(gobin) != 0 { + gofolder = gobin + } + 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()) var env []string