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" &
32 #TARGET=linux-musl-$ARCH
38 git clone https://github.com/richfelker/musl-cross-make -b v0.9.7
41 hide_output make -j$(nproc) TARGET=$TARGET
42 hide_output make install TARGET=$TARGET OUTPUT=$OUTPUT
46 # Make musl binaries executable
48 ln -s $OUTPUT/$TARGET/lib/ld-musl-$ARCH.so.1 /lib
49 ln -s $OUTPUT/$TARGET/lib/libc.so /lib
50 echo $OUTPUT/$TARGET/lib >> /etc/ld-musl-$ARCH.path
54 export CXX=$TARGET-g++
58 # may have been downloaded in a previous run
59 if [ ! -d libunwind-release_$LLVM ]; then
60 curl -L https://github.com/llvm-mirror/llvm/archive/release_$LLVM.tar.gz | tar xzf -
61 curl -L https://github.com/llvm-mirror/libunwind/archive/release_$LLVM.tar.gz | tar xzf -
66 cmake ../libunwind-release_$LLVM \
67 -DLLVM_PATH=/build/llvm-release_$LLVM \
68 -DLIBUNWIND_ENABLE_SHARED=0 \
69 -DCMAKE_C_COMPILER=$CC \
70 -DCMAKE_CXX_COMPILER=$CXX \
71 -DCMAKE_C_FLAGS="$CFLAGS" \
72 -DCMAKE_CXX_FLAGS="$CXXFLAGS"
74 hide_output make -j$(nproc)
75 cp lib/libunwind.a $OUTPUT/$TARGET/lib
76 cd ../ && rm -rf libunwind-build