mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
ad7dea1e96
commit
5edf5197e0
2 changed files with 16 additions and 10 deletions
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue