1 # Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
16 echo ERROR: An error was encountered with the build.
21 bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
33 export CFLAGS="-fPIC $CFLAGS"
35 # FIXME: remove the patch when upate to 1.1.20
38 # may have been downloaded in a previous run
39 if [ ! -d $MUSL ]; then
40 curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
41 # Patch to fix https://github.com/rust-lang/rust/issues/48967
43 curl "https://git.musl-libc.org/cgit/musl/patch/?id=610c5a8524c3d6cd3ac5a5f1231422e7648a3791" |\
49 ./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG $@
50 if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
51 hide_output make -j$(nproc) AR=ar RANLIB=ranlib
53 hide_output make -j$(nproc)
55 hide_output make install
56 hide_output make clean
62 # may have been downloaded in a previous run
63 if [ ! -d libunwind-release_$LLVM ]; then
64 curl -L https://github.com/llvm-mirror/llvm/archive/release_$LLVM.tar.gz | tar xzf -
65 curl -L https://github.com/llvm-mirror/libunwind/archive/release_$LLVM.tar.gz | tar xzf -
70 cmake ../libunwind-release_$LLVM \
71 -DLLVM_PATH=/build/llvm-release_$LLVM \
72 -DLIBUNWIND_ENABLE_SHARED=0 \
73 -DCMAKE_C_COMPILER=$CC \
74 -DCMAKE_CXX_COMPILER=$CXX \
75 -DCMAKE_C_FLAGS="$CFLAGS" \
76 -DCMAKE_CXX_FLAGS="$CXXFLAGS"
78 hide_output make -j$(nproc)
79 cp lib/libunwind.a /musl-$TAG/lib
80 cd ../ && rm -rf libunwind-build