Skip to content

Commit 2a8d694

Browse files
committed
Updated GNU Toolchain install
1 parent 6cfb764 commit 2a8d694

2 files changed

Lines changed: 26 additions & 83 deletions

File tree

content/install-guides/gcc/arm-gnu.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ weight: 4
1919

2020
## Before you begin
2121

22-
Arm GNU Toolchain is a community-supported, pre-built GNU compiler toolchain for Arm-based CPUs.
22+
Arm GNU Toolchain is a community-supported, pre-built GNU compiler toolchain for Arm-based CPUs. This guide covers installing the toolchain directly from the [Arm GNU Toolchain downloads page](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads), which is the recommended approach for bare-metal and embedded targets such as `arm-none-eabi`.
2323

24-
There are many versions of the [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) available. In general, the latest version is recommended for use, as this will contain the latest optimization improvements, as well as support for the latest Arm IP.
24+
If you need a cross-compiler targeting Arm Linux (for example `aarch64-linux-gnu` or `arm-linux-gnueabihf`), see the [Cross-compiler](../cross) install guide instead, which installs those toolchains via the Linux package manager.
25+
26+
There are many versions of the [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) available. In general, the latest version is recommended, as this will contain the latest optimization improvements and support for the latest Arm IP.
2527

2628
However there are reasons you may wish to use earlier compiler versions, so older versions are also available.
2729

