1
- FROM ubuntu:22.04 as build
1
+ FROM ubuntu:22.04 AS build
2
2
3
3
ENV TZ=Europe/Rome
4
4
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
@@ -12,7 +12,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
12
12
dh-autoreconf \
13
13
git \
14
14
gperf \
15
- # various libs required to compile osxcross
15
+ # various libs requied to compile osxcross
16
16
libxml2-dev \
17
17
libssl-dev \
18
18
libz-dev \
@@ -26,21 +26,24 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
26
26
llvm \
27
27
&& rm -rf /var/lib/apt/lists/* \
28
28
&& ln -s /usr/bin/clang-13 /usr/bin/clang \
29
- && ln -s /usr/bin/clang++-13 /usr/bin/clang++
29
+ && ln -s /usr/bin/clang++-13 /usr/bin/clang++ \
30
+ # pretend to have 1.17 instead of 1.16
31
+ && ln -s /usr/bin/aclocal /usr/bin/aclocal-1.17 \
32
+ && ln -s /usr/bin/automake /usr/bin/automake-1.17
30
33
31
34
# Install toolchains in /opt
32
35
RUN curl -L downloads.arduino.cc/tools/internal/toolchains.tar.gz | tar -xz "opt"
33
36
# install proper arm toolchains (already present in the toolchains.tar.gz archive)
34
37
# curl -L 'https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz' | tar -xJC /opt && \
35
38
# curl -L 'https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz' | tar -xJC /opt
36
39
37
- RUN cd /opt/osxcross && \
38
- git pull && \
40
+ WORKDIR /opt/osxcross
41
+ RUN git pull && \
39
42
# use a specific version of osxcross (it does not have tags), this commit has the automatic install of compiler_rt libraries
40
43
git checkout b875d7c1360c8ff2077463d7a5a12e1cff1cc683 && \
41
- UNATTENDED=1 SDK_VERSION=10.15 ./build.sh
42
- RUN cd /opt/osxcross && \
44
+ UNATTENDED=1 SDK_VERSION=10.15 ./build.sh && \
43
45
ENABLE_COMPILER_RT_INSTALL=1 SDK_VERSION=10.15 ./build_compiler_rt.sh
46
+
44
47
# Set toolchains paths
45
48
# arm-linux-gnueabihf-gcc -> linux_arm
46
49
# aarch64-linux-gnu-gcc -> linux_arm64
@@ -49,18 +52,16 @@ RUN cd /opt/osxcross && \
49
52
# o64-clang -> darwin_amd64
50
53
ENV PATH=/opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/:/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/:/opt/x86_64-ubuntu16.04-linux-gnu-gcc/bin/:/opt/i686-ubuntu16.04-linux-gnu/bin/:/opt/osxcross/target/bin/:$PATH
51
54
52
- WORKDIR /workdir
53
-
54
55
# Handle libusb and libudev compilation and merging
55
56
COPY deps/ /opt/lib/
56
57
# compiler name is arm-linux-gnueabihf-gcc '-gcc' is added by ./configure
57
- RUN CROSS_COMPILE=x86_64-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh
58
- RUN CROSS_COMPILE=arm-linux-gnueabihf /opt/lib/build_libs.sh
59
- RUN CROSS_COMPILE=aarch64-linux-gnu /opt/lib/build_libs.sh
60
- RUN CROSS_COMPILE=i686-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh
61
- RUN CROSS_COMPILE=i686-w64-mingw32 /opt/lib/build_libs.sh
62
- # CROSS_COMPILER is used to override the compiler
63
- RUN CROSS_COMPILER=o64-clang CROSS_COMPILE=x86_64-apple-darwin13 AR=/opt/osxcross/target/bin/x86_64-apple-darwin13-ar RANLIB=/opt/osxcross/target/bin/x86_64-apple-darwin13-ranlib /opt/lib/build_libs.sh
58
+ RUN CROSS_COMPILE=x86_64-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh && \
59
+ CROSS_COMPILE=arm-linux-gnueabihf /opt/lib/build_libs.sh && \
60
+ CROSS_COMPILE=aarch64-linux-gnu /opt/lib/build_libs.sh && \
61
+ CROSS_COMPILE=i686-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh && \
62
+ CROSS_COMPILE=i686-w64-mingw32 /opt/lib/build_libs.sh && \
63
+ # CROSS_COMPILER is used to override the compiler
64
+ CROSS_COMPILER=o64-clang CROSS_COMPILE=x86_64-apple-darwin13 AR=/opt/osxcross/target/bin/x86_64-apple-darwin13-ar RANLIB=/opt/osxcross/target/bin/x86_64-apple-darwin13-ranlib /opt/lib/build_libs.sh
64
65
65
66
FROM ubuntu:22.04
66
67
# Copy all the installed toolchains and compiled libs
@@ -86,6 +87,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
86
87
&& rm -rf /var/lib/apt/lists/* \
87
88
&& ln -s /usr/bin/clang-13 /usr/bin/clang \
88
89
&& ln -s /usr/bin/clang++-13 /usr/bin/clang++
90
+
89
91
# Set toolchains paths
90
92
# arm-linux-gnueabihf-gcc -> linux_arm
91
93
# aarch64-linux-gnu-gcc -> linux_arm64
0 commit comments