|21 Dec 2023
|21 Dec 2023
This guide is intended to get you up and running with this tool quickly with the most common settings. For a thorough review of all options, refer to the official documentation.
GCC is available on all Linux distributions and can be installed using the package manager.
g++ for compiling C and C++ as a cross-compiler targeting the Arm architecture.
GCC is often used to cross-compile software for Arm microcontrollers and embedded devices which have firmware and other low-level software. The executables are
GCC is also used to cross compile Linux applications. Applications can be compiled for 32-bit or 64-bit Linux systems.
The executables for 32-bit are
The executables for 64-bit are
Software can be compiled on an
Arm host machine.
The Linux package manager will download the required files so there are no special download instructions.
apt command to install software packages on any Debian based Linux distribution.
sudo apt update
sudo apt install gcc-arm-none-eabi -y
sudo apt install gcc-arm-linux-gnueabihf -y
sudo apt install gcc-aarch64-linux-gnu -y
These Linux distributions use
yum as the package manager.
To install the most common development tools use the commands below. If the machine has
sudo you can use it or run
yum as root.
sudo yum update -y
sudo yum install arm-none-eabi-gcc-cs -y
sudo yum install arm-none-eabi-newlib -y
sudo yum install gcc-aarch64-linux-gnu -y
sudo yum install gcc-arm-linux-gnu -y
sudo is not available become root and omit the
yum install arm-none-eabi-gcc-cs -y
yum install arm-none-eabi-newlib -y
yum install gcc-aarch64-linux-gnu -y
yum install gcc-arm-linux-gnu -y
GCC is open source and freely available for use.
To confirm the installation is successful, enter:
To compile an example program, create a text file named
hello-world-embedded.c with the contents below.
printf("Hello, Arm World!\n");
To compile hello-world as a bare-metal application:
arm-none-eabi-gcc --specs=rdimon.specs hello-world-embedded.c -o hello-world.elf
To cross-compile hello-world as a 32-bit Linux application. On Fedora, only building kernels is currently supported. Support for cross-building user space programs is not currently provided as that would massively multiply the number of packages.
arm-linux-gnueabihf-gcc hello-world-embedded.c -o hello-world.elf
To cross-compile hello-world as a 64-bit Linux application. On Fedora, only building kernels is currently supported. Support for cross-building user space programs is not currently provided as that would massively multiply the number of packages.
aarch64-linux-gnu-gcc hello-world-embedded.c -o hello-world.elf
How would you rate the overall quality of this tool quick-install guide?