File tree Expand file tree Collapse file tree 6 files changed +87
-22
lines changed Expand file tree Collapse file tree 6 files changed +87
-22
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,18 @@ matrix:
1515 - env : IMAGE=arm-android
1616 - env : IMAGE=armhf-gnu
1717 - env : IMAGE=cross DEPLOY=1
18- - env : IMAGE=linux-tested-targets DEPLOY=1
1918 - env : IMAGE=dist-android DEPLOY=1
2019 - env : IMAGE=dist-arm-linux DEPLOY=1
2120 - env : IMAGE=dist-armv7-aarch64-linux DEPLOY=1
2221 - env : IMAGE=dist-freebsd DEPLOY=1
22+ - env : IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
2323 - env : IMAGE=dist-mips-linux DEPLOY=1
2424 - env : IMAGE=dist-mips64-linux DEPLOY=1
2525 - env : IMAGE=dist-powerpc-linux DEPLOY=1
2626 - env : IMAGE=dist-powerpc64-linux DEPLOY=1
2727 - env : IMAGE=dist-s390x-linux-netbsd DEPLOY=1
2828 - env : IMAGE=dist-x86-linux DEPLOY=1
29+ - env : IMAGE=dist-x86_64-musl DEPLOY=1
2930 - env : IMAGE=emscripten
3031 - env : IMAGE=i686-gnu
3132 - env : IMAGE=i686-gnu-nopt
Original file line number Diff line number Diff line change @@ -30,25 +30,21 @@ RUN curl -o /usr/local/bin/sccache \
3030 chmod +x /usr/local/bin/sccache
3131
3232ENV RUST_CONFIGURE_ARGS \
33- --target=x86_64-unknown-linux-musl,i686-unknown-linux-musl,i586-unknown-linux-gnu \
34- --musl-root-x86_64=/musl-x86_64 \
33+ --target=i686-unknown-linux-musl,i586-unknown-linux-gnu \
3534 --musl-root-i686=/musl-i686
3635
3736# Newer binutils broke things on some vms/distros (i.e., linking against
3837# unknown relocs disabled by the following flag), so we need to go out of our
3938# way to produce "super compatible" binaries.
4039#
4140# See: https://github.com/rust-lang/rust/issues/34978
42- ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no \
43- CFLAGS_x86_64_unknown_linux_musl=-Wa,-mrelax-relocations=no
41+ ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no
4442
4543ENV SCRIPT \
4644 python2.7 ../x.py test \
47- --target x86_64-unknown-linux-musl \
4845 --target i686-unknown-linux-musl \
4946 --target i586-unknown-linux-gnu \
5047 && \
5148 python2.7 ../x.py dist \
52- --target x86_64-unknown-linux-musl \
5349 --target i686-unknown-linux-musl \
5450 --target i586-unknown-linux-gnu
Original file line number Diff line number Diff line change @@ -18,11 +18,6 @@ export CXXFLAGS="-Wa,-mrelax-relocations=no"
1818MUSL=musl-1.1.14
1919curl https://www.musl-libc.org/releases/$MUSL .tar.gz | tar xzf -
2020cd $MUSL
21- ./configure --prefix=/musl-x86_64 --disable-shared
22- make -j10
23- make install
24- make clean
25- # for i686
2621CFLAGS=" $CFLAGS -m32" ./configure --prefix=/musl-i686 --disable-shared --target=i686
2722make -j10
2823make install
5045
5146mkdir libunwind-build
5247cd libunwind-build
53- cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
54- -DLIBUNWIND_ENABLE_SHARED=0
55- make -j10
56- cp lib/libunwind.a /musl-x86_64/lib
57-
58- # (Note: the next cmake call doesn't fully override the previous cached one, so remove the cached
59- # configuration manually. IOW, if don't do this or call make clean we'll end up building libunwind
60- # for x86_64 again)
61- rm -rf *
62- # for i686
6348CFLAGS=" $CFLAGS -m32" CXXFLAGS=" $CXXFLAGS -m32" cmake ../libunwind-release_37 \
6449 -DLLVM_PATH=/build/llvm-release_37 \
6550 -DLIBUNWIND_ENABLE_SHARED=0
File renamed without changes.
Original file line number Diff line number Diff line change 1+ FROM ubuntu:16.04
2+
3+ RUN apt-get update && apt-get install -y --no-install-recommends \
4+ g++ \
5+ make \
6+ file \
7+ curl \
8+ ca-certificates \
9+ python2.7 \
10+ git \
11+ cmake \
12+ xz-utils \
13+ sudo \
14+ gdb \
15+ patch \
16+ libssl-dev \
17+ pkg-config
18+
19+ WORKDIR /build/
20+ COPY build-musl.sh /build/
21+ RUN sh /build/build-musl.sh && rm -rf /build
22+
23+ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
24+ dpkg -i dumb-init_*.deb && \
25+ rm dumb-init_*.deb
26+ ENTRYPOINT ["/usr/bin/dumb-init" , "--" ]
27+
28+ RUN curl -o /usr/local/bin/sccache \
29+ https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-unknown-linux-musl && \
30+ chmod +x /usr/local/bin/sccache
31+
32+ ENV RUST_CONFIGURE_ARGS \
33+ --target=x86_64-unknown-linux-musl \
34+ --musl-root-x86_64=/musl-x86_64
35+
36+ # Newer binutils broke things on some vms/distros (i.e., linking against
37+ # unknown relocs disabled by the following flag), so we need to go out of our
38+ # way to produce "super compatible" binaries.
39+ #
40+ # See: https://github.com/rust-lang/rust/issues/34978
41+ ENV CFLAGS_x86_64_unknown_linux_musl=-Wa,-mrelax-relocations=no
42+
43+ ENV SCRIPT \
44+ python2.7 ../x.py test --target x86_64-unknown-linux-musl && \
45+ python2.7 ../x.py dist --target x86_64-unknown-linux-musl
Original file line number Diff line number Diff line change 1+ #! /bin/sh
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.
5+ #
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.
11+
12+ set -ex
13+
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"
17+
18+ MUSL=musl-1.1.14
19+ curl https://www.musl-libc.org/releases/$MUSL .tar.gz | tar xzf -
20+ cd $MUSL
21+ ./configure --prefix=/musl-x86_64 --disable-shared
22+ make -j10
23+ make install
24+
25+ cd ..
26+ rm -rf $MUSL
27+
28+ # To build MUSL we're going to need a libunwind lying around, so acquire that
29+ # here and build it.
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 -
32+
33+ mkdir libunwind-build
34+ cd libunwind-build
35+ cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
36+ -DLIBUNWIND_ENABLE_SHARED=0
37+ make -j10
38+ cp lib/libunwind.a /musl-x86_64/lib
You can’t perform that action at this time.
0 commit comments