3 RUN apt-get update && \
4 apt-get install -y --no-install-recommends \
20 COPY scripts/dumb-init.sh /scripts/
21 RUN sh /scripts/dumb-init.sh
24 COPY scripts/android-ndk.sh /scripts/
25 RUN . /scripts/android-ndk.sh && \
26 download_ndk android-ndk-r13b-linux-x86_64.zip && \
27 make_standalone_toolchain arm 9 && \
28 make_standalone_toolchain arm 21 && \
31 RUN chmod 777 /android/ndk && \
32 ln -s /android/ndk/arm-21 /android/ndk/arm
35 ENV PATH=$PATH:/android/ndk/arm-9/bin
37 ENV DEP_Z_ROOT=/android/ndk/arm-9/sysroot/usr/
39 ENV HOSTS=armv7-linux-androideabi
41 ENV RUST_CONFIGURE_ARGS \
44 --armv7-linux-androideabi-ndk=/android/ndk/arm \
47 --enable-cargo-openssl-static
49 # We support api level 9, but api level 21 is required to build llvm. To
50 # overcome this problem we use a ndk with api level 21 to build llvm and then
51 # switch to a ndk with api level 9 to complete the build. When the linker is
52 # invoked there are missing symbols (like sigsetempty, not available with api
53 # level 9), the default linker behavior is to generate an error, to allow the
54 # build to finish we use --warn-unresolved-symbols. Note that the missing
55 # symbols does not affect std, only the compiler (llvm) and cargo (openssl).
57 python2.7 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
58 (export RUSTFLAGS="\"-C link-arg=-Wl,--warn-unresolved-symbols\""; \
59 rm /android/ndk/arm && \
60 ln -s /android/ndk/arm-9 /android/ndk/arm && \
61 python2.7 ../x.py dist --host $HOSTS --target $HOSTS)
64 COPY scripts/sccache.sh /scripts/
65 RUN sh /scripts/sccache.sh
68 ENTRYPOINT ["/usr/bin/dumb-init", "--"]