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.
18 TARGET=powerpc64le-linux-gnu
19 SYSROOT=/usr/local/$TARGET/sysroot
21 # First, download the CentOS7 glibc.ppc64le and relevant header files.
22 # (upstream ppc64le support wasn't added until 2.19, which el7 backported.)
26 centos_base=http://mirror.centos.org/altarch/7.3.1611/os/ppc64le/Packages
28 kernel_v=3.10.0-514.el7
29 for package in glibc{,-devel,-headers}-$glibc_v kernel-headers-$kernel_v; do
30 curl $centos_base/$package.ppc64le.rpm | \
31 rpm2cpio - | cpio -idm
39 # Next, download and build binutils.
40 mkdir binutils-$TARGET
41 pushd binutils-$TARGET
42 curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.bz2 | tar xjf -
45 hide_output ../binutils-$BINUTILS/configure --target=$TARGET --with-sysroot=$SYSROOT
47 hide_output make install
49 rm -rf binutils-$TARGET
51 # Finally, download and build gcc.
54 curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.bz2 | tar xjf -
56 hide_output ./contrib/download_prerequisites
60 hide_output ../gcc-$GCC/configure \
61 --enable-languages=c,c++ \
64 --with-sysroot=$SYSROOT \
65 --disable-libcilkrts \
69 --disable-libquadmath \
74 --disable-libsanitizer \
75 --disable-libquadmath-support \
77 hide_output hide_output make -j10
78 hide_output make install