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