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 COPY scripts/sccache.sh /scripts/
58 RUN sh /scripts/sccache.sh
60 ENV HOSTS=i686-unknown-linux-gnu
62 ENV RUST_CONFIGURE_ARGS \
66 --set target.i686-unknown-linux-gnu.linker=clang \
67 --build=i686-unknown-linux-gnu \
68 --set llvm.ninja=false \
70 ENV SCRIPT python3 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS
71 ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang
73 # This was added when we switched from gcc to clang. It's not clear why this is
74 # needed unfortunately, but without this the stage1 bootstrap segfaults
75 # somewhere inside of a build script. The build ends up just hanging instead of
76 # actually killing the process that segfaulted, but if the process is run
77 # manually in a debugger the segfault is immediately seen as well as the
78 # misaligned stack access.
80 # Added in #50200 there's some more logs there
81 ENV CFLAGS -mstackrealign
83 # When we build cargo in this container, we don't want it to use the system
84 # libcurl, instead it should compile its own.
85 ENV LIBCURL_NO_PKG_CONFIG 1
87 # There was a bad interaction between "old" 32-bit binaries on current 64-bit
88 # kernels with selinux enabled, where ASLR mmap would sometimes choose a low
89 # address and then block it for being below `vm.mmap_min_addr` -> `EACCES`.
90 # This is probably a kernel bug, but setting `ulimit -Hs` works around it.
91 # See also `src/ci/run.sh` where this takes effect.
92 ENV SET_HARD_RLIMIT_STACK 1
94 ENV DIST_REQUIRE_ALL_TOOLS 1