diff --git a/.travis.yml b/.travis.yml index 9e3225a103a..139f06ec570 100644 --- a/.travis.yml +++ b/.travis.yml @@ -115,6 +115,8 @@ matrix: if: branch = auto - env: IMAGE=cross DEPLOY=1 if: branch = auto + - env: IMAGE=cross2 DEPLOY=1 + if: branch = auto - env: IMAGE=dist-aarch64-linux DEPLOY=1 if: branch = auto - env: IMAGE=dist-android DEPLOY=1 @@ -125,8 +127,6 @@ matrix: if: branch = auto - env: IMAGE=dist-armv7-linux DEPLOY=1 if: branch = auto - - env: IMAGE=dist-fuchsia DEPLOY=1 - if: branch = auto - env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1 if: branch = auto - env: IMAGE=dist-i686-freebsd DEPLOY=1 diff --git a/src/ci/docker/cross2/Dockerfile b/src/ci/docker/cross2/Dockerfile new file mode 100644 index 00000000000..f5fc06767ce --- /dev/null +++ b/src/ci/docker/cross2/Dockerfile @@ -0,0 +1,52 @@ +FROM ubuntu:16.04 + +COPY scripts/cross-apt-packages.sh /scripts/ +RUN sh /scripts/cross-apt-packages.sh + +RUN apt-get build-dep -y clang llvm && apt-get install -y --no-install-recommends \ + build-essential \ + libedit-dev \ + libgmp-dev \ + libisl-dev \ + libmpc-dev \ + libmpfr-dev \ + ninja-build \ + nodejs \ + python2.7-dev \ + software-properties-common \ + unzip + +RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486 +RUN add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2-testing main' + +WORKDIR /tmp +COPY cross2/shared.sh cross2/build-fuchsia-toolchain.sh /tmp/ +COPY cross2/build-solaris-toolchain.sh /tmp/ +RUN /tmp/build-fuchsia-toolchain.sh +RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386 +RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc + +COPY scripts/sccache.sh /scripts/ +RUN sh /scripts/sccache.sh + +ENV \ + AR_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-ar \ + CC_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang \ + CXX_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang++ \ + AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \ + CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \ + CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \ + AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-ar \ + CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-gcc \ + CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-g++ \ + AR_x86_64_sun_solaris=x86_64-sun-solaris2.11-ar \ + CC_x86_64_sun_solaris=x86_64-sun-solaris2.11-gcc \ + CXX_x86_64_sun_solaris=x86_64-sun-solaris2.11-g++ + +ENV TARGETS=x86_64-unknown-fuchsia +ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia +ENV TARGETS=$TARGETS,sparcv9-sun-solaris +ENV TARGETS=$TARGETS,x86_64-sun-solaris + +ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended +ENV SCRIPT python2.7 ../x.py dist --target $TARGETS diff --git a/src/ci/docker/dist-fuchsia/build-toolchain.sh b/src/ci/docker/cross2/build-fuchsia-toolchain.sh similarity index 100% rename from src/ci/docker/dist-fuchsia/build-toolchain.sh rename to src/ci/docker/cross2/build-fuchsia-toolchain.sh diff --git a/src/ci/docker/cross2/build-solaris-toolchain.sh b/src/ci/docker/cross2/build-solaris-toolchain.sh new file mode 100755 index 00000000000..ae84cc62b60 --- /dev/null +++ b/src/ci/docker/cross2/build-solaris-toolchain.sh @@ -0,0 +1,103 @@ +#!/bin/bash +# Copyright 2016 The Rust Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution and at +# http://rust-lang.org/COPYRIGHT. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +set -ex +source shared.sh + +ARCH=$1 +LIB_ARCH=$2 +APT_ARCH=$3 +BINUTILS=2.28.1 +GCC=6.4.0 + +# First up, build binutils +mkdir binutils +cd binutils + +curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.xz | tar xJf - +mkdir binutils-build +cd binutils-build +hide_output ../binutils-$BINUTILS/configure --target=$ARCH-sun-solaris2.11 +hide_output make -j10 +hide_output make install + +cd ../.. +rm -rf binutils + +# Next, download and install the relevant solaris packages +mkdir solaris +cd solaris + +dpkg --add-architecture $APT_ARCH +apt-get update +apt-get download \ + libc:$APT_ARCH \ + libc-dev:$APT_ARCH \ + libm:$APT_ARCH \ + libm-dev:$APT_ARCH \ + libpthread:$APT_ARCH \ + libpthread-dev:$APT_ARCH \ + libresolv:$APT_ARCH \ + libresolv-dev:$APT_ARCH \ + librt:$APT_ARCH \ + librt-dev:$APT_ARCH \ + libsocket:$APT_ARCH \ + libsocket-dev:$APT_ARCH \ + system-crt:$APT_ARCH \ + system-header:$APT_ARCH + +for deb in *$APT_ARCH.deb; do + dpkg -x $deb . +done + +mkdir /usr/local/$ARCH-sun-solaris2.11/usr +mv usr/include /usr/local/$ARCH-sun-solaris2.11/usr/include +mv usr/lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib +mv lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib + +ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/sys-include +ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/include + +cd .. +rm -rf solaris + +# Finally, download and build gcc to target solaris +mkdir gcc +cd gcc + +curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | tar xJf - +cd gcc-$GCC + +mkdir ../gcc-build +cd ../gcc-build +hide_output ../gcc-$GCC/configure \ + --enable-languages=c,c++ \ + --target=$ARCH-sun-solaris2.11 \ + --with-gnu-as \ + --with-gnu-ld \ + --disable-multilib \ + --disable-nls \ + --disable-libgomp \ + --disable-libquadmath \ + --disable-libssp \ + --disable-libvtv \ + --disable-libcilkrts \ + --disable-libada \ + --disable-libsanitizer \ + --disable-libquadmath-support \ + --disable-lto \ + --with-sysroot=/usr/local/$ARCH-sun-solaris2.11 + +hide_output make -j10 +hide_output make install + +cd ../.. +rm -rf gcc diff --git a/src/ci/docker/dist-fuchsia/shared.sh b/src/ci/docker/cross2/shared.sh similarity index 100% rename from src/ci/docker/dist-fuchsia/shared.sh rename to src/ci/docker/cross2/shared.sh diff --git a/src/ci/docker/dist-fuchsia/Dockerfile b/src/ci/docker/dist-fuchsia/Dockerfile deleted file mode 100644 index bcd95924b42..00000000000 --- a/src/ci/docker/dist-fuchsia/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -FROM ubuntu:16.04 - -RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y \ - build-essential \ - bzip2 \ - ca-certificates \ - cmake \ - curl \ - file \ - g++ \ - gdb \ - git \ - libedit-dev \ - make \ - ninja-build \ - nodejs \ - python2.7-dev \ - sudo \ - xz-utils \ - unzip - -WORKDIR /tmp -COPY dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh /tmp/ -RUN /tmp/build-toolchain.sh - -COPY scripts/sccache.sh /scripts/ -RUN sh /scripts/sccache.sh - -ENV \ - AR_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-ar \ - CC_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang \ - CXX_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang++ \ - AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \ - CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \ - CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ - -ENV TARGETS=x86_64-unknown-fuchsia -ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia - -ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended -ENV SCRIPT python2.7 ../x.py dist --target $TARGETS \ No newline at end of file diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index db957a7a0fc..daeac35a017 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -83,6 +83,7 @@ static TARGETS: &'static [&'static str] = &[ "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu", "sparc64-unknown-linux-gnu", + "sparcv9-sun-solaris", "wasm32-unknown-emscripten", "x86_64-linux-android", "x86_64-apple-darwin", @@ -90,6 +91,7 @@ static TARGETS: &'static [&'static str] = &[ "x86_64-pc-windows-gnu", "x86_64-pc-windows-msvc", "x86_64-rumprun-netbsd", + "x86_64-sun-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-fuchsia", "x86_64-unknown-linux-gnu",