2016-10-11 21:21:40 +02:00
|
|
|
FROM ubuntu:16.04
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
2017-01-29 06:25:11 +01:00
|
|
|
automake \
|
|
|
|
bison \
|
|
|
|
bzip2 \
|
|
|
|
ca-certificates \
|
|
|
|
cmake \
|
|
|
|
curl \
|
|
|
|
file \
|
|
|
|
flex \
|
2016-10-11 21:21:40 +02:00
|
|
|
g++ \
|
2017-01-29 06:25:11 +01:00
|
|
|
gawk \
|
|
|
|
gdb \
|
|
|
|
git \
|
|
|
|
gperf \
|
|
|
|
help2man \
|
|
|
|
libncurses-dev \
|
|
|
|
libtool-bin \
|
2016-10-11 21:21:40 +02:00
|
|
|
make \
|
2017-01-29 06:25:11 +01:00
|
|
|
patch \
|
2016-10-11 21:21:40 +02:00
|
|
|
python2.7 \
|
|
|
|
sudo \
|
2017-01-29 06:25:11 +01:00
|
|
|
texinfo \
|
2017-01-13 18:18:09 +01:00
|
|
|
wget \
|
2017-02-10 21:59:40 +01:00
|
|
|
xz-utils \
|
|
|
|
libssl-dev \
|
|
|
|
pkg-config
|
2016-10-11 21:21:40 +02:00
|
|
|
|
2017-02-24 22:16:54 +01:00
|
|
|
RUN curl -o /usr/local/bin/sccache \
|
2017-03-16 15:55:15 +01:00
|
|
|
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-unknown-linux-musl && \
|
2017-02-24 22:16:54 +01:00
|
|
|
chmod +x /usr/local/bin/sccache
|
2016-10-11 21:21:40 +02:00
|
|
|
|
2016-12-13 05:01:13 +01:00
|
|
|
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
|
|
|
|
dpkg -i dumb-init_*.deb && \
|
|
|
|
rm dumb-init_*.deb
|
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
|
|
|
2017-01-29 06:25:11 +01:00
|
|
|
# Ubuntu 16.04 (this contianer) ships with make 4, but something in the
|
|
|
|
# toolchains we build below chokes on that, so go back to make 3
|
|
|
|
RUN curl https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf - && \
|
|
|
|
cd make-3.81 && \
|
|
|
|
./configure --prefix=/usr && \
|
|
|
|
make && \
|
|
|
|
make install && \
|
|
|
|
cd .. && \
|
|
|
|
rm -rf make-3.81
|
|
|
|
|
|
|
|
RUN curl http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2 | \
|
|
|
|
tar xjf - && \
|
|
|
|
cd crosstool-ng && \
|
|
|
|
./configure --prefix=/usr/local && \
|
|
|
|
make -j$(nproc) && \
|
|
|
|
make install && \
|
|
|
|
cd .. && \
|
|
|
|
rm -rf crosstool-ng
|
|
|
|
|
|
|
|
RUN groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild
|
|
|
|
RUN mkdir /x-tools && chown rustbuild:rustbuild /x-tools
|
|
|
|
USER rustbuild
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
|
|
|
COPY patches/ /tmp/patches/
|
|
|
|
COPY s390x-linux-gnu.config build-s390x-toolchain.sh /tmp/
|
|
|
|
RUN ./build-s390x-toolchain.sh
|
|
|
|
|
|
|
|
COPY build-netbsd-toolchain.sh /tmp/
|
|
|
|
RUN ./build-netbsd-toolchain.sh
|
|
|
|
|
2017-03-17 20:52:44 +01:00
|
|
|
USER root
|
|
|
|
|
|
|
|
ENV PATH=$PATH:/x-tools/s390x-ibm-linux-gnu/bin:/x-tools/x86_64-unknown-netbsd/bin
|
2016-12-12 20:36:52 +01:00
|
|
|
|
2016-10-11 21:21:40 +02:00
|
|
|
ENV \
|
2017-03-17 20:52:44 +01:00
|
|
|
AR_x86_64_unknown_netbsd=x86_64--netbsd-ar \
|
|
|
|
CC_x86_64_unknown_netbsd=x86_64--netbsd-gcc-sysroot \
|
|
|
|
CXX_x86_64_unknown_netbsd=x86_64--netbsd-g++-sysroot \
|
2017-01-29 06:25:11 +01:00
|
|
|
CC_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-gcc \
|
|
|
|
AR_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-ar \
|
|
|
|
CXX_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-g++
|
2016-10-11 21:21:40 +02:00
|
|
|
|
2017-01-16 23:15:12 +01:00
|
|
|
ENV HOSTS=x86_64-unknown-netbsd
|
|
|
|
ENV HOSTS=$HOSTS,s390x-unknown-linux-gnu
|
|
|
|
|
2017-01-21 02:03:06 +01:00
|
|
|
ENV RUST_CONFIGURE_ARGS --host=$HOSTS --enable-extended
|
2017-01-16 23:15:12 +01:00
|
|
|
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
|