-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
745: Add `thumbv7neon-*` targets. r=otavio a=Alexhuszagh Add the `thumbv7neon-linux-androideabi` and `thumbv7neon-unknown-linux-gnueabihf` targets. Closes #254. 746: Limit permissions for Android images. r=otavio,emilgardis a=Alexhuszagh Remove the use of the `--privileged` flag for Android images and instead use an seccomp permissions. The provided profile is derived from the docker documentation, with slight modifications to allow `clone` and `clone3`. The documentation is [docker seccomp](https://docs.docker.com/engine/security/seccomp/#significant-syscalls-blocked-by-the-default-profile), which details the syscalls blocked by docker. The same is true for podman. We merely modified these settings to allow `personality` syscall, which then allows us to use our Android images. Co-authored-by: Alex Huszagh <ahuszagh@gmail.com>
- Loading branch information
Showing
8 changed files
with
341 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM ubuntu:20.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY common.sh lib.sh / | ||
RUN /common.sh | ||
|
||
COPY cmake.sh / | ||
RUN /cmake.sh | ||
|
||
COPY xargo.sh / | ||
RUN /xargo.sh | ||
|
||
COPY android-ndk.sh / | ||
RUN /android-ndk.sh arm 28 | ||
ENV PATH=$PATH:/android-ndk/bin | ||
|
||
COPY android-system.sh / | ||
RUN /android-system.sh arm | ||
|
||
COPY qemu.sh / | ||
RUN /qemu.sh arm | ||
|
||
RUN cp /android-ndk/sysroot/usr/lib/arm-linux-androideabi/28/libz.so /system/lib/ | ||
|
||
COPY android-runner / | ||
|
||
# Libz is distributed in the android ndk, but for some unknown reason it is not | ||
# found in the build process of some crates, so we explicit set the DEP_Z_ROOT | ||
# likewise, the toolchains expect the prefix `thumbv7neon-linux-androideabi`, | ||
# which we don't have, so just export every possible variable, such as AR. | ||
# Also export all target binutils just in case required. | ||
ENV CARGO_TARGET_THUMBV7NEON_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \ | ||
CARGO_TARGET_THUMBV7NEON_LINUX_ANDROIDEABI_RUNNER="/android-runner arm" \ | ||
AR_thumbv7neon_linux_androideabi=arm-linux-androideabi-ar \ | ||
AS_thumbv7neon_linux_androideabi=arm-linux-androideabi-as \ | ||
CC_thumbv7neon_linux_androideabi=arm-linux-androideabi-gcc \ | ||
CXX_thumbv7neon_linux_androideabi=arm-linux-androideabi-g++ \ | ||
LD_thumbv7neon_linux_androideabi=arm-linux-androideabi-ld \ | ||
NM_thumbv7neon_linux_androideabi=arm-linux-androideabi-nm \ | ||
OBJCOPY_thumbv7neon_linux_androideabi=arm-linux-androideabi-objcopy \ | ||
OBJDUMP_thumbv7neon_linux_androideabi=arm-linux-androideabi-objdump \ | ||
RANLIB_thumbv7neon_linux_androideabi=arm-linux-androideabi-ranlib \ | ||
READELF_thumbv7neon_linux_androideabi=arm-linux-androideabi-readelf \ | ||
SIZE_thumbv7neon_linux_androideabi=arm-linux-androideabi-size \ | ||
STRINGS_thumbv7neon_linux_androideabi=arm-linux-androideabi-strings \ | ||
STRIP_thumbv7neon_linux_androideabi=arm-linux-androideabi-strip \ | ||
BINDGEN_EXTRA_CLANG_ARGS_thumbv7neon_linux_androideabi="--sysroot=/android-ndk/sysroot" \ | ||
DEP_Z_INCLUDE=/android-ndk/sysroot/usr/include/ \ | ||
RUST_TEST_THREADS=1 \ | ||
HOME=/tmp/ \ | ||
TMPDIR=/tmp/ \ | ||
ANDROID_DATA=/ \ | ||
ANDROID_DNS_MODE=local \ | ||
ANDROID_ROOT=/system | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM ubuntu:16.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY common.sh lib.sh / | ||
RUN /common.sh | ||
|
||
COPY cmake.sh / | ||
RUN /cmake.sh | ||
|
||
COPY xargo.sh / | ||
RUN /xargo.sh | ||
|
||
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ | ||
g++-arm-linux-gnueabihf \ | ||
libc6-dev-armhf-cross | ||
|
||
COPY qemu.sh / | ||
RUN /qemu.sh arm softmmu | ||
|
||
COPY dropbear.sh / | ||
RUN /dropbear.sh | ||
|
||
COPY linux-image.sh / | ||
RUN /linux-image.sh armv7 | ||
|
||
COPY linux-runner / | ||
|
||
# Export all target binutils just in case required. | ||
ENV CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ | ||
CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_GNUEABIHF_RUNNER="/linux-runner armv7" \ | ||
AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \ | ||
AS_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-as \ | ||
CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \ | ||
CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \ | ||
LD_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ld \ | ||
NM_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-nm \ | ||
OBJCOPY_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-objcopy \ | ||
OBJDUMP_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-objdump \ | ||
RANLIB_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ranlib \ | ||
READELF_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-readelf \ | ||
SIZE_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-size \ | ||
STRINGS_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-strings \ | ||
STRIP_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-strip \ | ||
BINDGEN_EXTRA_CLANG_ARGS_thumbv7neon_unknown_linux_gnueabihf="--sysroot=/usr/arm-linux-gnueabihf" \ | ||
QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf \ | ||
RUST_TEST_THREADS=1 \ | ||
PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig/:${PKG_CONFIG_PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.