]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: support -installsuffix with gccgo
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 14 Apr 2015 08:22:23 +0000 (10:22 +0200)
committerIan Lance Taylor <iant@golang.org>
Wed, 15 Apr 2015 22:46:23 +0000 (22:46 +0000)
Fixes #10449

Change-Id: I1dc2d0213e6a46f3609222d5460c1a54081e2471
Reviewed-on: https://go-review.googlesource.com/8931
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/go/build/build.go

index 155156b9a567264a484ac81e8a6e16ef612331d4..902ab38e0bf8bfcc22591f44b79f7d3cac6bdd54 100644 (file)
@@ -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: