Commit 26d0b005 authored by Hyang-Ah Hana Kim's avatar Hyang-Ah Hana Kim

cmd/go: enable android/amd64 build.

For golang/go#10743

Change-Id: Iec047821147a0e28edebf875fefe25993785702b
Reviewed-on: https://go-review.googlesource.com/15994Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
parent dfc86498
...@@ -81,7 +81,7 @@ GOPATH=$(pwd) go install -buildmode=c-shared $suffix libgo ...@@ -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 GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo.$libext src/libgo/libgo.go
binpush libgo.$libext binpush libgo.$libext
if [ "$goos" == "linux" ]; then if [ "$goos" == "linux" ] || [ "$goos" == "android" ] ; then
if readelf -d libgo.$libext | grep TEXTREL >/dev/null; then if readelf -d libgo.$libext | grep TEXTREL >/dev/null; then
echo "libgo.$libext has TEXTREL set" echo "libgo.$libext has TEXTREL set"
exit 1 exit 1
......
...@@ -350,7 +350,8 @@ func buildModeInit() { ...@@ -350,7 +350,8 @@ func buildModeInit() {
codegenArg = "-fPIC" codegenArg = "-fPIC"
} else { } else {
switch platform { switch platform {
case "linux/amd64", "linux/arm", "android/arm": case "linux/amd64", "linux/arm",
"android/amd64", "android/arm":
codegenArg = "-shared" codegenArg = "-shared"
case "darwin/amd64": case "darwin/amd64":
default: default:
...@@ -3075,7 +3076,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, pcCFLAGS, pcLDFLAGS, cgofi ...@@ -3075,7 +3076,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, pcCFLAGS, pcLDFLAGS, cgofi
linkobj = append(linkobj, p.SysoFiles...) linkobj = append(linkobj, p.SysoFiles...)
dynobj := obj + "_cgo_.o" 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 if pie { // we need to use -pie for Linux/ARM to get accurate imported sym
cgoLDFLAGS = append(cgoLDFLAGS, "-pie") cgoLDFLAGS = append(cgoLDFLAGS, "-pie")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment