fork/rust
git clone https://git.julia.blue/fork/rust
4fb7144ed15
1.43.0
1FROM ubuntu:16.04 2 3RUN apt-get update && apt-get install -y --no-install-recommends \ 4 g++ \ 5 automake \ 6 bison \ 7 bzip2 \ 8 flex \ 9 help2man \ 10 libtool-bin \ 11 texinfo \ 12 unzip \ 13 wget \ 14 xz-utils \ 15 libncurses-dev \ 16 gawk \ 17 make \ 18 file \ 19 curl \ 20 ca-certificates \ 21 python2.7 \ 22 python3 \ 23 git \ 24 cmake \ 25 sudo \ 26 xz-utils \ 27 zlib1g-dev \ 28 g++-arm-linux-gnueabi \ 29 g++-arm-linux-gnueabihf \ 30 g++-aarch64-linux-gnu \ 31 g++-mips64-linux-gnuabi64 \ 32 g++-mips64el-linux-gnuabi64 \ 33 gcc-sparc64-linux-gnu \ 34 libc6-dev-sparc64-cross \ 35 bzip2 \ 36 patch \ 37 libssl-dev \ 38 pkg-config \ 39 libnewlib-arm-none-eabi \ 40 qemu-system-arm \ 41# software-properties-common for the add-apt-repository command 42 software-properties-common 43 44WORKDIR /build 45 46# Use the team-gcc-arm-embedded PPA for a newer version of Arm GCC 47RUN add-apt-repository ppa:team-gcc-arm-embedded/ppa && \ 48 apt-get update && \ 49 apt-get install -y --no-install-recommends gcc-arm-embedded 50 51COPY scripts/rustbuild-setup.sh dist-various-1/build-riscv-toolchain.sh dist-various-1/riscv64-unknown-linux-gnu.config dist-various-1/crosstool-ng.sh /build/ 52RUN ./crosstool-ng.sh 53 54# Crosstool-ng will refuse to build as root 55RUN sh ./rustbuild-setup.sh 56USER rustbuild 57 58RUN ./build-riscv-toolchain.sh 59 60USER root 61ENV PATH=/x-tools/riscv64-unknown-linux-gnu/bin:$PATH 62 63COPY dist-various-1/build-rumprun.sh /build 64RUN ./build-rumprun.sh 65 66COPY dist-various-1/install-x86_64-redox.sh /build 67RUN ./install-x86_64-redox.sh 68 69COPY dist-various-1/install-mips-musl.sh /build 70RUN ./install-mips-musl.sh 71 72COPY dist-various-1/install-mipsel-musl.sh /build 73RUN ./install-mipsel-musl.sh 74 75# Suppress some warnings in the openwrt toolchains we downloaded 76ENV STAGING_DIR=/tmp 77 78COPY scripts/musl.sh /build 79RUN env \ 80 CC=arm-linux-gnueabi-gcc CFLAGS="-march=armv5te -marm -mfloat-abi=soft" \ 81 CXX=arm-linux-gnueabi-g++ CXXFLAGS="-march=armv5te -marm -mfloat-abi=soft" \ 82 bash musl.sh armv5te && \ 83 env \ 84 CC=arm-linux-gnueabi-gcc CFLAGS="-march=armv6 -marm" \ 85 CXX=arm-linux-gnueabi-g++ CXXFLAGS="-march=armv6 -marm" \ 86 bash musl.sh arm && \ 87 env \ 88 CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv6 -marm -mfpu=vfp" \ 89 CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv6 -marm -mfpu=vfp" \ 90 bash musl.sh armhf && \ 91 env \ 92 CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv7-a" \ 93 CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv7-a" \ 94 bash musl.sh armv7hf && \ 95 env \ 96 CC=aarch64-linux-gnu-gcc \ 97 CXX=aarch64-linux-gnu-g++ \ 98 bash musl.sh aarch64 && \ 99 env \ 100 CC=mips-openwrt-linux-gcc \ 101 CXX=mips-openwrt-linux-g++ \ 102 bash musl.sh mips && \ 103 env \ 104 CC=mipsel-openwrt-linux-gcc \ 105 CXX=mipsel-openwrt-linux-g++ \ 106 bash musl.sh mipsel && \ 107 env \ 108 CC=mips64-linux-gnuabi64-gcc \ 109 CXX=mips64-linux-gnuabi64-g++ \ 110 bash musl.sh mips64 && \ 111 env \ 112 CC=mips64el-linux-gnuabi64-gcc \ 113 CXX=mips64el-linux-gnuabi64-g++ \ 114 bash musl.sh mips64el && \ 115 rm -rf /build/* 116 117# FIXME(mozilla/sccache#235) this shouldn't be necessary but is currently 118# necessary to disambiguate the mips compiler with the mipsel compiler. We want 119# to give these two wrapper scripts (currently identical ones) different hashes 120# to ensure that sccache understands that they're different compilers. 121RUN \ 122 echo "# a" >> /usr/local/mips-linux-musl/bin/mips-openwrt-linux-musl-wrapper.sh && \ 123 echo "# b" >> /usr/local/mipsel-linux-musl/bin/mipsel-openwrt-linux-musl-wrapper.sh 124 125ENV RUN_MAKE_TARGETS=thumbv6m-none-eabi 126ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7m-none-eabi 127ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabi 128ENV RUN_MAKE_TARGETS=$RUN_MAKE_TARGETS,thumbv7em-none-eabihf 129 130ENV TARGETS=asmjs-unknown-emscripten 131ENV TARGETS=$TARGETS,wasm32-unknown-emscripten 132ENV TARGETS=$TARGETS,x86_64-rumprun-netbsd 133ENV TARGETS=$TARGETS,mips-unknown-linux-musl 134ENV TARGETS=$TARGETS,mipsel-unknown-linux-musl 135ENV TARGETS=$TARGETS,mips64-unknown-linux-muslabi64 136ENV TARGETS=$TARGETS,mips64el-unknown-linux-muslabi64 137ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi 138ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf 139ENV TARGETS=$TARGETS,armv5te-unknown-linux-gnueabi 140ENV TARGETS=$TARGETS,armv5te-unknown-linux-musleabi 141ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabihf 142ENV TARGETS=$TARGETS,aarch64-unknown-linux-musl 143ENV TARGETS=$TARGETS,sparc64-unknown-linux-gnu 144ENV TARGETS=$TARGETS,x86_64-unknown-redox 145ENV TARGETS=$TARGETS,thumbv6m-none-eabi 146ENV TARGETS=$TARGETS,thumbv7m-none-eabi 147ENV TARGETS=$TARGETS,thumbv7em-none-eabi 148ENV TARGETS=$TARGETS,thumbv7em-none-eabihf 149ENV TARGETS=$TARGETS,thumbv8m.base-none-eabi 150ENV TARGETS=$TARGETS,thumbv8m.main-none-eabi 151ENV TARGETS=$TARGETS,thumbv8m.main-none-eabihf 152ENV TARGETS=$TARGETS,riscv32i-unknown-none-elf 153ENV TARGETS=$TARGETS,riscv32imc-unknown-none-elf 154ENV TARGETS=$TARGETS,riscv32imac-unknown-none-elf 155ENV TARGETS=$TARGETS,riscv64imac-unknown-none-elf 156ENV TARGETS=$TARGETS,riscv64gc-unknown-none-elf 157ENV TARGETS=$TARGETS,riscv64gc-unknown-linux-gnu 158ENV TARGETS=$TARGETS,armebv7r-none-eabi 159ENV TARGETS=$TARGETS,armebv7r-none-eabihf 160ENV TARGETS=$TARGETS,armv7r-none-eabi 161ENV TARGETS=$TARGETS,armv7r-none-eabihf 162ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf 163ENV TARGETS=$TARGETS,armv7a-none-eabi 164 165# riscv targets currently do not need a C compiler, as compiler_builtins 166# doesn't currently have it enabled, and the riscv gcc compiler is not 167# installed. 168ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \ 169 CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \ 170 CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc \ 171 CC_mips64_unknown_linux_muslabi64=mips64-linux-gnuabi64-gcc \ 172 CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \ 173 CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \ 174 CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \ 175 AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \ 176 CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \ 177 CC_armv7a_none_eabi=arm-none-eabi-gcc \ 178 CC_armv7a_none_eabihf=arm-none-eabi-gcc \ 179 CFLAGS_armv7a_none_eabi=-march=armv7-a \ 180 CFLAGS_armv7a_none_eabihf=-march=armv7-a+vfpv3 \ 181 CC_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \ 182 AR_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-ar \ 183 CXX_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-g++ \ 184 CC_riscv32i_unknown_none_elf=false \ 185 CC_riscv32imc_unknown_none_elf=false \ 186 CC_riscv32imac_unknown_none_elf=false \ 187 CC_riscv64imac_unknown_none_elf=false \ 188 CC_riscv64gc_unknown_none_elf=false 189 190ENV RUST_CONFIGURE_ARGS \ 191 --musl-root-armv5te=/musl-armv5te \ 192 --musl-root-arm=/musl-arm \ 193 --musl-root-armhf=/musl-armhf \ 194 --musl-root-armv7hf=/musl-armv7hf \ 195 --musl-root-aarch64=/musl-aarch64 \ 196 --musl-root-mips=/musl-mips \ 197 --musl-root-mipsel=/musl-mipsel \ 198 --musl-root-mips64=/musl-mips64 \ 199 --musl-root-mips64el=/musl-mips64el \ 200 --disable-docs 201 202ENV SCRIPT \ 203 python2.7 ../x.py test --target $RUN_MAKE_TARGETS src/test/run-make && \ 204 python2.7 ../x.py dist --target $TARGETS 205 206# sccache 207COPY scripts/sccache.sh /scripts/ 208RUN sh /scripts/sccache.sh