1
0
mirror of https://github.com/golang/go synced 2024-11-23 08:00:05 -07:00

cmd/go: enable android/amd64 build.

For golang/go#10743

Change-Id: Iec047821147a0e28edebf875fefe25993785702b
Reviewed-on: https://go-review.googlesource.com/15994
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Hyang-Ah Hana Kim 2015-10-16 14:19:13 -04:00
parent dfc8649854
commit 26d0b00536
2 changed files with 4 additions and 3 deletions

View File

@ -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

View 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")
}