Skip to content

Commit 20529a8

Browse files
bors[bot]benpicco
andauthored
Merge #116
116: Dockerfile: install picolibc & ARM/RISC-V GCC via package manager r=maribu a=benpicco There seems to be a problem with the picolibc install in riotdocker. (#109 (comment)) Instead of trying to sort that out by ourself, just use the package [provided by Debian](https://packages.debian.org/search?suite=bullseye&searchon=names&keywords=picolibc). It has ~~no dependencies~~ the respective gcc packages as dependencies. So instead of manually downloading the toolchain, also install that from the repository. Co-authored-by: Benjamin Valentin <[email protected]> Co-authored-by: Benjamin Valentin <[email protected]>
2 parents 604bc23 + 1afc188 commit 20529a8

File tree

2 files changed

+16
-68
lines changed

2 files changed

+16
-68
lines changed

riotbuild/Dockerfile

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,17 @@ RUN \
6666
curl \
6767
cython3 \
6868
gcc-multilib \
69+
gcc-arm-none-eabi \
70+
gcc-riscv64-unknown-elf \
71+
gcc-xtensa-lx106 \
6972
gdb \
7073
g++-multilib \
7174
libffi-dev \
7275
libpcre3 \
7376
libtool \
7477
libsdl2-dev:i386 \
78+
libnewlib-arm-none-eabi \
7579
m4 \
76-
ninja-build \
7780
parallel \
7881
protobuf-compiler \
7982
python2 \
@@ -129,24 +132,6 @@ RUN \
129132
&& echo 'Cleaning up installation files' >&2 && \
130133
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /pkgs
131134

132-
# Install ARM GNU embedded toolchain
133-
# For updates, see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
134-
ARG ARM_URLBASE=https://developer.arm.com/-/media/Files/downloads/gnu-rm
135-
ARG ARM_URL=${ARM_URLBASE}/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
136-
ARG ARM_MD5=2383e4eb4ea23f248d33adc70dc3227e
137-
ARG ARM_FOLDER=gcc-arm-none-eabi-10.3-2021.10
138-
RUN echo 'Installing arm-none-eabi toolchain from arm.com' >&2 && \
139-
mkdir -p /opt && \
140-
curl -L -o /opt/gcc-arm-none-eabi.tar.bz2 ${ARM_URL} && \
141-
echo "${ARM_MD5} /opt/gcc-arm-none-eabi.tar.bz2" | md5sum -c && \
142-
tar -C /opt -jxf /opt/gcc-arm-none-eabi.tar.bz2 && \
143-
rm -f /opt/gcc-arm-none-eabi.tar.bz2 && \
144-
echo 'Removing documentation' >&2 && \
145-
rm -rf /opt/gcc-arm-none-eabi-*/share/doc
146-
# No need to dedup, the ARM toolchain is already using hard links for the duplicated files
147-
148-
ENV PATH ${PATH}:/opt/${ARM_FOLDER}/bin
149-
150135
# Install MIPS binary toolchain
151136
# For updates: https://www.mips.com/develop/tools/codescape-mips-sdk/ (select "Codescape GNU Toolchain")
152137
ARG MIPS_VERSION=2020.06-01
@@ -180,6 +165,18 @@ RUN mkdir -p /opt && \
180165

181166
ENV PATH $PATH:/opt/xpack-riscv-none-embed-gcc-${RISCV_VERSION}/bin
182167

168+
# Install picolibc Debian package
169+
ARG PICOLIBC_VERSION=1.7.9-1
170+
RUN wget -P /tmp http://ftp.de.debian.org/debian/pool/main/p/picolibc/picolibc-riscv64-unknown-elf_${PICOLIBC_VERSION}_all.deb && \
171+
dpkg -i /tmp/picolibc-riscv64-unknown-elf_${PICOLIBC_VERSION}_all.deb && \
172+
rm /tmp/picolibc-riscv64-unknown-elf_${PICOLIBC_VERSION}_all.deb && \
173+
wget -P /tmp http://ftp.de.debian.org/debian/pool/main/p/picolibc/picolibc-arm-none-eabi_${PICOLIBC_VERSION}_all.deb && \
174+
dpkg -i /tmp/picolibc-arm-none-eabi_${PICOLIBC_VERSION}_all.deb && \
175+
rm /tmp/picolibc-arm-none-eabi_${PICOLIBC_VERSION}_all.deb && \
176+
wget -P /tmp http://ftp.de.debian.org/debian/pool/main/p/picolibc/picolibc-xtensa-lx106-elf_${PICOLIBC_VERSION}_all.deb && \
177+
dpkg -i /tmp/picolibc-xtensa-lx106-elf_${PICOLIBC_VERSION}_all.deb && \
178+
rm /tmp/picolibc-xtensa-lx106-elf_${PICOLIBC_VERSION}_all.deb
179+
183180
# Install complete ESP8266 toolchain in /opt/esp (139 MB after cleanup)
184181
# remember https://github.com/RIOT-OS/RIOT/pull/10801 when updating
185182
RUN echo 'Installing ESP8266 toolchain' >&2 && \
@@ -253,38 +250,6 @@ RUN echo 'Installing ESP32-S3 toolchain' >&2 && \
253250
pip install --no-cache-dir pyserial
254251
ENV PATH $PATH:/opt/esp/xtensa-esp32s3-elf/bin
255252

256-
ARG PICOLIBC_REPO=https://github.com/keith-packard/picolibc
257-
ARG PICOLIBC_TAG=1.4.6
258-
ARG PICOLIBC_URL=${PICOLIBC_REPO}/archive/${PICOLIBC_TAG}.tar.gz
259-
ARG PICOLIBC_ARCHIVE=${PICOLIBC_TAG}.tar.gz
260-
261-
RUN echo 'Building and Installing PicoLIBC' >&2 && \
262-
pip3 install --no-cache-dir meson && \
263-
mkdir -p /usr/src/picolibc && \
264-
cd /usr/src/picolibc/ &&\
265-
curl -L -o ${PICOLIBC_ARCHIVE} ${PICOLIBC_URL} && \
266-
tar -xf ${PICOLIBC_ARCHIVE} && \
267-
cd picolibc-${PICOLIBC_TAG}
268-
269-
COPY cross-riscv-none-embed.txt /usr/src/picolibc/picolibc-${PICOLIBC_TAG}/
270-
271-
RUN cd /usr/src/picolibc/picolibc-${PICOLIBC_TAG} && \
272-
which riscv-none-embed-gcc && \
273-
ls -al /opt/xpack-riscv-none-embed-gcc-${RISCV_VERSION}/bin && \
274-
mkdir build-arm build-riscv build-esp32 && \
275-
cd build-riscv && \
276-
meson .. -Dtests=true -Dmultilib=false -Dincludedir=picolibc/riscv-none-embed/include -Dlibdir=picolibc/riscv-none-embed/lib --cross-file ../cross-riscv-none-embed.txt && \
277-
ninja && ninja install && \
278-
cd ../build-esp32 && \
279-
sh ../do-esp32-configure && \
280-
ninja && ninja install && \
281-
cd ../build-arm && \
282-
sh ../do-arm-configure && \
283-
ninja && ninja install
284-
285-
# No need to keep the sources around
286-
RUN rm -rf /usr/src/picolibc
287-
288253
# RIOT toolchains
289254
ARG RIOT_TOOLCHAIN_GCC_VERSION=10.1.0
290255
ARG RIOT_TOOLCHAIN_PACKAGE_VERSION=18

riotbuild/cross-riscv-none-embed.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)