This repository has been archived by the owner on May 30, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for compiling Go on ARM64
- Loading branch information
1 parent
d1286e5
commit 84e0b44
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# --- build all version of Go1.5 | ||
# interate over all available Go1.5 versions | ||
go15_list=( 1.5 1.5.1 1.5.2 ) | ||
go15_list=( 1.5.1 1.5.2 ) | ||
for go15 in "${go15_list[@]}" | ||
do | ||
export GO_VERSION=${go15} | ||
time ./make-tarball-go1.5-arm64.sh | tee "make-tarball-go${GO_VERSION}-arm64.log" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# log infos about Linux kernel, OS system release and gcc version | ||
uname -a | ||
cat /etc/*release | ||
gcc --version | ||
|
||
# we need this env var for the Go bootstrap build process | ||
GOROOT_BOOTSTRAP=$HOME/go1.4 | ||
|
||
# install a pre-compiled Go 1.5.x tarball to bootstrap on ARM64 | ||
GO_BOOTSTRAP_VERSION=${GO_BOOTSTRAP_VERSION:-1.5.1} | ||
rm -fr "$GOROOT_BOOTSTRAP" | ||
mkdir -p "$GOROOT_BOOTSTRAP" | ||
curl -sSL "https://github.com/hypriot/golang-armbuilds/releases/download/v${GO_BOOTSTRAP_VERSION}/go-linux-arm64-bootstrap.tbz" | tar -xj -C "$GOROOT_BOOTSTRAP" --strip-components=1 | ||
|
||
# fetch Go 1.5.x source tarball | ||
GOARM=${GOARM:-64} | ||
GO_VERSION=${GO_VERSION:-1.5.1} | ||
rm -fr /usr/local/go | ||
curl -sSL "https://storage.googleapis.com/golang/go${GO_VERSION}.src.tar.gz" | tar xz -C /usr/local | ||
|
||
# now compile Go 1.5.x and package it as a tarball | ||
pushd /usr/local/go/src | ||
if [ "x${SKIP_TESTS}" != "x" ]; then | ||
echo "Compile Go, skip tests." | ||
time ./make.bash 2>&1 | ||
else | ||
echo "Compile Go, run tests." | ||
time ./all.bash 2>&1 | ||
fi | ||
cd ../.. | ||
tar --numeric-owner -czf "go${GO_VERSION}.linux-arm${GOARM}.tar.gz" go | ||
popd | ||
mv "/usr/local/go${GO_VERSION}.linux-arm${GOARM}.tar.gz" . | ||
|
||
# cleanup | ||
rm -fr "$GOROOT_BOOTSTRAP" | ||
rm -fr /usr/local/go |