1
- FROM centos:5
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
2
5
3
6
WORKDIR /build
4
7
5
- # Centos 5 is EOL and is no longer available from the usual mirrors, so switch
6
- # to http://vault.centos.org/
7
- RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
8
- RUN sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
9
- RUN sed -i 's|#\( baseurl.*\) mirror.centos.org/centos/$releasever|\1 vault.centos.org/5.11|' /etc/yum.repos.d/*.repo
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
10
12
11
- RUN yum upgrade -y && yum install -y \
12
- curl \
13
+ RUN apt-get update && \
14
+ apt-get install --allow-unauthenticated -y --no-install-recommends \
15
+ automake \
13
16
bzip2 \
17
+ ca-certificates \
18
+ curl \
19
+ file \
20
+ g++ \
21
+ g++-multilib \
14
22
gcc \
15
- gcc-c++ \
23
+ gcc-multilib \
24
+ git \
25
+ lib32z1-dev \
26
+ libedit-dev \
27
+ libncurses-dev \
16
28
make \
17
- glibc-devel \
29
+ patch \
18
30
perl \
19
- zlib-devel \
20
- file \
21
- xz \
22
- which \
23
- pkgconfig \
31
+ pkg-config \
32
+ unzip \
24
33
wget \
25
- autoconf \
26
- gettext
34
+ xz-utils \
35
+ zlib1g-dev
27
36
28
37
ENV PATH=/rustroot/bin:$PATH
29
- ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib
38
+ ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/ lib
30
39
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
31
40
WORKDIR /tmp
41
+ RUN mkdir /home/user
32
42
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
33
43
34
44
# We need a build of openssl which supports SNI to download artifacts from
@@ -38,14 +48,14 @@ COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
38
48
COPY host-x86_64/dist-x86_64-linux/build-openssl.sh /tmp/
39
49
RUN ./build-openssl.sh
40
50
41
- # The `curl` binary on CentOS doesn't support SNI which is needed for fetching
51
+ # The `curl` binary on Debian 6 doesn't support SNI which is needed for fetching
42
52
# some https urls we have, so install a new version of libcurl + curl which is
43
53
# using the openssl we just built previously.
44
54
#
45
55
# Note that we also disable a bunch of optional features of curl that we don't
46
56
# really need.
47
57
COPY host-x86_64/dist-x86_64-linux/build-curl.sh /tmp/
48
- RUN ./build-curl.sh
58
+ RUN ./build-curl.sh && apt-get remove -y curl
49
59
50
60
# binutils < 2.22 has a bug where the 32-bit executables it generates
51
61
# immediately segfault in Rust, so we need to install our own binutils.
@@ -54,40 +64,24 @@ RUN ./build-curl.sh
54
64
COPY host-x86_64/dist-x86_64-linux/build-binutils.sh /tmp/
55
65
RUN ./build-binutils.sh
56
66
57
- # libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS
58
- # only has 2.6.4, so build our own
59
- COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
60
- RUN ./build-cmake.sh
61
-
62
- # Need a newer version of gcc than centos has to compile LLVM nowadays
67
+ # Need at least GCC 5.1 to compile LLVM nowadays
63
68
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
64
- RUN ./build-gcc.sh
69
+ RUN ./build-gcc.sh && apt-get remove -y gcc g++
65
70
66
- # CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+
71
+ # Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
67
72
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
68
73
RUN ./build-python.sh
69
74
70
- # Now build LLVM+Clang 7, afterwards configuring further compilations to use the
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
71
80
# clang/clang++ compilers.
72
- COPY host-x86_64/dist-x86_64-linux/build-clang.sh host-x86_64/dist-x86_64-linux/llvm-project-centos.patch /tmp/
81
+ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
73
82
RUN ./build-clang.sh
74
83
ENV CC=clang CXX=clang++
75
84
76
- # Apparently CentOS 5.5 desn't have `git` in yum, but we're gonna need it for
77
- # cloning, so download and build it here.
78
- COPY host-x86_64/dist-x86_64-linux/build-git.sh /tmp/
79
- RUN ./build-git.sh
80
-
81
- # for sanitizers, we need kernel headers files newer than the ones CentOS ships
82
- # with so we install newer ones here
83
- COPY host-x86_64/dist-x86_64-linux/build-headers.sh /tmp/
84
- RUN ./build-headers.sh
85
-
86
- # OpenSSL requires a more recent version of perl
87
- # with so we install newer ones here
88
- COPY host-x86_64/dist-x86_64-linux/build-perl.sh /tmp/
89
- RUN ./build-perl.sh
90
-
91
85
COPY scripts/sccache.sh /scripts/
92
86
RUN sh /scripts/sccache.sh
93
87
@@ -117,4 +111,11 @@ ENV CFLAGS -mstackrealign
117
111
# libcurl, instead it should compile its own.
118
112
ENV LIBCURL_NO_PKG_CONFIG 1
119
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
+
120
121
ENV DIST_REQUIRE_ALL_TOOLS 1
0 commit comments