Bug 1462273 - Use more reliable mirrors for gcc dependencies. r?build
In the span of one week, both gmplib.org and multiprecision.org,
respective home of gmp and mpc have gone down. The latter is still down.
It turns out that all versions of gmp and mpfr we need are mirrored on
ftp.gnu.org, so we can just use that instead. For mpc, versions > 1.0
are on ftp.gnu.org, but not earlier versions.
The one mpc version <= 1.0 we do need is 0.8.2, and a copy of the exact
same archive, as per its sha256, which we're already checking per the
gcc build scripts, can be found on snapshot.debian.org. We lose gpg
validation on the way, but since we're already checking the sha256,
that's a fine tradeoff.
At least this unblocks changes to toolchains until multiprecision.org
comes back online.
--- a/build/unix/build-gcc/build-gcc.sh
+++ b/build/unix/build-gcc/build-gcc.sh
@@ -38,35 +38,47 @@ prepare() {
set -- --no-verify
. ./contrib/download_prerequisites
) 3>&1 > /dev/null | while read url; do
file=$(basename $url)
case "$file" in
gmp-*.tar.*)
# If download_prerequisites wants 4.3.2, use 5.1.3 instead.
file=${file/4.3.2/5.1.3}
- download_and_check https://gmplib.org/download/gmp $file.sig
+ download_and_check https://ftp.gnu.org/gnu/gmp/ $file.sig
;;
mpfr-*.tar.*)
# If download_prerequisites wants 2.4.2, use 3.1.5 instead.
file=${file/2.4.2/3.1.5}
- download_and_check http://www.mpfr.org/${file%.tar.*} $file.asc
+ download_and_check https://ftp.gnu.org/gnu/mpfr/ $file.sig
;;
mpc-*.tar.*)
# If download_prerequisites wants 0.8.1, use 0.8.2 instead.
file=${file/0.8.1/0.8.2}
case "$file" in
*-0.8.2.tar*|*-0.9.tar*|*-1.0.tar*)
ext=asc
;;
*)
ext=sig
;;
esac
- download_and_check http://www.multiprecision.org/downloads $file.$ext
+ case "$file" in
+ *-0.8.2.tar*)
+ # The ftp.gnu.org mirror doesn't have 0.8.2, so we use
+ # a debian source tarball instead. It has a different name,
+ # so we can't use `download`. Manually do what it does, but
+ # handling the difference in file name.
+ wget -c --progress=dot:mega -O $TMPDIR/$file http://snapshot.debian.org/archive/debian/20100527T162226Z/pool/main/m/mpclib/mpclib_0.8.2.orig.tar.gz
+ (cd $TMPDIR; sha256sum $file) >> $root_dir/downloads
+ ;;
+ *)
+ download_and_check https://ftp.gnu.org/gnu/mpc $file.$ext
+ ;;
+ esac
;;
*)
download $(dirname $url) $file
;;
esac
tar xaf $TMPDIR/$file
ln -sf ${file%.tar.*} ${file%-*}
done