-
Notifications
You must be signed in to change notification settings - Fork 359
/
Dockerfile.arm-unknown-linux-gnueabihf
50 lines (39 loc) · 1.75 KB
/
Dockerfile.arm-unknown-linux-gnueabihf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM ubuntu:20.04 as cross-base
ENV DEBIAN_FRONTEND=noninteractive
COPY common.sh lib.sh /
RUN /common.sh
COPY cmake.sh /
RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh
FROM cross-base as build
ARG VERBOSE
COPY crosstool-ng.sh /
COPY crosstool-config/arm-unknown-linux-gnueabihf.config /
RUN /crosstool-ng.sh arm-unknown-linux-gnueabihf.config 5
ENV PATH /x-tools/arm-unknown-linux-gnueabihf/bin/:$PATH
COPY deny-debian-packages.sh /
RUN TARGET_ARCH=armhf /deny-debian-packages.sh
COPY qemu.sh /
RUN /qemu.sh arm
COPY qemu-runner base-runner.sh /
COPY toolchain.cmake /opt/toolchain.cmake
ENV CROSS_TOOLCHAIN_PREFIX=arm-unknown-linux-gnueabihf-
ENV CROSS_SYSROOT=/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/
ENV CROSS_TARGET_RUNNER="/qemu-runner armhf"
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="$CROSS_TARGET_RUNNER" \
AR_arm_unknown_linux_gnueabihf="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_arm_unknown_linux_gnueabihf="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_arm_unknown_linux_gnueabihf="$CROSS_TOOLCHAIN_PREFIX"g++ \
CMAKE_TOOLCHAIN_FILE_arm_unknown_linux_gnueabihf=/opt/toolchain.cmake \
BINDGEN_EXTRA_CLANG_ARGS_arm_unknown_linux_gnueabihf="--sysroot=$CROSS_SYSROOT -idirafter/usr/include" \
QEMU_LD_PREFIX="$CROSS_SYSROOT" \
RUST_TEST_THREADS=1 \
PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig/:${PKG_CONFIG_PATH}" \
PKG_CONFIG_ALLOW_CROSS=1 \
CROSS_CMAKE_SYSTEM_NAME=Linux \
CROSS_CMAKE_SYSTEM_PROCESSOR=arm \
CROSS_CMAKE_CRT=gnu \
CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -fPIC -march=armv6 -marm -mfpu=vfp"
RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /qemu-runner