fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1FROM ubuntu:22.04 2 3ARG DEBIAN_FRONTEND=noninteractive 4RUN apt-get update && apt-get install -y --no-install-recommends \ 5 g++-multilib \ 6 make \ 7 ninja-build \ 8 file \ 9 curl \ 10 ca-certificates \ 11 python3 \ 12 git \ 13 cmake \ 14 xz-utils \ 15 sudo \ 16 gdb \ 17 patch \ 18 libssl-dev \ 19 pkg-config 20 21COPY scripts/cross-apt-packages.sh /scripts/ 22RUN sh /scripts/cross-apt-packages.sh 23 24COPY scripts/crosstool-ng.sh /scripts/ 25RUN sh /scripts/crosstool-ng.sh 26 27COPY scripts/rustbuild-setup.sh /scripts/ 28RUN sh /scripts/rustbuild-setup.sh 29WORKDIR /tmp 30 31COPY scripts/crosstool-ng-build.sh /scripts/ 32COPY host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.defconfig /tmp/crosstool.defconfig 33RUN /scripts/crosstool-ng-build.sh 34 35ENV PATH=$PATH:/x-tools/i586-unknown-linux-gnu/bin 36ENV \ 37 CC_i586_unknown_linux_gnu=i586-unknown-linux-gnu-gcc \ 38 AR_i586_unknown_linux_gnu=i586-unknown-linux-gnu-ar 39 40WORKDIR /build/ 41COPY scripts/musl.sh /build/ 42RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \ 43 CXX=g++ CXXFLAGS="-m32 -Wa,-mrelax-relocations=no" \ 44 bash musl.sh i686 --target=i686 && \ 45 CC=gcc CFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \ 46 CXX=g++ CXXFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \ 47 bash musl.sh i586 --target=i586 && \ 48 rm -rf /build 49 50# FIXME: musl really shouldn't be linking libgcc_s.so, as it's linked to glibc, 51# but it's required by tests/ui/proc-macro/crt-static.rs. Ubuntu:16.04 gcc-5 52# had libgcc_s.so as a symlink to the absolute libgcc_s.so.1, but now it's an 53# ld-script that expects to find libgcc_s.so.1 in the library search path. 54# See also https://github.com/rust-lang/rust/issues/82521 55RUN ln -s /usr/lib32/libgcc_s.so.1 /musl-i686/lib/ 56 57COPY scripts/sccache.sh /scripts/ 58RUN sh /scripts/sccache.sh 59 60ENV RUST_CONFIGURE_ARGS \ 61 --musl-root-i586=/musl-i586 \ 62 --musl-root-i686=/musl-i686 \ 63 --disable-docs 64 65# Newer binutils broke things on some vms/distros (i.e., linking against 66# unknown relocs disabled by the following flag), so we need to go out of our 67# way to produce "super compatible" binaries. 68# 69# See: https://github.com/rust-lang/rust/issues/34978 70ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no 71ENV CFLAGS_i586_unknown_linux_gnu=-Wa,-mrelax-relocations=no 72ENV CFLAGS_i586_unknown_linux_musl=-Wa,-mrelax-relocations=no 73 74ENV TARGETS=i586-unknown-linux-gnu,i686-unknown-linux-musl 75 76ENV SCRIPT \ 77 python3 ../x.py --stage 2 test --host='' --target $TARGETS && \ 78 python3 ../x.py dist --host='' --target $TARGETS,i586-unknown-linux-musl