From: Michael Hudson-Doyle Date: Tue, 14 Apr 2015 08:22:23 +0000 (+0200) Subject: go/build: support -installsuffix with gccgo X-Git-Tag: go1.5beta1~1098 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=99162ca1c5258a78950cba09366d6d095a8c4c40;p=gostls13.git go/build: support -installsuffix with gccgo Fixes #10449 Change-Id: I1dc2d0213e6a46f3609222d5460c1a54081e2471 Reviewed-on: https://go-review.googlesource.com/8931 Reviewed-by: Ian Lance Taylor --- diff --git a/src/go/build/build.go b/src/go/build/build.go index 155156b9a5..902ab38e0b 100644 --- a/src/go/build/build.go +++ b/src/go/build/build.go @@ -466,16 +466,16 @@ func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Packa var pkgtargetroot string var pkga string var pkgerr error + suffix := "" + if ctxt.InstallSuffix != "" { + suffix = "_" + ctxt.InstallSuffix + } switch ctxt.Compiler { case "gccgo": - pkgtargetroot = "pkg/gccgo_" + ctxt.GOOS + "_" + ctxt.GOARCH + pkgtargetroot = "pkg/gccgo_" + ctxt.GOOS + "_" + ctxt.GOARCH + suffix dir, elem := pathpkg.Split(p.ImportPath) pkga = pkgtargetroot + "/" + dir + "lib" + elem + ".a" case "gc": - suffix := "" - if ctxt.InstallSuffix != "" { - suffix = "_" + ctxt.InstallSuffix - } pkgtargetroot = "pkg/" + ctxt.GOOS + "_" + ctxt.GOARCH + suffix pkga = pkgtargetroot + "/" + p.ImportPath + ".a" default: