1- #! /bin/sh
1+ #! /bin/bash
22# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
33# file at the top-level directory of this distribution and at
44# http://rust-lang.org/COPYRIGHT.
@@ -13,48 +13,64 @@ set -ex
1313
1414MUSL=1.1.16
1515
16+ hide_output () {
17+ set +x
18+ on_err="
19+ echo ERROR: An error was encountered with the build.
20+ cat /tmp/build.log
21+ exit 1
22+ "
23+ trap " $on_err " ERR
24+ bash -c " while true; do sleep 30; echo \$ (date) - building ...; done" &
25+ PING_LOOP_PID=$!
26+ $@ & > /tmp/build.log
27+ trap - ERR
28+ kill $PING_LOOP_PID
29+ rm /tmp/build.log
30+ set -x
31+ }
32+
1633curl -O https://www.musl-libc.org/releases/musl-$MUSL .tar.gz
1734tar xf musl-$MUSL .tar.gz
1835cd musl-$MUSL
1936CC=arm-linux-gnueabi-gcc \
2037CFLAGS=" -march=armv6 -marm" \
21- ./configure \
38+ hide_output ./configure \
2239 --prefix=/usr/local/arm-linux-musleabi \
2340 --enable-wrapper=gcc
24- make -j$( nproc)
25- make install
41+ hide_output make -j$( nproc)
42+ hide_output make install
2643cd ..
2744rm -rf musl-$MUSL
2845
2946tar xf musl-$MUSL .tar.gz
3047cd musl-$MUSL
3148CC=arm-linux-gnueabihf-gcc \
3249CFLAGS=" -march=armv6 -marm" \
33- ./configure \
50+ hide_output ./configure \
3451 --prefix=/usr/local/arm-linux-musleabihf \
3552 --enable-wrapper=gcc
36- make -j$( nproc)
37- make install
53+ hide_output make -j$( nproc)
54+ hide_output make install
3855cd ..
3956rm -rf musl-$MUSL
4057
4158tar xf musl-$MUSL .tar.gz
4259cd musl-$MUSL
4360CC=arm-linux-gnueabihf-gcc \
4461CFLAGS=" -march=armv7-a" \
45- ./configure \
62+ hide_output ./configure \
4663 --prefix=/usr/local/armv7-linux-musleabihf \
4764 --enable-wrapper=gcc
48- make -j$( nproc)
49- make install
65+ hide_output make -j$( nproc)
66+ hide_output make install
5067cd ..
5168rm -rf musl-$MUSL *
5269
5370ln -nsf ../arm-linux-musleabi/bin/musl-gcc /usr/local/bin/arm-linux-musleabi-gcc
5471ln -nsf ../arm-linux-musleabihf/bin/musl-gcc /usr/local/bin/arm-linux-musleabihf-gcc
5572ln -nsf ../armv7-linux-musleabihf/bin/musl-gcc /usr/local/bin/armv7-linux-musleabihf-gcc
5673
57-
5874curl -L https://github.com/llvm-mirror/llvm/archive/release_39.tar.gz | tar xzf -
5975curl -L https://github.com/llvm-mirror/libunwind/archive/release_39.tar.gz | tar xzf -
6076
0 commit comments