3 RUN apt-get update && \
4 apt-get install -y --no-install-recommends \
19 RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
20 dpkg -i dumb-init_*.deb && \
23 RUN curl -o /usr/local/bin/sccache \
24 https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl && \
25 chmod +x /usr/local/bin/sccache
27 ENTRYPOINT ["/usr/bin/dumb-init", "--"]
30 RUN . /android-ndk.sh && \
31 download_ndk android-ndk-r13b-linux-x86_64.zip && \
32 make_standalone_toolchain x86 9 && \
33 make_standalone_toolchain x86 21 && \
36 ENV PATH=$PATH:/android/ndk/x86-9/bin
38 ENV DEP_Z_ROOT=/android/ndk/x86-9/sysroot/usr/
40 ENV HOSTS=i686-linux-android
42 ENV RUST_CONFIGURE_ARGS \
45 --i686-linux-android-ndk=/android/ndk/x86 \
48 --enable-cargo-openssl-static
50 # We support api level 9, but api level 21 is required to build llvm. To
51 # overcome this problem we use a ndk with api level 21 to build llvm and then
52 # switch to a ndk with api level 9 to complete the build. When the linker is
53 # invoked there are missing symbols (like sigsetempty, not available with api
54 # level 9), the default linker behavior is to generate an error, to allow the
55 # build to finish we use --warn-unresolved-symbols. Note that the missing
56 # symbols does not affect std, only the compiler (llvm) and cargo (openssl).
57 RUN chmod 777 /android/ndk && \
58 ln -s /android/ndk/x86-21 /android/ndk/x86
61 python2.7 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
62 (export RUSTFLAGS="\"-C link-arg=-Wl,--warn-unresolved-symbols\""; \
63 rm /android/ndk/x86 && \
64 ln -s /android/ndk/x86-9 /android/ndk/x86 && \
65 python2.7 ../x.py dist --host $HOSTS --target $HOSTS)