cgo: cgo to use GOARCH from the environment, not runtime.GOARCH (otherwise it results in necessity of having 8cgo and 6cgo)

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4978061
This commit is contained in:
Jaroslavas Počepko 2011-09-19 11:50:59 -04:00 committed by Russ Cox
parent ad7dea1e96
commit 5edf5197e0
2 changed files with 16 additions and 10 deletions

View file

@ -20,7 +20,6 @@ import (
"go/parser"
"go/token"
"os"
"runtime"
"strconv"
"strings"
"unicode"
@ -91,9 +90,9 @@ NextLine:
case 2:
k = kf[1]
switch kf[0] {
case runtime.GOOS:
case runtime.GOARCH:
case runtime.GOOS + "/" + runtime.GOARCH:
case goos:
case goarch:
case goos + "/" + goarch:
default:
continue NextLine
}
@ -688,7 +687,7 @@ func (p *Package) gccName() (ret string) {
// gccMachine returns the gcc -m flag to use, either "-m32" or "-m64".
func (p *Package) gccMachine() []string {
switch runtime.GOARCH {
switch goarch {
case "amd64":
return []string{"-m64"}
case "386":