fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
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. 5FROM centos:7 6 7WORKDIR /build 8 9RUN yum upgrade -y && \ 10 yum install -y epel-release && \ 11 yum install -y \ 12 automake \ 13 bzip2 \ 14 file \ 15 gcc \ 16 gcc-c++ \ 17 git \ 18 glibc-devel.i686 \ 19 glibc-devel.x86_64 \ 20 libedit-devel \ 21 libstdc++-devel.i686 \ 22 libstdc++-devel.x86_64 \ 23 make \ 24 ncurses-devel \ 25 openssl-devel \ 26 patch \ 27 perl \ 28 pkgconfig \ 29 python3 \ 30 unzip \ 31 wget \ 32 xz \ 33 zlib-devel.i686 \ 34 zlib-devel.x86_64 \ 35 && yum clean all 36 37RUN mkdir -p /rustroot/bin 38 39ENV PATH=/rustroot/bin:$PATH 40ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib 41ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig 42WORKDIR /tmp 43RUN mkdir /home/user 44COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/ 45 46# Need at least GCC 5.1 to compile LLVM nowadays 47COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/ 48RUN ./build-gcc.sh && yum remove -y gcc gcc-c++ 49 50COPY scripts/cmake.sh /tmp/ 51RUN ./cmake.sh 52 53# Now build LLVM+Clang, afterwards configuring further compilations to use the 54# clang/clang++ compilers. 55COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/ 56RUN ./build-clang.sh 57ENV CC=clang CXX=clang++ 58 59COPY scripts/sccache.sh /scripts/ 60RUN sh /scripts/sccache.sh 61 62ENV HOSTS=i686-unknown-linux-gnu 63 64ENV RUST_CONFIGURE_ARGS \ 65 --enable-full-tools \ 66 --enable-sanitizers \ 67 --enable-profiler \ 68 --set target.i686-unknown-linux-gnu.linker=clang \ 69 --build=i686-unknown-linux-gnu \ 70 --set llvm.ninja=false \ 71 --set rust.jemalloc 72ENV SCRIPT python3 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS 73ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang 74 75# This was added when we switched from gcc to clang. It's not clear why this is 76# needed unfortunately, but without this the stage1 bootstrap segfaults 77# somewhere inside of a build script. The build ends up just hanging instead of 78# actually killing the process that segfaulted, but if the process is run 79# manually in a debugger the segfault is immediately seen as well as the 80# misaligned stack access. 81# 82# Added in #50200 there's some more logs there 83ENV CFLAGS -mstackrealign 84 85# When we build cargo in this container, we don't want it to use the system 86# libcurl, instead it should compile its own. 87ENV LIBCURL_NO_PKG_CONFIG 1 88 89# There was a bad interaction between "old" 32-bit binaries on current 64-bit 90# kernels with selinux enabled, where ASLR mmap would sometimes choose a low 91# address and then block it for being below `vm.mmap_min_addr` -> `EACCES`. 92# This is probably a kernel bug, but setting `ulimit -Hs` works around it. 93# See also `src/ci/run.sh` where this takes effect. 94ENV SET_HARD_RLIMIT_STACK 1 95 96ENV DIST_REQUIRE_ALL_TOOLS 1