FROM ubuntu:latest
# Install required dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
wget \
gnupg2 \
&& rm -rf /var/lib/apt/lists/*
# Import the missing public key
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
# Download and install gcc-arm toolchain for the specified architecture
# https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
ARG CPUARCH
RUN if [ "$CPUARCH" = "x86_64" ]; then \
wget -q https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz \
&& tar -xvf *64-arm-none-eabi.tar.xz \
&& rm *64-arm-none-eabi.tar.xz \
&& wget -q https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar.xz \
&& tar xf *-aarch64-none-elf.tar.xz \
&& rm *-aarch64-none-elf.tar.xz \
&& ln -s /arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-elf /toolchain-none-elf \
&& ln -s /arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi /toolchain-none-eabi; \
elif [ "$CPUARCH" = "arm64" ]; then \
wget -q https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz \
&& tar -xvf *64-arm-none-eabi.tar.xz \
&& rm *64-arm-none-eabi.tar.xz \
&& wget -q https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-aarch64-none-elf.tar.xz \
&& tar xf *-aarch64-none-elf.tar.xz \
&& rm *-aarch64-none-elf.tar.xz \
&& ln -s /arm-gnu-toolchain-13.2.Rel1-aarch64-aarch64-none-elf /toolchain-none-elf \
&& ln -s /arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi /toolchain-none-eabi; \
else \
echo "Unsupported architecture: $CPUARCH"; \
exit 1; \
fi
# Set environment variables
ENV PATH="/toolchain-none-elf/bin:${PATH}"
ENV PATH="/toolchain-none-eabi/bin:${PATH}"
ENV RPI=3
# Set the working directory
WORKDIR /armbuild
CMD ["./build.sh"]
Hi all,
The complete installation of the GNU ARM Toolchain is over 400MB.
1- There are many folders : arm-none-eab, bin, lib, include, libexec and share.
What are those folders for? Can you please give me a short description of the files in each folder?
2- I want to strip down the toolchain to keep just a simple compiler-linker-objdump toolchain. What are the bare minimum folders and files I need to build C programs for cortex M3 and M4F?
3- How to know which C library is used by the toolchain (uclibc, newlib, newlib_nano, ...)? And how to replace it with another one?
Thanks
find <directory of the toolchain> -name picolibc.specs
Hi all,
The complete installation of the GNU ARM Toolchain is over 400MB.
I fully support the idea of getting rid of the bloat as much as possible.
what would be the point of spending even a minute saving 5 cents worth of storage space?
Uno: I've plenty of time, yes!!
Tri: It's an opportunity to know how things work under the hood.
If that is your goal, then your time is much better spend on understanding how the linker descripter files work together with how GCC puts code and data into sections.
Don’t recent installs also include a large helping of CMSIS libraries
what's the difference between "bin/arm-none-eabi-gcc" and "arm-none-eabi/bin/gcc"?
One of the things to keep in the back of your mind is that gcc and the associated tools have the paths to other tools, libraries, includes and other files hardcoded inside the binaries (relative to the installation directory).
One of the things to keep in the back of your mind is that gcc and the associated tools have the paths to other tools, libraries, includes and other files hardcoded inside the binaries (relative to the installation directory).Thanks for the info but I don't want to change the directories hierarchy, just delete the extra programs.
What you are doing is total waste of time. The toolchain already is pretty minimal, by today's standards. I remember the frustration of installing 10GB or so of random bullshit when doing Altera FPGA's in 2010, but 400MB in 2024 is a problem for you, are you serious?