2 # Copyright 2017 The Rust Project Developers. See the COPYRIGHT
3 # file at the top-level directory of this distribution and at
4 # http://rust-lang.org/COPYRIGHT.
6 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9 # option. This file may not be copied, modified, or distributed
10 # except according to those terms.
16 TARGET=powerpc64le-linux-gnu
17 SYSROOT=/usr/local/$TARGET/sysroot
19 # First, download the CentOS7 glibc.ppc64le and relevant header files.
20 # (upstream ppc64le support wasn't added until 2.19, which el7 backported.)
24 centos_base=http://mirror.centos.org/altarch/7.3.1611/os/ppc64le/Packages
26 kernel_v=3.10.0-514.el7
27 for package in glibc{,-devel,-headers}-$glibc_v kernel-headers-$kernel_v; do
28 curl $centos_base/$package.ppc64le.rpm | \
29 rpm2cpio - | cpio -idm
37 # Next, download and build binutils.
38 mkdir binutils-$TARGET
39 pushd binutils-$TARGET
40 curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.bz2 | tar xjf -
43 ../binutils-$BINUTILS/configure --target=$TARGET --with-sysroot=$SYSROOT
47 rm -rf binutils-$TARGET
49 # Finally, download and build gcc.
52 curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.bz2 | tar xjf -
54 ./contrib/download_prerequisites
58 ../gcc-$GCC/configure \
59 --enable-languages=c,c++ \
62 --with-sysroot=$SYSROOT \
63 --disable-libcilkrts \
67 --disable-libquadmath \
72 --disable-libsanitizer \
73 --disable-libquadmath-support \