This patch changes the way that cmd/go finds gccgo to match the
upstream sources (which had changed since the 1.3 sources currently in
libgo).  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff -r 882d8b02b84b libgo/go/cmd/go/build.go
--- a/libgo/go/cmd/go/build.go  Thu Jan 08 12:31:29 2015 -0800
+++ b/libgo/go/cmd/go/build.go  Fri Jan 09 13:16:57 2015 -0800
@@ -1783,15 +1783,22 @@
 // The Gccgo toolchain.
 type gccgoToolchain struct{}
 
-func (gccgoToolchain) compiler() string {
-       if v := os.Getenv("GOC"); v != "" {
-               return v
+var gccgoName, gccgoBin string
+
+func init() {
+       gccgoName = os.Getenv("GCCGO")
+       if gccgoName == "" {
+               gccgoName = defaultGCCGO
        }
-       return defaultGOC
+       gccgoBin, _ = exec.LookPath(gccgoName)
 }
 
-func (tools gccgoToolchain) linker() string {
-       return tools.compiler()
+func (gccgoToolchain) compiler() string {
+       return gccgoBin
+}
+
+func (gccgoToolchain) linker() string {
+       return gccgoBin
 }
 
 func (tools gccgoToolchain) gc(b *builder, p *Package, archive, obj string, 
importArgs []string, gofiles []string) (ofile string, output []byte, err error) 
{

Reply via email to