Skip to content

Commit a1610e3

Browse files
committed
copy build-gcc.sh for dist-i686-linux from dist-x86_64-linux
1 parent 712d962 commit a1610e3

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN mkdir /home/user
4444
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
4545

4646
# Need at least GCC 5.1 to compile LLVM nowadays
47-
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
47+
COPY host-x86_64/dist-i686-linux/build-gcc.sh /tmp/
4848
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
4949

5050
COPY scripts/cmake.sh /tmp/
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
source shared.sh
5+
6+
GCC=8.5.0
7+
8+
curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | xzcat | tar xf -
9+
cd gcc-$GCC
10+
11+
# FIXME(#49246): Remove the `sed` below.
12+
#
13+
# On 2018 March 21st, two Travis builders' cache for Docker are suddenly invalidated. Normally this
14+
# is fine, because we just need to rebuild the Docker image. However, it reveals a network issue:
15+
# downloading from `ftp://gcc.gnu.org/` from Travis (using passive mode) often leads to "Connection
16+
# timed out" error, and even when the download completed, the file is usually corrupted. This causes
17+
# nothing to be landed that day.
18+
#
19+
# We observed that the `gcc-4.8.5.tar.bz2` above can be downloaded successfully, so as a stability
20+
# improvement we try to download from the HTTPS mirror instead. Turns out this uncovered the third
21+
# bug: the host `gcc.gnu.org` and `cygwin.com` share the same IP, and the TLS certificate of the
22+
# latter host is presented to `wget`! Therefore, we choose to download from the insecure HTTP server
23+
# instead here.
24+
#
25+
sed -i'' 's|ftp://gcc\.gnu\.org/|https://gcc.gnu.org/|g' ./contrib/download_prerequisites
26+
27+
./contrib/download_prerequisites
28+
mkdir ../gcc-build
29+
cd ../gcc-build
30+
hide_output ../gcc-$GCC/configure \
31+
--prefix=/rustroot \
32+
--enable-languages=c,c++ \
33+
--disable-gnu-unique-object
34+
hide_output make -j$(nproc)
35+
hide_output make install
36+
ln -s gcc /rustroot/bin/cc
37+
38+
cd ..
39+
rm -rf gcc-build
40+
rm -rf gcc-$GCC
41+
42+
# FIXME: clang doesn't find 32-bit libraries in /rustroot/lib,
43+
# but it does look all the way under /rustroot/lib/[...]/32,
44+
# so we can link stuff there to help it out.
45+
ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/

0 commit comments

Comments
 (0)