]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/cross/Dockerfile
Auto merge of #42264 - GuillaumeGomez:new-error-codes, r=Susurrus
[rust.git] / src / ci / docker / cross / Dockerfile
1 FROM ubuntu:16.04
2
3 RUN apt-get update && apt-get install -y --no-install-recommends \
4   g++ \
5   make \
6   file \
7   curl \
8   ca-certificates \
9   python2.7 \
10   git \
11   cmake \
12   sudo \
13   xz-utils \
14   zlib1g-dev \
15   g++-arm-linux-gnueabi \
16   g++-arm-linux-gnueabihf \
17   gcc-sparc64-linux-gnu \
18   libc6-dev-sparc64-cross \
19   bzip2 \
20   patch \
21   libssl-dev \
22   pkg-config
23
24 # dumb-init
25 COPY scripts/dumb-init.sh /scripts/
26 RUN sh /scripts/dumb-init.sh
27
28 WORKDIR /tmp
29
30 COPY cross/build-rumprun.sh /tmp/
31 RUN ./build-rumprun.sh
32
33 COPY cross/build-arm-musl.sh /tmp/
34 RUN ./build-arm-musl.sh
35
36 COPY cross/install-mips-musl.sh /tmp/
37 RUN ./install-mips-musl.sh
38
39 COPY cross/install-mipsel-musl.sh /tmp/
40 RUN ./install-mipsel-musl.sh
41
42 ENV TARGETS=asmjs-unknown-emscripten
43 ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
44 ENV TARGETS=$TARGETS,x86_64-rumprun-netbsd
45 ENV TARGETS=$TARGETS,mips-unknown-linux-musl
46 ENV TARGETS=$TARGETS,mipsel-unknown-linux-musl
47 ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi
48 ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf
49 ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabihf
50 ENV TARGETS=$TARGETS,sparc64-unknown-linux-gnu
51
52 ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
53     CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
54     CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc
55
56 # Suppress some warnings in the openwrt toolchains we downloaded
57 ENV STAGING_DIR=/tmp
58
59 ENV RUST_CONFIGURE_ARGS \
60       --enable-extended \
61       --target=$TARGETS \
62       --musl-root-arm=/usr/local/arm-linux-musleabi \
63       --musl-root-armhf=/usr/local/arm-linux-musleabihf \
64       --musl-root-armv7=/usr/local/armv7-linux-musleabihf
65 ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
66
67 # sccache
68 COPY scripts/sccache.sh /scripts/
69 RUN sh /scripts/sccache.sh
70
71 # init
72 ENTRYPOINT ["/usr/bin/dumb-init", "--"]