fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1FROM ubuntu:16.04 2 3COPY scripts/android-base-apt-get.sh /scripts/ 4RUN sh /scripts/android-base-apt-get.sh 5 6COPY scripts/android-ndk.sh /scripts/ 7RUN . /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 13RUN chmod 777 /android/ndk && \ 14 ln -s /android/ndk/arm-21 /android/ndk/arm 15 16ENV PATH=$PATH:/android/ndk/arm-14/bin 17 18ENV DEP_Z_ROOT=/android/ndk/arm-14/sysroot/usr/ 19 20ENV HOSTS=armv7-linux-androideabi 21 22ENV 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). 35ENV SCRIPT \ 36 python3 ../x.py --stage 2 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 python3 ../x.py dist --host $HOSTS --target $HOSTS) 41 42COPY scripts/sccache.sh /scripts/ 43RUN sh /scripts/sccache.sh