fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
5.2 KiB151 linesraw
1FROM ubuntu:16.04
2
3RUN 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  g++-aarch64-linux-gnu \
18  gcc-sparc64-linux-gnu \
19  libc6-dev-sparc64-cross \
20  bzip2 \
21  patch \
22  libssl-dev \
23  pkg-config \
24  libnewlib-arm-none-eabi \
25  qemu-system-arm \
26# software-properties-common for the add-apt-repository command
27  software-properties-common
28
29WORKDIR /build
30
31# Use the team-gcc-arm-embedded PPA for a newer version of Arm GCC
32RUN add-apt-repository ppa:team-gcc-arm-embedded/ppa && \
33    apt-get update && \
34    apt-get install -y --no-install-recommends gcc-arm-embedded
35
36COPY dist-various-1/build-rumprun.sh /build
37RUN ./build-rumprun.sh
38
39COPY dist-various-1/install-x86_64-redox.sh /build
40RUN ./install-x86_64-redox.sh
41
42COPY dist-various-1/install-mips-musl.sh /build
43RUN ./install-mips-musl.sh
44
45COPY dist-various-1/install-mipsel-musl.sh /build
46RUN ./install-mipsel-musl.sh
47
48# Suppress some warnings in the openwrt toolchains we downloaded
49ENV STAGING_DIR=/tmp
50
51COPY scripts/musl.sh /build
52RUN env \
53    CC=arm-linux-gnueabi-gcc CFLAGS="-march=armv5te -marm -mfloat-abi=soft" \
54    CXX=arm-linux-gnueabi-g++ CXXFLAGS="-march=armv5te -marm -mfloat-abi=soft" \
55    bash musl.sh armv5te && \
56    env \
57    CC=arm-linux-gnueabi-gcc CFLAGS="-march=armv6 -marm" \
58    CXX=arm-linux-gnueabi-g++ CXXFLAGS="-march=armv6 -marm" \
59    bash musl.sh arm && \
60    env \
61    CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv6 -marm -mfpu=vfp" \
62    CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv6 -marm -mfpu=vfp" \
63    bash musl.sh armhf && \
64    env \
65    CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv7-a" \
66    CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv7-a" \
67    bash musl.sh armv7hf && \
68    env \
69    CC=aarch64-linux-gnu-gcc \
70    CXX=aarch64-linux-gnu-g++ \
71    bash musl.sh aarch64 && \
72    env \
73    CC=mips-openwrt-linux-gcc \
74    CXX=mips-openwrt-linux-g++ \
75    bash musl.sh mips && \
76    env \
77    CC=mipsel-openwrt-linux-gcc \
78    CXX=mipsel-openwrt-linux-g++ \
79    bash musl.sh mipsel && \
80    rm -rf /build/*
81
82# FIXME(mozilla/sccache#235) this shouldn't be necessary but is currently
83# necessary to disambiguate the mips compiler with the mipsel compiler. We want
84# to give these two wrapper scripts (currently identical ones) different hashes
85# to ensure that sccache understands that they're different compilers.
86RUN \
87  echo "# a" >> /usr/local/mips-linux-musl/bin/mips-openwrt-linux-musl-wrapper.sh && \
88  echo "# b" >> /usr/local/mipsel-linux-musl/bin/mipsel-openwrt-linux-musl-wrapper.sh
89
90ENV RUN_MAKE_TARGETS=thumbv6m-none-eabi
91ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7m-none-eabi
92ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabi
93ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabihf
94
95ENV TARGETS=asmjs-unknown-emscripten
96ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
97ENV TARGETS=$TARGETS,x86_64-rumprun-netbsd
98ENV TARGETS=$TARGETS,mips-unknown-linux-musl
99ENV TARGETS=$TARGETS,mipsel-unknown-linux-musl
100ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi
101ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf
102ENV TARGETS=$TARGETS,armv5te-unknown-linux-gnueabi
103ENV TARGETS=$TARGETS,armv5te-unknown-linux-musleabi
104ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabihf
105ENV TARGETS=$TARGETS,aarch64-unknown-linux-musl
106ENV TARGETS=$TARGETS,sparc64-unknown-linux-gnu
107ENV TARGETS=$TARGETS,x86_64-unknown-redox
108ENV TARGETS=$TARGETS,thumbv6m-none-eabi
109ENV TARGETS=$TARGETS,thumbv7m-none-eabi
110ENV TARGETS=$TARGETS,thumbv7em-none-eabi
111ENV TARGETS=$TARGETS,thumbv7em-none-eabihf
112ENV TARGETS=$TARGETS,thumbv8m.base-none-eabi
113ENV TARGETS=$TARGETS,thumbv8m.main-none-eabi
114ENV TARGETS=$TARGETS,thumbv8m.main-none-eabihf
115ENV TARGETS=$TARGETS,riscv32i-unknown-none-elf
116ENV TARGETS=$TARGETS,riscv32imc-unknown-none-elf
117ENV TARGETS=$TARGETS,riscv32imac-unknown-none-elf
118ENV TARGETS=$TARGETS,riscv64imac-unknown-none-elf
119ENV TARGETS=$TARGETS,riscv64gc-unknown-none-elf
120ENV TARGETS=$TARGETS,armebv7r-none-eabi
121ENV TARGETS=$TARGETS,armebv7r-none-eabihf
122ENV TARGETS=$TARGETS,armv7r-none-eabi
123ENV TARGETS=$TARGETS,armv7r-none-eabihf
124ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
125
126ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
127    CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
128    CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
129    CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \
130    CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
131    AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \
132    CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++
133
134ENV RUST_CONFIGURE_ARGS \
135      --musl-root-armv5te=/musl-armv5te \
136      --musl-root-arm=/musl-arm \
137      --musl-root-armhf=/musl-armhf \
138      --musl-root-armv7hf=/musl-armv7hf \
139      --musl-root-aarch64=/musl-aarch64 \
140      --musl-root-mips=/musl-mips \
141      --musl-root-mipsel=/musl-mipsel \
142      --enable-emscripten \
143      --disable-docs
144
145ENV SCRIPT \
146      python2.7 ../x.py test --target $RUN_MAKE_TARGETS src/test/run-make && \
147      python2.7 ../x.py dist --target $TARGETS
148
149# sccache
150COPY scripts/sccache.sh /scripts/
151RUN sh /scripts/sccache.sh