Skip to content

Commit becf8b9

Browse files
committed
Restore aarch64 Android build.
1 parent 1b6c4ef commit becf8b9

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

docker/Dockerfile.aarch64-linux-android

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@ RUN /android-ndk.sh arm64
2323
ENV PATH=$PATH:/android-ndk/bin
2424

2525
COPY android-system.sh /
26-
# TODO(ahuszagh) Restore
27-
#RUN /android-system.sh arm64
28-
#
29-
#RUN cp /android-ndk/sysroot/usr/lib/aarch64-linux-android/$ANDROID_SDK/libz.so /system/lib/
30-
#
31-
#COPY android-runner /
32-
#
33-
## Libz is distributed in the android ndk, but for some unknown reason it is not
34-
## found in the build process of some crates, so we explicit set the DEP_Z_ROOT
35-
#ENV CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
36-
# CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER="/android-runner aarch64" \
37-
# CC_aarch64_linux_android=aarch64-linux-android-gcc \
38-
# CXX_aarch64_linux_android=aarch64-linux-android-g++ \
39-
# BINDGEN_EXTRA_CLANG_ARGS_aarch64_linux_android="--sysroot=/android-ndk/sysroot" \
40-
# DEP_Z_INCLUDE=/android-ndk/sysroot/usr/include/ \
41-
# RUST_TEST_THREADS=1 \
42-
# HOME=/tmp/ \
43-
# TMPDIR=/tmp/ \
44-
# ANDROID_DATA=/ \
45-
# ANDROID_DNS_MODE=local \
46-
# ANDROID_ROOT=/system
26+
RUN /android-system.sh arm64
27+
28+
RUN cp /android-ndk/sysroot/usr/lib/aarch64-linux-android/$ANDROID_SDK/libz.so /system/lib/
29+
30+
COPY android-runner /
31+
32+
# Libz is distributed in the android ndk, but for some unknown reason it is not
33+
# found in the build process of some crates, so we explicit set the DEP_Z_ROOT
34+
ENV CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
35+
CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER="/android-runner aarch64" \
36+
CC_aarch64_linux_android=aarch64-linux-android-gcc \
37+
CXX_aarch64_linux_android=aarch64-linux-android-g++ \
38+
BINDGEN_EXTRA_CLANG_ARGS_aarch64_linux_android="--sysroot=/android-ndk/sysroot" \
39+
DEP_Z_INCLUDE=/android-ndk/sysroot/usr/include/ \
40+
RUST_TEST_THREADS=1 \
41+
HOME=/tmp/ \
42+
TMPDIR=/tmp/ \
43+
ANDROID_DATA=/ \
44+
ANDROID_DNS_MODE=local \
45+
ANDROID_ROOT=/system

docker/android-system.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ main() {
3737
# latest tested version with make: 13.0.0_r6
3838
local has_make=1
3939

40+
if [[ "${ANDROID_SYSTEM_COMPLETE}" != "1" ]] && [[ "${major_version}" -ge "12" ]]; then
41+
echo "Only minimal Android builds for versions 11 or lower are supported" 1>&2
42+
echo "Preliminary support is currently being worked on." 1>&2
43+
exit 1
44+
fi
45+
4046
local td
4147
td="$(mktemp -d)"
4248
pushd "${td}"

0 commit comments

Comments
 (0)