diff --git a/.travis.yml b/.travis.yml index 28478f22a3..100f54fe7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,13 @@ matrix: - TARGET=arm-unknown-linux-gnueabihf - CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.8 - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.8 - + - os: linux + rust: stable + env: + - TARGET=aarch64-unknown-linux-gnu + - CC_aarch64-unknown-linux-gnu=/usr/bin/aarch64-linux-gnu-gcc-4.8 + - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc-4.8 + # Minimum Rust supported channel. - os: linux rust: 1.26.0 diff --git a/ci/before_deploy.bash b/ci/before_deploy.bash index ea5c1725ea..913fce44a6 100755 --- a/ci/before_deploy.bash +++ b/ci/before_deploy.bash @@ -19,6 +19,8 @@ pack() { if [[ $TARGET == "arm-unknown-linux-gnueabihf" ]]; then gcc_prefix="arm-linux-gnueabihf-" + elif [[ $TARGET == "aarch64-unknown-linux-gnu" ]]; then + gcc_prefix="aarch64-linux-gnu-" else gcc_prefix="" fi @@ -49,13 +51,20 @@ make_deb() { local version local dpkgname local conflictname + local gcc_prefix case $TARGET in x86_64*) architecture=amd64 + gcc_prefix="" ;; i686*) architecture=i386 + gcc_prefix="" + ;; + aarch64*) + architecture=arm64 + gcc_prefix="aarch64-linux-gnu-" ;; *) echo "make_deb: skipping target '${TARGET}'" >&2 @@ -75,7 +84,7 @@ make_deb() { # copy the main binary install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME" - strip "$tempdir/usr/bin/$PROJECT_NAME" + "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME" # manpage install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1" diff --git a/ci/before_install.bash b/ci/before_install.bash index 709be7d5a3..9acf602580 100755 --- a/ci/before_install.bash +++ b/ci/before_install.bash @@ -27,3 +27,11 @@ if [[ $TARGET == arm-unknown-linux-gnueabihf ]]; then libc6-armhf-cross \ libc6-dev-armhf-cross fi + +# needed for cross-compiling for arm64 +if [[ $TARGET == aarch64-unknown-linux-gnu ]]; then + sudo apt-get install -y \ + gcc-4.8-aarch64-linux-gnu \ + binutils-aarch64-linux-gnu \ + gcc-aarch64-linux-gnu +fi diff --git a/ci/script.bash b/ci/script.bash index 321dcb14d8..fc874b964f 100755 --- a/ci/script.bash +++ b/ci/script.bash @@ -6,7 +6,7 @@ set -ex cargo build --target "$TARGET" --verbose # We cannot run arm executables on linux -if [[ $TARGET != arm-unknown-linux-gnueabihf ]]; then +if [[ $TARGET != arm-unknown-linux-gnueabihf ]] && [[ $TARGET != aarch64-unknown-linux-gnu ]]; then cargo test --target "$TARGET" --verbose # Run 'bat' on its own source code and the README