diff options
| author | Marco A L Barbosa <malbarbo@gmail.com> | 2018-01-03 09:39:21 -0200 |
|---|---|---|
| committer | Marco A L Barbosa <malbarbo@gmail.com> | 2018-01-03 13:49:13 -0200 |
| commit | 10a759130e763206bb961deb4c9da6e0466c71a1 (patch) | |
| tree | 0edfac5baca802779b7197209fe0a1b555d6dcd1 /src/ci/docker/scripts | |
| parent | ca0499d73685f084d8fd77417411d6f5162cc593 (diff) | |
| download | rust-10a759130e763206bb961deb4c9da6e0466c71a1.tar.gz rust-10a759130e763206bb961deb4c9da6e0466c71a1.zip | |
ci: use musl shared script in dist-various-1 (for arm targets)
Update libunwind to 39. This is necessary to build the arm targets
Diffstat (limited to 'src/ci/docker/scripts')
| -rw-r--r-- | src/ci/docker/scripts/musl.sh | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/src/ci/docker/scripts/musl.sh b/src/ci/docker/scripts/musl.sh index 011fd88231d..dad0e8e2c2b 100644 --- a/src/ci/docker/scripts/musl.sh +++ b/src/ci/docker/scripts/musl.sh @@ -1,4 +1,3 @@ -#!/bin/sh # Copyright 2016 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. @@ -11,31 +10,58 @@ set -ex +hide_output() { + set +x + on_err=" +echo ERROR: An error was encountered with the build. +cat /tmp/build.log +exit 1 +" + trap "$on_err" ERR + bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & + PING_LOOP_PID=$! + $@ &> /tmp/build.log + trap - ERR + kill $PING_LOOP_PID + rm /tmp/build.log + set -x +} + TAG=$1 shift MUSL=musl-1.1.17 -curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf - + +# may have been downloaded in a previous run +if [ ! -d $MUSL ]; then + curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf - +fi + cd $MUSL ./configure --disable-shared --prefix=/musl-$TAG $@ -make -j10 -make install +hide_output make -j$(nproc) +hide_output make install +hide_output make clean cd .. -rm -rf $MUSL -# To build MUSL we're going to need a libunwind lying around, so acquire that -# here and build it. -curl -L https://github.com/llvm-mirror/llvm/archive/release_37.tar.gz | tar xzf - -curl -L https://github.com/llvm-mirror/libunwind/archive/release_37.tar.gz | tar xzf - +LLVM=39 +# may have been downloaded in a previous run +if [ ! -d libunwind-release_$LLVM ]; then + curl -L https://github.com/llvm-mirror/llvm/archive/release_$LLVM.tar.gz | tar xzf - + curl -L https://github.com/llvm-mirror/libunwind/archive/release_$LLVM.tar.gz | tar xzf - +fi mkdir libunwind-build cd libunwind-build -cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \ +cmake ../libunwind-release_$LLVM \ + -DLLVM_PATH=/build/llvm-release_$LLVM \ -DLIBUNWIND_ENABLE_SHARED=0 \ -DCMAKE_C_COMPILER=$CC \ -DCMAKE_CXX_COMPILER=$CXX \ -DCMAKE_C_FLAGS="$CFLAGS" \ -DCMAKE_CXX_FLAGS="$CXXFLAGS" -make -j10 + +hide_output make -j$(nproc) cp lib/libunwind.a /musl-$TAG/lib +cd ../ && rm -rf libunwind-build |
