mirror of
https://github.com/golang/go
synced 2024-11-24 07:10:18 -07:00
go/build: support building cgo packages on non intel platforms
See https://golang.org/cl/4572045/ R=adg, rsc CC=golang-dev https://golang.org/cl/4627041
This commit is contained in:
parent
9555ea7a5b
commit
832e87500e
@ -331,11 +331,14 @@ func (b *build) gccLink(ofile string, ofiles ...string) {
|
||||
|
||||
func (b *build) gccArgs(args ...string) []string {
|
||||
// TODO(adg): HOST_CC
|
||||
m := "-m32"
|
||||
if b.arch == "6" {
|
||||
m = "-m64"
|
||||
a := []string{"gcc", "-I", b.path, "-g", "-fPIC", "-O2"}
|
||||
switch b.arch {
|
||||
case "8":
|
||||
a = append(a, "-m32")
|
||||
case "6":
|
||||
a = append(a, "-m64")
|
||||
}
|
||||
return append([]string{"gcc", m, "-I", b.path, "-g", "-fPIC", "-O2"}, args...)
|
||||
return append(a, args...)
|
||||
}
|
||||
|
||||
func (b *build) cgo(cgofiles []string) (outGo, outObj []string) {
|
||||
|
@ -7,8 +7,6 @@ package build
|
||||
import (
|
||||
"exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@ -22,11 +20,6 @@ const cmdtestOutput = "3"
|
||||
|
||||
func TestBuild(t *testing.T) {
|
||||
for _, pkg := range buildPkgs {
|
||||
if runtime.GOARCH == "arm" && strings.Contains(pkg, "/cgo") {
|
||||
// no cgo for arm, yet.
|
||||
continue
|
||||
}
|
||||
|
||||
tree := Path[0] // Goroot
|
||||
dir := filepath.Join(tree.SrcDir(), pkg)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user