2 # Copyright 2016 The Rust Project Developers. See the COPYRIGHT
3 # file at the top-level directory of this distribution and at
4 # http://rust-lang.org/COPYRIGHT.
6 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9 # option. This file may not be copied, modified, or distributed
10 # except according to those terms.
14 # We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
15 export CFLAGS="-fPIC -Wa,-mrelax-relocations=no"
16 export CXXFLAGS="-Wa,-mrelax-relocations=no"
19 curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
21 ./configure --prefix=/musl-x86_64 --disable-shared
28 # To build MUSL we're going to need a libunwind lying around, so acquire that
30 curl -L https://github.com/llvm-mirror/llvm/archive/release_37.tar.gz | tar xzf -
31 curl -L https://github.com/llvm-mirror/libunwind/archive/release_37.tar.gz | tar xzf -
35 cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
36 -DLIBUNWIND_ENABLE_SHARED=0
38 cp lib/libunwind.a /musl-x86_64/lib