aboutsummaryrefslogtreecommitdiff
path: root/libgo/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-01-09 21:18:04 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-01-09 21:18:04 +0000
commitb44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a (patch)
treee13cc5ba089f13152af01ecac6bf81494a320833 /libgo/go
parentadfac8dfed7bfb048a933241598b003e40b4344c (diff)
downloadgcc-b44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a.zip
gcc-b44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a.tar.gz
gcc-b44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a.tar.bz2
cmd/go: Adjust finding gccgo to match current upstream sources.
From-SVN: r219406
Diffstat (limited to 'libgo/go')
-rw-r--r--libgo/go/cmd/go/build.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/libgo/go/cmd/go/build.go b/libgo/go/cmd/go/build.go
index 8de7627..36216ce 100644
--- a/libgo/go/cmd/go/build.go
+++ b/libgo/go/cmd/go/build.go
@@ -1783,15 +1783,22 @@ func (gcToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error
// 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 (gccgoToolchain) compiler() string {
+ return gccgoBin
}
-func (tools gccgoToolchain) linker() string {
- return tools.compiler()
+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) {