-
Notifications
You must be signed in to change notification settings - Fork 377
/
Dockerfile.thumbv8m.main-none-eabihf
38 lines (30 loc) · 1.2 KB
/
Dockerfile.thumbv8m.main-none-eabihf
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
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
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi \
libstdc++-arm-none-eabi-newlib
COPY qemu.sh /
RUN /qemu.sh arm
COPY toolchain.cmake /opt/toolchain.cmake
ENV CROSS_TOOLCHAIN_PREFIX=arm-none-eabi-
ENV CROSS_SYSROOT="/usr/lib/arm-none-eabi"
ENV CROSS_TARGET_RUNNER=qemu-arm
ENV QEMU_CPU=cortex-m33 \
AR_thumbv8m.main_none_eabihf="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_thumbv8m.main_none_eabihf="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_thumbv8m.main_none_eabihf="$CROSS_TOOLCHAIN_PREFIX"g++ \
# cmake-rs does not accept CMAKE_TOOLCHAIN_FILE_thumbv8m.main_none_eabihf
TARGET_CMAKE_TOOLCHAIN_FILE=/opt/toolchain.cmake \
CARGO_TARGET_THUMBV8M.BASE_NONE_EABI_RUNNER="$CROSS_TARGET_RUNNER" \
CROSS_CMAKE_SYSTEM_NAME=Generic \
CROSS_CMAKE_SYSTEM_PROCESSOR="armv8-m.main" \
CROSS_CMAKE_CRT=newlib \
CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -mthumb -mfloat-abi=hard -march=armv8-m.main -mfpu=fpv5-sp-d16"