1 # We document platform support for minimum glibc 2.17 and kernel 3.2.
2 # CentOS 7 has headers for kernel 3.10, but that's fine as long as we don't
3 # actually use newer APIs in rustc or std without a fallback. It's more
4 # important that we match glibc for ELF symbol versioning.
9 RUN yum upgrade -y && \
10 yum install -y epel-release && \
22 libstdc++-devel.i686 \
23 libstdc++-devel.x86_64 \
38 RUN mkdir -p /rustroot/bin && ln -s /usr/bin/cmake3 /rustroot/bin/cmake
40 ENV PATH=/rustroot/bin:$PATH
41 ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
42 ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
45 COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
47 # Need at least GCC 5.1 to compile LLVM nowadays
48 COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
49 RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
51 # Now build LLVM+Clang, afterwards configuring further compilations to use the
52 # clang/clang++ compilers.
53 COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
55 ENV CC=clang CXX=clang++
57 # rustc-perf version from 2022-07-22
58 ENV PERF_COMMIT 3c253134664fdcba862c539d37f0de18557a9a4c
59 RUN curl -LS -o perf.zip https://github.com/rust-lang/rustc-perf/archive/$PERF_COMMIT.zip && \
61 mv rustc-perf-$PERF_COMMIT rustc-perf && \
64 COPY scripts/sccache.sh /scripts/
65 RUN sh /scripts/sccache.sh
67 ENV PGO_HOST=x86_64-unknown-linux-gnu
69 ENV HOSTS=x86_64-unknown-linux-gnu
71 ENV RUST_CONFIGURE_ARGS \
75 --enable-compiler-docs \
76 --set target.x86_64-unknown-linux-gnu.linker=clang \
77 --set target.x86_64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
78 --set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
79 --set llvm.thin-lto=true \
80 --set llvm.ninja=false \
82 --set rust.use-lld=true \
84 ENV SCRIPT python3 ../src/ci/stage-build.py python3 ../x.py dist \
85 --host $HOSTS --target $HOSTS \
86 --include-default-paths \
87 build-manifest bootstrap
88 ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang
90 # This is the only builder which will create source tarballs
93 # When we build cargo in this container, we don't want it to use the system
94 # libcurl, instead it should compile its own.
95 ENV LIBCURL_NO_PKG_CONFIG 1
97 ENV DIST_REQUIRE_ALL_TOOLS 1