]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/disabled/dist-armv7-android/Dockerfile
Merge branch 'refactor-select' of https://github.com/aravind-pg/rust into update...
[rust.git] / src / ci / docker / disabled / dist-armv7-android / Dockerfile
1 FROM ubuntu:16.04
2
3 COPY scripts/android-base-apt-get.sh /scripts/
4 RUN sh /scripts/android-base-apt-get.sh
5
6 COPY scripts/android-ndk.sh /scripts/
7 RUN . /scripts/android-ndk.sh && \
8     download_ndk android-ndk-r15c-linux-x86_64.zip && \
9     make_standalone_toolchain arm 14 && \
10     make_standalone_toolchain arm 21 && \
11     remove_ndk
12
13 RUN chmod 777 /android/ndk && \
14     ln -s /android/ndk/arm-21 /android/ndk/arm
15
16 ENV PATH=$PATH:/android/ndk/arm-14/bin
17
18 ENV DEP_Z_ROOT=/android/ndk/arm-14/sysroot/usr/
19
20 ENV HOSTS=armv7-linux-androideabi
21
22 ENV RUST_CONFIGURE_ARGS \
23       --armv7-linux-androideabi-ndk=/android/ndk/arm \
24       --disable-rpath \
25       --enable-extended \
26       --enable-cargo-openssl-static
27
28 # We support api level 14, but api level 21 is required to build llvm. To
29 # overcome this problem we use a ndk with api level 21 to build llvm and then
30 # switch to a ndk with api level 14 to complete the build. When the linker is
31 # invoked there are missing symbols (like sigsetempty, not available with api
32 # level 14), the default linker behavior is to generate an error, to allow the
33 # build to finish we use --warn-unresolved-symbols. Note that the missing
34 # symbols does not affect std, only the compiler (llvm) and cargo (openssl).
35 ENV SCRIPT \
36   python2.7 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
37   (export RUSTFLAGS="\"-C link-arg=-Wl,--warn-unresolved-symbols\""; \
38     rm /android/ndk/arm && \
39     ln -s /android/ndk/arm-14 /android/ndk/arm && \
40     python2.7 ../x.py dist --host $HOSTS --target $HOSTS)
41
42 COPY scripts/sccache.sh /scripts/
43 RUN sh /scripts/sccache.sh