]> git.proxmox.com Git - rustc.git/blob - src/ci/docker/disabled/dist-armv7-android/Dockerfile
New upstream version 1.19.0+dfsg1
[rustc.git] / src / ci / docker / disabled / dist-armv7-android / Dockerfile
1 FROM ubuntu:16.04
2
3 RUN apt-get update && \
4 apt-get install -y --no-install-recommends \
5 ca-certificates \
6 cmake \
7 curl \
8 file \
9 g++ \
10 git \
11 libssl-dev \
12 make \
13 pkg-config \
14 python2.7 \
15 sudo \
16 unzip \
17 xz-utils
18
19 # dumb-init
20 COPY scripts/dumb-init.sh /scripts/
21 RUN sh /scripts/dumb-init.sh
22
23 # ndk
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 && \
29 remove_ndk
30
31 RUN chmod 777 /android/ndk && \
32 ln -s /android/ndk/arm-21 /android/ndk/arm
33
34 # env
35 ENV PATH=$PATH:/android/ndk/arm-9/bin
36
37 ENV DEP_Z_ROOT=/android/ndk/arm-9/sysroot/usr/
38
39 ENV HOSTS=armv7-linux-androideabi
40
41 ENV RUST_CONFIGURE_ARGS \
42 --host=$HOSTS \
43 --target=$HOSTS \
44 --armv7-linux-androideabi-ndk=/android/ndk/arm \
45 --disable-rpath \
46 --enable-extended \
47 --enable-cargo-openssl-static
48
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).
56 ENV SCRIPT \
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)
62
63 # sccache
64 COPY scripts/sccache.sh /scripts/
65 RUN sh /scripts/sccache.sh
66
67 # init
68 ENTRYPOINT ["/usr/bin/dumb-init", "--"]