]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: enable android/amd64 build.
authorHyang-Ah Hana Kim <hyangah@gmail.com>
Fri, 16 Oct 2015 18:19:13 +0000 (14:19 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Wed, 28 Oct 2015 20:55:13 +0000 (20:55 +0000)
For golang/go#10743

Change-Id: Iec047821147a0e28edebf875fefe25993785702b
Reviewed-on: https://go-review.googlesource.com/15994
Reviewed-by: David Crawshaw <crawshaw@golang.org>
misc/cgo/testcshared/test.bash
src/cmd/go/build.go

index 9b50522046d3cb4037f31c44a8f44d74b07e34ec..1b9f919d00f24219b994d784502aaa5caac8ef3c 100755 (executable)
@@ -81,7 +81,7 @@ GOPATH=$(pwd) go install -buildmode=c-shared $suffix libgo
 GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo.$libext src/libgo/libgo.go
 binpush libgo.$libext
 
-if [ "$goos" == "linux" ]; then
+if [ "$goos" == "linux" ] || [ "$goos" == "android" ] ; then
     if readelf -d libgo.$libext | grep TEXTREL >/dev/null; then
         echo "libgo.$libext has TEXTREL set"
         exit 1
index 08d84adf62f719a015d89713189662a3fe85b156..285627288a42c0f7180daf283326ead3afa49aa9 100644 (file)
@@ -350,7 +350,8 @@ func buildModeInit() {
                        codegenArg = "-fPIC"
                } else {
                        switch platform {
-                       case "linux/amd64", "linux/arm", "android/arm":
+                       case "linux/amd64", "linux/arm",
+                               "android/amd64", "android/arm":
                                codegenArg = "-shared"
                        case "darwin/amd64":
                        default:
@@ -3075,7 +3076,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, pcCFLAGS, pcLDFLAGS, cgofi
 
        linkobj = append(linkobj, p.SysoFiles...)
        dynobj := obj + "_cgo_.o"
-       pie := goarch == "arm" && (goos == "linux" || goos == "android")
+       pie := (goarch == "arm" && goos == "linux") || goos == "android"
        if pie { // we need to use -pie for Linux/ARM to get accurate imported sym
                cgoLDFLAGS = append(cgoLDFLAGS, "-pie")
        }