This patch to the go/build package in libgo changes it to use the environment variable GCCGOTOOLDIR to find gccgo tools such as cgo. If the environment variable is not set, it continues to look in the default location based on the configure --prefix. This will be used by the go tool tests in a future patch. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 249195) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -6d1d558109b5f5e53b31cc3325485dbb9f06d430 +a790c5fec06ced726c7f0f597186883ce61d0a45 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/cmd/go/alldocs.go =================================================================== --- libgo/go/cmd/go/alldocs.go (revision 249125) +++ libgo/go/cmd/go/alldocs.go (working copy) @@ -1143,6 +1143,9 @@ // Defined by Git. A colon-separated list of schemes that are allowed to be used // with git fetch/clone. If set, any scheme not explicitly mentioned will be // considered insecure by 'go get'. +// GCCGOTOOLDIR +// If set, where to find gccgo tools, such as cgo. +// The default is based on how gccgo was configured. // // // Import path syntax Index: libgo/go/cmd/go/help.go =================================================================== --- libgo/go/cmd/go/help.go (revision 249125) +++ libgo/go/cmd/go/help.go (working copy) @@ -508,6 +508,9 @@ Special-purpose environment variables: Defined by Git. A colon-separated list of schemes that are allowed to be used with git fetch/clone. If set, any scheme not explicitly mentioned will be considered insecure by 'go get'. + GCCGOTOOLDIR + If set, where to find gccgo tools, such as cgo. + The default is based on how gccgo was configured. `, } Index: libgo/go/go/build/build.go =================================================================== --- libgo/go/go/build/build.go (revision 249125) +++ libgo/go/go/build/build.go (working copy) @@ -1549,7 +1549,7 @@ func init() { func getToolDir() string { if runtime.Compiler == "gccgo" { - return runtime.GCCGOTOOLDIR + return envOr("GCCGOTOOLDIR", runtime.GCCGOTOOLDIR) } else { return filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) }