-dfa74d975884f363c74d6a66a37b1703093fdba6
+d52835c9376985f92f35c32af5f1808239981536
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
if goTools[p.ImportPath] == toTool {
// This is for 'go tool'.
// Override all the usual logic and force it into the tool directory.
- p.target = filepath.Join(gorootPkg, "tool", full)
+ if buildContext.Compiler == "gccgo" {
+ p.target = filepath.Join(runtime.GCCGOTOOLDIR, elem)
+ } else {
+ p.target = filepath.Join(gorootPkg, "tool", full)
+ }
}
if p.target != "" && buildContext.GOOS == "windows" {
p.target += ".exe"
toolN bool
)
+// List of go tools found in the gccgo tool directory.
+// Other binaries could be in the same directory so don't
+// show those with the 'go tool' command.
+
+var gccgoTools = []string{"cgo", "fix", "cover", "godoc", "vet"}
+
func init() {
cmdTool.Flag.BoolVar(&toolN, "n", false, "")
}
if toolIsWindows && strings.HasSuffix(name, toolWindowsExtension) {
name = name[:len(name)-len(toolWindowsExtension)]
}
- fmt.Println(name)
+
+ // The tool directory used by gccgo will have other binaries
+ // in additions to go tools. Only display go tools for this list.
+
+ if buildContext.Compiler == "gccgo" {
+ for _, tool := range gccgoTools {
+ if tool == name {
+ fmt.Println(name)
+ }
+ }
+ } else {
+
+ // Not gccgo, list all the tools found in this dir
+
+ fmt.Println(name)
+ }
}
}