# GNU Compiler

The GNU Compiler Collection (GCC) is available in several toolchains for Arm. Each supports a specific combination of host machine, target architecture, and runtime environment.

## Select your toolchain

Choose a toolchain based on where your software runs and where you compile it:

| Choose this toolchain      | When to use it                                                        |
|----------------------------|----------------------------------------------------------------------|
| Arm GNU Toolchain          | You build bare-metal software or software that uses a real-time operating system (RTOS) |
| Linux cross-compiler       | You build on Linux for a different target architecture               |
| Native compiler             | You build and run software on the same Arm Linux machine            |

### Arm GNU Toolchain

Use the Arm GNU Toolchain to build firmware, an RTOS, or bare-metal software for Cortex-M, Cortex-R, and Cortex-A processors.

This is the right option for most embedded developers. The toolchain is maintained by Arm and released through the Arm GNU Toolchain GitLab repository.

The Arm GNU Toolchain provides pre-built binaries for Windows, Linux, and macOS.

For Cortex-A and Cortex-R, check your board or RTOS documentation to determine whether your project uses 32-bit or 64-bit software. Choose the compiler that matches your software target:

| Compiler                          | Target                                                                       |
|-----------------------------------|------------------------------------------------------------------------------|
| `arm-none-eabi-gcc`               | Cortex-M software                                                           |
| `arm-none-eabi-gcc`               | 32-bit software for supported Cortex-R and Cortex-A processors (AArch32)   |
| `aarch64-none-elf-gcc`            | 64-bit software for supported Cortex-R and Cortex-A processors (AArch64)    |

[Install Arm GNU Toolchain](https://learn.arm.com/install-guides/gcc/arm-gnu/)

### Linux cross-compiler

Use a GCC cross-compiler to build Arm Linux applications for a different target architecture. The compiled applications run on Arm Linux systems, not bare-metal hardware.

You need a Linux host. Install the cross-compiler using your Linux package manager.

Examples include compiling from x86-64 to 64-bit Arm, or from 64-bit Arm to 32-bit Arm. Choose the compiler that matches your software target:

| Compiler                          | Target                                                             |
|-----------------------------------|--------------------------------------------------------------------|
| `aarch64-linux-gnu-gcc`           | 64-bit Arm Linux applications (AArch64)                            |
| `arm-linux-gnueabihf-gcc`         | 32-bit Arm Linux applications (AArch32, hard float)               |

[Install a Linux cross-compiler](https://learn.arm.com/install-guides/gcc/cross/)

### Native compiler

Use GCC to build C and C++ applications directly on the Arm Linux machine where you run them.

You need an Arm Linux machine, such as a Neoverse server, Raspberry Pi, or another Arm development board. Install GCC using your Linux package manager.

| Compiler | Target                     |
|----------|----------------------------|
| `gcc`    | Arm Linux (native)         |

[Install GCC on Arm Linux](https://learn.arm.com/install-guides/gcc/native/)
