about summary refs log tree commit diff
path: root/src/ci/docker/scripts
diff options
context:
space:
mode:
authorMarco A L Barbosa <malbarbo@gmail.com>2018-01-02 18:02:42 -0200
committerMarco A L Barbosa <malbarbo@gmail.com>2018-01-03 13:49:13 -0200
commitca0499d73685f084d8fd77417411d6f5162cc593 (patch)
treeaabdda2502836f6fbbb641f3bb97dacd27c91fc3 /src/ci/docker/scripts
parentb24d12e622052da1fc262a682e02e19af215e0b8 (diff)
downloadrust-ca0499d73685f084d8fd77417411d6f5162cc593.tar.gz
rust-ca0499d73685f084d8fd77417411d6f5162cc593.zip
ci: use musl shared script in dist-x86_64-musl
Diffstat (limited to 'src/ci/docker/scripts')
-rw-r--r--src/ci/docker/scripts/musl.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/ci/docker/scripts/musl.sh b/src/ci/docker/scripts/musl.sh
new file mode 100644
index 00000000000..011fd88231d
--- /dev/null
+++ b/src/ci/docker/scripts/musl.sh
@@ -0,0 +1,41 @@
+#!/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.
+#
+# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+# option. This file may not be copied, modified, or distributed
+# except according to those terms.
+
+set -ex
+
+TAG=$1
+shift
+
+MUSL=musl-1.1.17
+curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
+cd $MUSL
+./configure --disable-shared --prefix=/musl-$TAG $@
+make -j10
+make install
+
+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 -
+
+mkdir libunwind-build
+cd libunwind-build
+cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
+          -DLIBUNWIND_ENABLE_SHARED=0 \
+          -DCMAKE_C_COMPILER=$CC \
+          -DCMAKE_CXX_COMPILER=$CXX \
+          -DCMAKE_C_FLAGS="$CFLAGS" \
+          -DCMAKE_CXX_FLAGS="$CXXFLAGS"
+make -j10
+cp lib/libunwind.a /musl-$TAG/lib