]>
Commit | Line | Data |
---|---|---|
7cac9316 XL |
1 | FROM ubuntu:16.04 |
2 | ||
041b39d2 XL |
3 | COPY scripts/android-base-apt-get.sh /scripts/ |
4 | RUN sh /scripts/android-base-apt-get.sh | |
7cac9316 | 5 | |
7cac9316 XL |
6 | COPY scripts/dumb-init.sh /scripts/ |
7 | RUN sh /scripts/dumb-init.sh | |
8 | ||
7cac9316 XL |
9 | COPY scripts/android-ndk.sh /scripts/ |
10 | RUN . /scripts/android-ndk.sh && \ | |
11 | download_ndk android-ndk-r13b-linux-x86_64.zip && \ | |
12 | make_standalone_toolchain arm 9 && \ | |
13 | make_standalone_toolchain arm 21 && \ | |
14 | remove_ndk | |
15 | ||
16 | RUN chmod 777 /android/ndk && \ | |
17 | ln -s /android/ndk/arm-21 /android/ndk/arm | |
18 | ||
7cac9316 XL |
19 | ENV PATH=$PATH:/android/ndk/arm-9/bin |
20 | ||
21 | ENV DEP_Z_ROOT=/android/ndk/arm-9/sysroot/usr/ | |
22 | ||
23 | ENV HOSTS=armv7-linux-androideabi | |
24 | ||
25 | ENV RUST_CONFIGURE_ARGS \ | |
26 | --host=$HOSTS \ | |
27 | --target=$HOSTS \ | |
28 | --armv7-linux-androideabi-ndk=/android/ndk/arm \ | |
29 | --disable-rpath \ | |
30 | --enable-extended \ | |
31 | --enable-cargo-openssl-static | |
32 | ||
33 | # We support api level 9, but api level 21 is required to build llvm. To | |
34 | # overcome this problem we use a ndk with api level 21 to build llvm and then | |
35 | # switch to a ndk with api level 9 to complete the build. When the linker is | |
36 | # invoked there are missing symbols (like sigsetempty, not available with api | |
37 | # level 9), the default linker behavior is to generate an error, to allow the | |
38 | # build to finish we use --warn-unresolved-symbols. Note that the missing | |
39 | # symbols does not affect std, only the compiler (llvm) and cargo (openssl). | |
40 | ENV SCRIPT \ | |
41 | python2.7 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \ | |
42 | (export RUSTFLAGS="\"-C link-arg=-Wl,--warn-unresolved-symbols\""; \ | |
43 | rm /android/ndk/arm && \ | |
44 | ln -s /android/ndk/arm-9 /android/ndk/arm && \ | |
45 | python2.7 ../x.py dist --host $HOSTS --target $HOSTS) | |
46 | ||
7cac9316 XL |
47 | COPY scripts/sccache.sh /scripts/ |
48 | RUN sh /scripts/sccache.sh | |
49 | ||
7cac9316 | 50 | ENTRYPOINT ["/usr/bin/dumb-init", "--"] |