Skip to content

Commit

Permalink
Add thumbv7neon-* targets.
Browse files Browse the repository at this point in the history
Add the `thumbv7neon-linux-androideabi`, `thumbv7neon-unknown-linux-gnueabihf`, and `thumbv7neon-unknown-linux-musleabihf` targets.

Closes #254.
  • Loading branch information
Alexhuszagh committed Jun 3, 2022
1 parent 87a322e commit 03f943a
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ jobs:
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: armv7-unknown-linux-gnueabi, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: thumbv7neon-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: i586-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: i686-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system }
- { target: mips-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
Expand All @@ -160,13 +161,15 @@ jobs:
- { target: armv5te-unknown-linux-musleabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv7-unknown-linux-musleabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv7-unknown-linux-musleabihf, os: ubuntu-latest, std: 1, run: 1 }
- { target: thumbv7neon-unknown-linux-musleabihf, os: ubuntu-latest, std: 1, run: 1 }
- { target: i586-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: i686-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: mips-unknown-linux-musl, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: mipsel-unknown-linux-musl, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: aarch64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1, cpp: 1, runners: qemu-user }
- { target: arm-linux-androideabi, os: ubuntu-latest, cpp: 1, std: 1, run: 1, cpp: 1, runners: qemu-user }
- { target: armv7-linux-androideabi, os: ubuntu-latest, cpp: 1, std: 1, run: 1, cpp: 1, runners: qemu-user }
- { target: thumbv7neon-linux-androideabi, os: ubuntu-latest, cpp: 1, std: 1, run: 1, cpp: 1, runners: qemu-user }
- { target: i686-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1, cpp: 1, runners: qemu-user }
- { target: x86_64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1, cpp: 1, runners: qemu-user }
- { target: x86_64-pc-windows-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- #745 - added `thumbv7neon-*` targets.
- #741 - added `armv7-unknown-linux-gnueabi` and `armv7-unknown-linux-musleabi` targets.
- #377 - update WINE versions to 7.0.
- #734 - patch `arm-unknown-linux-gnueabihf` to build for ARMv6, and add architecture for crosstool-ng-based images.
Expand Down
55 changes: 55 additions & 0 deletions docker/Dockerfile.thumbv7neon-linux-androideabi
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

47 changes: 47 additions & 0 deletions docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf
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}"
47 changes: 47 additions & 0 deletions docker/Dockerfile.thumbv7neon-unknown-linux-musleabihf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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 qemu.sh /
RUN /qemu.sh arm

COPY musl.sh /
RUN /musl.sh \
TARGET=arm-linux-musleabihf \
"COMMON_CONFIG += --with-arch=armv7-a \
--with-float=hard \
--with-mode=thumb \
--with-fpu=vfp"

# Allows qemu run dynamic linked binaries
RUN ln -sf \
/usr/local/arm-linux-musleabihf/lib/libc.so \
/usr/local/arm-linux-musleabihf/lib/ld-musl-armhf.so.1

# Export all target binutils just in case required.
ENV CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-musleabihf-gcc \
CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_MUSLEABIHF_RUNNER=qemu-arm \
AR_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-ar \
AS_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-as \
CC_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-gcc \
CXX_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-g++ \
LD_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-ld \
NM_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-nm \
OBJCOPY_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-objcopy \
OBJDUMP_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-objdump \
RANLIB_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-ranlib \
READELF_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-readelf \
SIZE_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-size \
STRINGS_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-strings \
STRIP_thumbv7neon_unknown_linux_musleabihf=arm-linux-musleabihf-strip \
BINDGEN_EXTRA_CLANG_ARGS_thumbv7neon_unknown_linux_musleabihf="--sysroot=/usr/local/arm-linux-musleabihf" \
QEMU_LD_PREFIX=/usr/local/arm-linux-musleabihf \
RUST_TEST_THREADS=1
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ impl Target {

fn needs_docker_privileged(&self) -> bool {
let arch_32bit = self.triple().starts_with("arm")
|| self.triple().starts_with("thumb")
|| self.triple().starts_with("i586")
|| self.triple().starts_with("i686");

Expand Down

0 comments on commit 03f943a

Please sign in to comment.