@@ -45,18 +47,6 @@ Download the correct toolchain variant for your development needs from the [Arm
4547

4648
## How do I install the Arm GNU Toolchain on Linux?
4749

48-
### Use package installer
49-
50-
Many Linux distributions make the toolchain available with their package installers. However they may not be the latest versions or desired variant.
51-
```command
52-
sudo apt update
53-
sudo apt install gcc-arm-none-eabi
54-
```
55-
56-
If the installed version does not meet your needs, you can install another Arm GNU Toolchain version.
57-
58-
### Manual install {#manual}
59-
6050
Unpack the downloaded file to the install directory. The exact file name will depend on the flavor selected.
6151

6252
```console
@@ -148,7 +138,7 @@ Double-click on the installer, such as `arm-gnu-toolchain-15.2.rel1-mingw-w64-i
148138
To install silently from the command line, use similar to the following:
149139

150140
```console
151-
msiexec /i arm-gnu-toolchain-<version>--mingw-w64-i686-arm-none-eabi.msi EULA=1 /quiet
141+
msiexec /i arm-gnu-toolchain-<version>-mingw-w64-i686-arm-none-eabi.msi EULA=1 /quiet
152142
```
153143

154144
The zip package is a backup to Windows installer for those who cannot run the installer. You can unzip the package and then run the tools directly.
@@ -161,12 +151,12 @@ To use the Arm GNU Toolchain in conjunction with [Arm Development Studio](https:
161151

162152
## Get started
163153

164-
To verify the installation is correct enter:
154+
To verify the installation is correct, enter:
165155
```console
166156
arm-none-eabi-gcc -v
167157
```
168158

169-
Additional examples are included in the toolchain installation at:
159+
Additional examples are included in the toolchain installation. If you installed to `$HOME` using the example above, you can find them at:
170160
```console
171-
${install_dir}/share/gcc-arm-none-eabi/samples
161+
$HOME/arm-gnu-toolchain-15.2.rel1-aarch64-arm-none-eabi/share/doc/gcc-arm-none-eabi/examples
172162
```

content/install-guides/gcc/cross.md

Lines changed: 18 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -18,78 +18,46 @@ weight: 3
1818
---
1919
GCC is available on all Linux distributions and can be installed using the package manager.
2020

21-
This covers `gcc` and `g++` for compiling C and C++ as a cross-compiler targeting the Arm architecture.
21+
This covers `gcc` and `g++` for compiling C and C++ as a cross-compiler targeting the Arm Linux architecture. For bare-metal and embedded targets such as `arm-none-eabi`, see the [Arm GNU Toolchain](../arm-gnu) install guide.
2222

2323
## Before you begin
2424

25-
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 `arm-none-eabi-gcc` and `arm-none-eabi-g++`.
26-
27-
GCC is also used to cross compile Linux applications. Applications can be compiled for 32-bit or 64-bit Linux systems.
25+
GCC is used to cross-compile Linux applications targeting Arm. Applications can be compiled for 32-bit or 64-bit Arm Linux systems.
2826

2927
The executables for 32-bit are `arm-linux-gnueabihf-gcc` and `arm-linux-gnueabihf-g++`.
3028

3129
The executables for 64-bit are `aarch64-linux-gnu-gcc` and `aarch64-linux-gnu-g++`.
3230

33-
Software can be compiled on an `x86` or `Arm` host machine.
31+
Software can be compiled on an `x86_64` or `Arm` host machine.
3432

3533
## How do I download a GCC cross compiler targeting Arm?
3634

37-
For the Linux cross-compilers targeting 32-bit and 64-bit Linux applications (`arm-linux-gnueabihf` and `aarch64-linux-gnu`), the Linux package manager downloads the required files.
38-
39-
For the bare-metal cross-compiler (`arm-none-eabi`), Arm no longer publishes new releases through Debian or Ubuntu package repositories. To get the latest version, download it directly from the [Arm GNU Toolchain downloads page](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads).
35+
The Linux package manager downloads the required files. No manual download is needed.
4036

4137
## How do I install a GCC cross compiler on Linux?
4238

4339
You can install a GCC cross compiler with Arm as a target architecture using Linux package managers.
4440

4541
### Installing on Debian based distributions such as Ubuntu
4642

47-
Use the `apt` command to install the cross-compilers for 32-bit and 64-bit Linux targets.
43+
Use the `apt` command to install the cross-compilers for 32-bit and 64-bit Arm Linux targets.
4844

4945
```bash { target="ubuntu:latest" }
5046
sudo apt update
5147
sudo apt install gcc-arm-linux-gnueabihf -y
5248
sudo apt install gcc-aarch64-linux-gnu -y
5349
```
5450

55-
These packages are maintained by Canonical and the GCC version you receive is tied to your Ubuntu release (for example, GCC 13 on Ubuntu 24.04 LTS, GCC 15 on Ubuntu 25.10).
56-
57-
For the bare-metal cross-compiler (`arm-none-eabi`), Arm no longer publishes new releases to Debian or Ubuntu package repositories. The version available through `apt` is older and may not include support for recent Arm cores or architecture features.
58-
59-
To install the latest `arm-none-eabi` toolchain (15.2.Rel1), download the pre-built tarball for your host architecture from the [Arm GNU Toolchain downloads page](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads). Extract the archive and add the `bin` directory to your `PATH`.
60-
61-
On an `aarch64` host:
62-
63-
```bash
64-
wget https://developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-aarch64-arm-none-eabi.tar.xz
65-
tar -xJf arm-gnu-toolchain-15.2.rel1-aarch64-arm-none-eabi.tar.xz
66-
export PATH="$HOME/arm-gnu-toolchain-15.2.rel1-aarch64-arm-none-eabi/bin:$PATH"
67-
```
68-
69-
On an `x86_64` host:
70-
71-
```bash
72-
wget https://developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz
73-
tar -xJf arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz
74-
export PATH="$HOME/arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi/bin:$PATH"
75-
```
76-
77-
The commands above extract the toolchain into the current directory. Move the folder to a permanent location such as `$HOME` first if you'd like a stable install path.
78-
79-
To make the change permanent, add the `export` line to your shell profile such as `~/.bashrc` or `~/.profile`.
51+
The GCC version installed is tied to your Ubuntu release. For example, Ubuntu 24.04 LTS provides GCC 13 and Ubuntu 25.10 provides GCC 15. This is normal Ubuntu packaging behaviour.
8052

8153
### Installing on Fedora
8254

83-
Fedora uses the `dnf` package manager. The `arm-none-eabi-gcc-cs` package in current Fedora releases (42 and later) tracks the latest GCC release closely.
84-
85-
If you're on RHEL, CentOS, or another EPEL-based distribution, the available version may be older. In that case, download the latest toolchain directly from the [Arm GNU Toolchain downloads page](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) and follow the manual extraction steps described in the Ubuntu section above.
55+
Fedora uses the `dnf` package manager.
8656

8757
- If the machine has `sudo` you can use it:
8858

8959
```bash { target="fedora:latest" }
9060
sudo dnf update -y
91-
sudo dnf install arm-none-eabi-gcc-cs -y
92-
sudo dnf install arm-none-eabi-newlib -y
9361
sudo dnf install gcc-aarch64-linux-gnu -y
9462
sudo dnf install gcc-arm-linux-gnu -y
9563
```
@@ -98,37 +66,28 @@ If you're on RHEL, CentOS, or another EPEL-based distribution, the available ver
9866

9967
```console
10068
dnf update -y
101-
dnf install arm-none-eabi-gcc-cs -y
102-
dnf install arm-none-eabi-newlib -y
10369
dnf install gcc-aarch64-linux-gnu -y
10470
dnf install gcc-arm-linux-gnu -y
10571
```
10672

107-
## How do I install a GCC cross compiler on macOS?
108-
109-
You can install a GCC cross compiler with Arm as a target architecture using Homebrew, a package manager for macOS (and Linux). The Homebrew formula tracks the latest GCC release and provides pre-built bottles for Apple Silicon.
110-
111-
```console
112-
brew install arm-none-eabi-gcc
113-
```
114-
115-
Alternatively, Arm provides an official `.pkg` installer for macOS on Apple Silicon. Download the latest version from the [Arm GNU Toolchain downloads page](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) and run it to install the toolchain to `/Applications/ArmGNUToolchain/`.
73+
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.
11674

11775
## Setting up product license {#license}
11876

11977
GCC is open source and freely available for use.
12078

12179
## Get started {#start}
12280

123-
To confirm the installation is successful, enter:
81+
To confirm the installations are successful, enter:
12482

125-
```bash
126-
arm-none-eabi-gcc --version
83+
```bash { target="ubuntu:latest" }
84+
aarch64-linux-gnu-gcc --version
85+
arm-linux-gnueabihf-gcc --version
12786
```
12887

129-
To compile an example program, create a text file named `hello-world-embedded.c` with the contents below.
88+
To cross-compile an example program, create a text file named `hello-world.c` with the contents below.
13089

131-
```C { file_name="hello-world-embedded.c" }
90+
```C { file_name="hello-world.c" }
13291
#include <stdio.h>
13392

13493
int main()
@@ -138,20 +97,14 @@ int main()
13897
}
13998
```
14099

141-
To compile hello-world as a bare-metal application:
142-
143-
```bash { target="ubuntu:latest" }
144-
arm-none-eabi-gcc --specs=rdimon.specs hello-world-embedded.c -o hello-world.elf
145-
```
146-
147-
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.
100+
To cross-compile for a 64-bit Arm Linux target. On Fedora, only building kernels is currently supported, so these examples apply to Ubuntu.
148101

149102
```bash { target="ubuntu:latest" }
150-
arm-linux-gnueabihf-gcc hello-world-embedded.c -o hello-world.elf
103+
aarch64-linux-gnu-gcc hello-world.c -o hello-world-aarch64.elf
151104
```
152105

153-
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.
106+
To cross-compile for a 32-bit Arm Linux target:
154107

155108
```bash { target="ubuntu:latest" }
156-
aarch64-linux-gnu-gcc hello-world-embedded.c -o hello-world.elf
109+
arm-linux-gnueabihf-gcc hello-world.c -o hello-world-arm.elf
157110
```

0 commit comments

Comments
 (0)