about summary refs log tree commit diff
path: root/src/ci/docker/dist-i686-linux/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'src/ci/docker/dist-i686-linux/Dockerfile')
-rw-r--r--src/ci/docker/dist-i686-linux/Dockerfile49
1 files changed, 33 insertions, 16 deletions
diff --git a/src/ci/docker/dist-i686-linux/Dockerfile b/src/ci/docker/dist-i686-linux/Dockerfile
index 0ec57ee0886..d591fb28f36 100644
--- a/src/ci/docker/dist-i686-linux/Dockerfile
+++ b/src/ci/docker/dist-i686-linux/Dockerfile
@@ -29,13 +29,13 @@ ENV PATH=/rustroot/bin:$PATH
 ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib
 ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
 WORKDIR /tmp
-COPY dist-i686-linux/shared.sh dist-i686-linux/build-binutils.sh /tmp/
+COPY dist-x86_64-linux/shared.sh /tmp/
 
 # We need a build of openssl which supports SNI to download artifacts from
 # static.rust-lang.org. This'll be used to link into libcurl below (and used
 # later as well), so build a copy of OpenSSL with dynamic libraries into our
 # generic root.
-COPY dist-i686-linux/build-openssl.sh /tmp/
+COPY dist-x86_64-linux/build-openssl.sh /tmp/
 RUN ./build-openssl.sh
 
 # The `curl` binary on CentOS doesn't support SNI which is needed for fetching
@@ -44,36 +44,43 @@ RUN ./build-openssl.sh
 #
 # Note that we also disable a bunch of optional features of curl that we don't
 # really need.
-COPY dist-i686-linux/build-curl.sh /tmp/
+COPY dist-x86_64-linux/build-curl.sh /tmp/
 RUN ./build-curl.sh
 
 # binutils < 2.22 has a bug where the 32-bit executables it generates
 # immediately segfault in Rust, so we need to install our own binutils.
 #
 # See https://github.com/rust-lang/rust/issues/20440 for more info
+COPY dist-x86_64-linux/build-binutils.sh /tmp/
 RUN ./build-binutils.sh
 
+# libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS
+# only has 2.6.4, so build our own
+COPY dist-x86_64-linux/build-cmake.sh /tmp/
+RUN ./build-cmake.sh
+
 # Need a newer version of gcc than centos has to compile LLVM nowadays
-COPY dist-i686-linux/build-gcc.sh /tmp/
+COPY dist-x86_64-linux/build-gcc.sh /tmp/
 RUN ./build-gcc.sh
 
 # CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+
-COPY dist-i686-linux/build-python.sh /tmp/
+COPY dist-x86_64-linux/build-python.sh /tmp/
 RUN ./build-python.sh
 
+# Now build LLVM+Clang 6, afterwards configuring further compilations to use the
+# clang/clang++ compilers.
+COPY dist-x86_64-linux/build-clang.sh /tmp/
+RUN ./build-clang.sh
+ENV CC=clang CXX=clang++
+
 # Apparently CentOS 5.5 desn't have `git` in yum, but we're gonna need it for
 # cloning, so download and build it here.
-COPY dist-i686-linux/build-git.sh /tmp/
+COPY dist-x86_64-linux/build-git.sh /tmp/
 RUN ./build-git.sh
 
-# libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS
-# only has 2.6.4, so build our own
-COPY dist-i686-linux/build-cmake.sh /tmp/
-RUN ./build-cmake.sh
-
 # for sanitizers, we need kernel headers files newer than the ones CentOS ships
 # with so we install newer ones here
-COPY dist-i686-linux/build-headers.sh /tmp/
+COPY dist-x86_64-linux/build-headers.sh /tmp/
 RUN ./build-headers.sh
 
 COPY scripts/sccache.sh /scripts/
@@ -84,11 +91,21 @@ ENV HOSTS=i686-unknown-linux-gnu
 ENV RUST_CONFIGURE_ARGS \
       --enable-full-tools \
       --enable-sanitizers \
-      --enable-profiler
+      --enable-profiler \
+      --set target.i686-unknown-linux-gnu.linker=clang \
+      --build=i686-unknown-linux-gnu
 ENV SCRIPT python2.7 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS
-
-# This is the only builder which will create source tarballs
-ENV DIST_SRC 1
+ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang
+
+# This was added when we switched from gcc to clang. It's not clear why this is
+# needed unfortunately, but without this the stage1 bootstrap segfaults
+# somewhere inside of a build script. The build ends up just hanging instead of
+# actually killing the process that segfaulted, but if the process is run
+# manually in a debugger the segfault is immediately seen as well as the
+# misaligned stack access.
+#
+# Added in #50200 there's some more logs there
+ENV CFLAGS -mstackrealign
 
 # When we build cargo in this container, we don't want it to use the system
 # libcurl, instead it should compile its own.