]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile
Fix typo in TLS Model in Unstable Book
[rust.git] / src / ci / docker / host-x86_64 / dist-i686-linux / Dockerfile
1 # We use Debian 6 (glibc 2.11, kernel 2.6.32) as a common base for other
2 # distros that still need Rust support: RHEL 6 (glibc 2.12, kernel 2.6.32) and
3 # SLES 11 SP4 (glibc 2.11, kernel 3.0).
4 FROM debian:6
5
6 WORKDIR /build
7
8 # Debian 6 is EOL and no longer available from the usual mirrors,
9 # so we'll need to switch to http://archive.debian.org/
10 RUN sed -i '/updates/d' /etc/apt/sources.list && \
11     sed -i 's/httpredir/archive/' /etc/apt/sources.list
12
13 RUN apt-get update && \
14     apt-get install --allow-unauthenticated -y --no-install-recommends \
15       automake \
16       bzip2 \
17       ca-certificates \
18       curl \
19       file \
20       g++ \
21       g++-multilib \
22       gcc \
23       gcc-multilib \
24       git \
25       lib32z1-dev \
26       libedit-dev \
27       libncurses-dev \
28       make \
29       patch \
30       perl \
31       pkg-config \
32       unzip \
33       wget \
34       xz-utils \
35       zlib1g-dev
36
37 ENV PATH=/rustroot/bin:$PATH
38 ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
39 ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
40 WORKDIR /tmp
41 RUN mkdir /home/user
42 COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
43
44 # We need a build of openssl which supports SNI to download artifacts from
45 # static.rust-lang.org. This'll be used to link into libcurl below (and used
46 # later as well), so build a copy of OpenSSL with dynamic libraries into our
47 # generic root.
48 COPY host-x86_64/dist-x86_64-linux/build-openssl.sh /tmp/
49 RUN ./build-openssl.sh
50
51 # The `curl` binary on Debian 6 doesn't support SNI which is needed for fetching
52 # some https urls we have, so install a new version of libcurl + curl which is
53 # using the openssl we just built previously.
54 #
55 # Note that we also disable a bunch of optional features of curl that we don't
56 # really need.
57 COPY host-x86_64/dist-x86_64-linux/build-curl.sh /tmp/
58 RUN ./build-curl.sh && apt-get remove -y curl
59
60 # binutils < 2.22 has a bug where the 32-bit executables it generates
61 # immediately segfault in Rust, so we need to install our own binutils.
62 #
63 # See https://github.com/rust-lang/rust/issues/20440 for more info
64 COPY host-x86_64/dist-x86_64-linux/build-binutils.sh /tmp/
65 RUN ./build-binutils.sh
66
67 # Need at least GCC 5.1 to compile LLVM nowadays
68 COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
69 RUN ./build-gcc.sh && apt-get remove -y gcc g++
70
71 # Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
72 COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
73 RUN ./build-python.sh
74
75 # LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
76 COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
77 RUN ./build-cmake.sh
78
79 # Now build LLVM+Clang, afterwards configuring further compilations to use the
80 # clang/clang++ compilers.
81 COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
82 RUN ./build-clang.sh
83 ENV CC=clang CXX=clang++
84
85 COPY scripts/sccache.sh /scripts/
86 RUN sh /scripts/sccache.sh
87
88 ENV HOSTS=i686-unknown-linux-gnu
89
90 ENV RUST_CONFIGURE_ARGS \
91       --enable-full-tools \
92       --enable-sanitizers \
93       --enable-profiler \
94       --set target.i686-unknown-linux-gnu.linker=clang \
95       --build=i686-unknown-linux-gnu \
96       --set rust.jemalloc
97 ENV SCRIPT python2.7 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS
98 ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang
99
100 # This was added when we switched from gcc to clang. It's not clear why this is
101 # needed unfortunately, but without this the stage1 bootstrap segfaults
102 # somewhere inside of a build script. The build ends up just hanging instead of
103 # actually killing the process that segfaulted, but if the process is run
104 # manually in a debugger the segfault is immediately seen as well as the
105 # misaligned stack access.
106 #
107 # Added in #50200 there's some more logs there
108 ENV CFLAGS -mstackrealign
109
110 # When we build cargo in this container, we don't want it to use the system
111 # libcurl, instead it should compile its own.
112 ENV LIBCURL_NO_PKG_CONFIG 1
113
114 # There was a bad interaction between "old" 32-bit binaries on current 64-bit
115 # kernels with selinux enabled, where ASLR mmap would sometimes choose a low
116 # address and then block it for being below `vm.mmap_min_addr` -> `EACCES`.
117 # This is probably a kernel bug, but setting `ulimit -Hs` works around it.
118 # See also `src/ci/run.sh` where this takes effect.
119 ENV SET_HARD_RLIMIT_STACK 1
120
121 ENV DIST_REQUIRE_ALL_TOOLS 1