Add support for 64bit ARM Linux

This commit is contained in:
Péter Szilágyi 2015-12-02 16:56:12 +02:00
parent e69e28130f
commit 137971dab5
3 changed files with 14 additions and 0 deletions

View File

@ -28,6 +28,7 @@ RUN \
apt-get install -y automake autogen build-essential ca-certificates \
gcc-5-arm-linux-gnueabi g++-5-arm-linux-gnueabi libc6-dev-armel-cross \
gcc-5-arm-linux-gnueabihf g++-5-arm-linux-gnueabihf libc6-dev-armhf-cross \
gcc-5-aarch64-linux-gnu g++-5-aarch64-linux-gnu libc6-dev-arm64-cross \
gcc-5-multilib g++-5-multilib gcc-mingw-w64 g++-mingw-w64 clang llvm-dev \
libtool libxml2-dev uuid-dev libssl-dev pkg-config patch make xz-utils \
cpio wget unzip p7zip git mercurial bzr --no-install-recommends && \

View File

@ -30,6 +30,9 @@ export GOROOT_BOOTSTRAP=$GOROOT
echo "Bootstrapping linux/386..."
GOOS=linux GOARCH=386 CGO_ENABLED=1 go install std
echo "Bootstrapping linux/arm64..."
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc-5 go install std
echo "Bootstrapping windows/amd64..."
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go install std

View File

@ -246,6 +246,16 @@ for TARGET in $TARGETS; do
rm -rf /usr/local/go/pkg/linux_arm
fi
fi
if ([ $XGOOS == "." ] || [ $XGOOS == "linux" ]) && ([ $XGOARCH == "." ] || [ $XGOARCH == "arm64" ]); then
if [ "$GO_VERSION" -lt 150 ]; then
echo "Go version too low, skipping linux/arm64..."
else
echo "Compiling for linux/arm64..."
CC=aarch64-linux-gnu-gcc-5 CXX=aarch64-linux-gnu-g++-5 HOST=aarch64-linux-gnu PREFIX=/usr/aarch64-linux-gnu $BUILD_DEPS /deps ${DEPS_ARGS[@]}
CC=aarch64-linux-gnu-gcc-5 CXX=aarch64-linux-gnu-g++-5 GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go get $V $X "${T[@]}" --ldflags="$V $LD" -d ./$PACK
CC=aarch64-linux-gnu-gcc-5 CXX=aarch64-linux-gnu-g++-5 GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build $V $X "${T[@]}" --ldflags="$V $LD" $BM -o "/build/$NAME-linux-arm64`extension linux`" ./$PACK
fi
fi
# Check and build for Windows targets
if [ $XGOOS == "." ] || [[ $XGOOS == windows* ]]; then
# Split the platform version and configure the Windows NT version