diff mbox

fix inconsistent install paths between gccgo and go tool

Message ID 87d2jkncbl.fsf@canonical.com
State New
Headers show

Commit Message

Michael Hudson-Doyle Jan. 21, 2014, 11:29 p.m. UTC
Hi,

This patch for the 4.8 branch fixes an inconsistency between gccgo's
libgo and the go tool over where libraries installed with "go install
-compiler gccgo" end up.  Even if it's not strictly required, it makes
sense to me that as gccgo implements go 1.1 it should match the go tool
from that particular version of the go distribution (and also newer
ones!).

Cheers,
mwh

Comments

Ian Lance Taylor Jan. 22, 2014, 12:18 a.m. UTC | #1
On Tue, Jan 21, 2014 at 3:29 PM, Michael Hudson-Doyle
<michael.hudson@linaro.org> wrote:
>
> This patch for the 4.8 branch fixes an inconsistency between gccgo's
> libgo and the go tool over where libraries installed with "go install
> -compiler gccgo" end up.  Even if it's not strictly required, it makes
> sense to me that as gccgo implements go 1.1 it should match the go tool
> from that particular version of the go distribution (and also newer
> ones!).

This is OK for 4.8 branch.

Thanks.

Ian
diff mbox

Patch

diff --git a/libgo/go/go/build/build.go b/libgo/go/go/build/build.go
index cc89afb..59ddcef 100644
--- a/libgo/go/go/build/build.go
+++ b/libgo/go/go/build/build.go
@@ -429,7 +429,7 @@  func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Packa
 	switch ctxt.Compiler {
 	case "gccgo":
 		dir, elem := pathpkg.Split(p.ImportPath)
-		pkga = "pkg/gccgo/" + dir + "lib" + elem + ".a"
+		pkga = "pkg/gccgo_" + ctxt.GOOS + "_" + ctxt.GOARCH + "/" + dir + "lib" + elem + ".a"
 	case "gc":
 		suffix := ""
 		if ctxt.InstallSuffix != "" {