wiki:Developer/Architectures/ARM/ARM-EABI

Version 8 (modified by Sh, on Jun 18, 2013 at 11:39:16 AM) (diff)

/* Multilibs */

ARM-EABI

Table of Contents

    Error: Page Developer/Architecures/ARM/ARM-EABI does not exist

Overview

In order to support the ARM Cortex-M architecture (ARMv7-M) on RTEMS we need an appropriate GCC configuration. See also PR 1765. This GCC configuration is based on EABI version 5 as defined by ARM. One benefit of EABI version 5 is that this brings RTEMS more in line with the primary GCC platform arm-linux-gnueabi. For standards related to this please have a look at the following documents.

Availability

The name of the ARM EABI version 5 tool chain target is: arm-rtems4.11. It is available through the standard RTEMS tool distribution.

The intermediate name arm-rtemseabi4.11 is now obsolete.

Changes

  • The EABI makes the VFP floating point format mandatory and enables us to use hardware floating point support in the future. RTEMS has currently no support for hardware floating point units (the context switch part is missing).
  • The Thumb interwork support is mandatory with this ABI.
  • The exception handling implementation changes from SJLJ to a table-based system, which is not based on DWARF unwinding tables as they are too bulky for use on small embedded systems.
  • Short enums. The standard ARM EABI configuration in GCC uses short enums by default. See also ARM Architecture Procedure Call Standard (AAPCS) section 7.1.3 "Enumerated Types". This may lead to portability problems since many architectures use int as the base type for enums. The XDR library is one problem candidate.

Multilibs

The multilib is a term used by GCC and it is a library provided by the tool chain (e.g. libc, libm, libgcc, libstdc++) which is provided for a set of GCC options (usually machine options). Each library set corresponds to an application binary interface (ABI) and instruction set. So if you build for certain ABI and instruction set, then you need a compatible multilib which provides you with for example memcpy(). The set of options which define the multilibs is provided by the GCC configuration.

# .: ARMv4T, ARM instruction set # thumb: ARMv4T, Thumb-1 instruction set # thumb/armv6-m: ARMv6M, subset of Thumb-2 instruction set # thumb/armv7-a: ARMv7-A, Thumb-2 instruction set # thumb/armv7-a/neon/hard: ARMv7-A, Thumb-2 instruction set with hard-float ABI Neon and VFP-D32 support # thumb/armv7-r: ARMv7-R, Thumb-2 instruction set # thumb/armv7-m: ARMv7-M, Thumb-2 instruction set with hardware integer division (SDIV/UDIV)

Multilib 1. and 2. support the standard ARM7TDMI and ARM926EJ-S targets.

Multilib 3. supports the Cortex-M0 and Cortex-M1 cores.

Multilib 7. supports the Cortex-M3 and Cortex-M4 cores, which have a special hardware integer division instruction (this is not present in the A and R profiles).

Use for example the following GCC options

-mthumb -march=armv7-a -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9

It is important to select the options used for the multilibs. For example

-mthumb -mcpu=cortex-a9

alone will not select the ARMv7-A multilib.

Board Support Package Update HOWTO

# Throw away your linker command file and use <tt>c/src/lib/libbsp/arm/shared/startup/linkcmds.base</tt> instead. The linker command file must support the .preinit_array, .init_array, and .fini_array sections.

Legacy ARM GCC Configuration

The legacy ARM GCC configuration (also called ARM ELF, arm-none-elf) is based on a GNU EABI. This configuration is not actively maintained in GCC. There is no support for recent ARM architectures. The name ELF is a bit misleading since the file format is ELF in both cases.

The legacy configuration has been removed for RTEMS in GCC 4.8.