8 curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | xzcat | tar xf -
11 # FIXME(#49246): Remove the `sed` below.
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.
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
25 # FIXME: use HTTPS (see https://github.com/rust-lang/rust/pull/86586#issuecomment-868355356)
26 sed -i'' 's|ftp://gcc\.gnu\.org/|http://gcc.gnu.org/|g' ./contrib/download_prerequisites
28 ./contrib/download_prerequisites
31 hide_output ../gcc-$GCC/configure \
33 --enable-languages=c,c++ \
34 --disable-gnu-unique-object
35 hide_output make -j$(nproc)
36 hide_output make install
37 ln -s gcc /rustroot/bin/cc
43 # FIXME: clang doesn't find 32-bit libraries in /rustroot/lib,
44 # but it does look all the way under /rustroot/lib/[...]/32,
45 # so we can link stuff there to help it out.
46 ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/