Skip to content

Commit

Permalink
cmd/go: Adjust finding gccgo to match current upstream sources.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219406 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
ian committed Jan 9, 2015
1 parent 1f78217 commit 06df6ac
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions libgo/go/cmd/go/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 06df6ac

Please sign in to comment.