]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/host-x86_64/dist-powerpc64-linux/build-powerpc64-toolchain.sh
Add `x.sh` and `x.ps1` shell scripts
[rust.git] / src / ci / docker / host-x86_64 / dist-powerpc64-linux / build-powerpc64-toolchain.sh
1 #!/usr/bin/env bash
2 set -ex
3
4 source shared.sh
5
6 BINUTILS=2.32
7 TARGET=powerpc64-unknown-linux-gnu
8 PREFIX=/x-tools/$TARGET
9 SYSROOT=$PREFIX/$TARGET/sysroot
10
11 mkdir build
12 cd build
13 cp ../powerpc64-linux-gnu.config .config
14 hide_output ct-ng build
15 cd ..
16 rm -rf build
17
18 chmod -R u+w $PREFIX
19
20 # Next, download and build newer binutils.
21 mkdir binutils-$TARGET
22 pushd binutils-$TARGET
23 curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.bz2 | tar xjf -
24 mkdir binutils-build
25 cd binutils-build
26 hide_output ../binutils-$BINUTILS/configure --target=$TARGET \
27   --prefix=$PREFIX --with-sysroot=$SYSROOT
28 hide_output make -j10
29 hide_output make install
30 popd
31 rm -rf binutils-$TARGET