diff --git a/docker/base/bootstrap_pure.sh b/docker/base/bootstrap_pure.sh index 98b04d3..5cf683c 100644 --- a/docker/base/bootstrap_pure.sh +++ b/docker/base/bootstrap_pure.sh @@ -39,3 +39,10 @@ GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 CC=o64-clang go install std echo "Bootstrapping darwin/386..." GOOS=darwin GOARCH=386 CGO_ENABLED=1 CC=o32-clang go install std + +echo "Bootstrapping android/arm..." +ANDROID_SYSROOT=$ANDROID_NDK_ROOT/platforms/android-$ANDROID_PLATFORM/arch-arm +ANDROID_BINARIES=$ANDROID_NDK_ROOT/toolchains/$ANDROID_CHAIN_ARM/prebuilt/linux-x86_64/bin + +PATH=$ANDROID_BINARIES:$PATH CC=arm-linux-androideabi-gcc CXX=arm-linux-androideabi-g++ GOOS=android GOARCH=arm GOARM=7 CGO_ENABLED=1 \ + CGO_CFLAGS="--sysroot=$ANDROID_SYSROOT" CGO_CXXFLAGS="--sysroot=$ANDROID_SYSROOT" CGO_LDFLAGS="--sysroot=$ANDROID_SYSROOT" go install std diff --git a/docker/base/build.sh b/docker/base/build.sh index 62d58e3..76c847a 100644 --- a/docker/base/build.sh +++ b/docker/base/build.sh @@ -100,6 +100,8 @@ for TARGET in $TARGETS; do CGO_CCPIE="-fPIE" CGO_LDPIE="-fPIE" EXT_LDPIE="-extldflags=-pie" + else + unset CGO_CCPIE CGO_LDPIE EXT_LDPIE fi # Iterate over the requested architectures, bootstrap and if [ $XGOARCH == "." ] || [ $XGOARCH == "arm" ]; then @@ -107,7 +109,7 @@ for TARGET in $TARGETS; do echo "Go version too low, skipping android-$PLATFORM/arm..." else echo "Assembling toolchain for android-$PLATFORM/arm..." - $ANDROID_NDK_ROOT/build/tools/make-standalone-toolchain.sh --ndk-dir=$ANDROID_NDK_ROOT --install-dir=/usr/$ANDROID_CHAIN_ARM --toolchain=$ANDROID_CHAIN_ARM --arch=arm --system=linux-x86_64 + $ANDROID_NDK_ROOT/build/tools/make-standalone-toolchain.sh --ndk-dir=$ANDROID_NDK_ROOT --install-dir=/usr/$ANDROID_CHAIN_ARM --toolchain=$ANDROID_CHAIN_ARM --arch=arm --system=linux-x86_64 > /dev/null 2>&1 echo "Bootstrapping android-$PLATFORM/arm..." CC=arm-linux-androideabi-gcc GOOS=android GOARCH=arm GOARM=7 CGO_ENABLED=1 CGO_CFLAGS="$CGO_CCPIE" CGO_LDFLAGS="$CGO_LDPIE" go install std