You copied the Doc URL to your clipboard.

-march

Targets an architecture profile, generating generic code that runs on any processor of that architecture.

Syntax

To specify a target architecture, use:

-march=name

-march=name[+[no]feature+…] (for architectures with optional extensions)

Where:

name

Specifies the architecture.

To view a list of all the supported architectures, use:

-march=list

The following are valid -march values:

armv8-a
Arm®v8 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.
armv8.1-a
Armv8.1 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.
armv8.2-a
Armv8.2 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.
armv8.3-a
Armv8.3 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.
armv8.4-a
Armv8.4 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.
armv8-r
Armv8 real-time architecture profile. Only valid with --target=arm-arm-none-eabi.
armv8-m.base
Armv8 microcontroller architecture profile without the Main Extension. Derived from the Armv6‑M architecture. Only valid with --target=arm-arm-none-eabi.
armv8-m.main
Armv8 microcontroller architecture profile with the Main Extension. Derived from the Armv7‑M architecture. Only valid with --target=arm-arm-none-eabi.
armv7-a
Armv7 application architecture profile. Only valid with --target=arm-arm-none-eabi.
armv7-r
Armv7 real-time architecture profile. Only valid with --target=arm-arm-none-eabi.
armv7-m
Armv7 microcontroller architecture profile. Only valid with --target=arm-arm-none-eabi.
armv7e-m
Armv7 microcontroller architecture profile with DSP extension. Only valid with --target=arm-arm-none-eabi.
armv6-m
Armv6 microcontroller architecture profile. Only valid with --target=arm-arm-none-eabi.
feature

Enables or disables an optional architectural feature. See the documentation for -mcpu.

Note

There are no software floating-point libraries for AArch64 targets. At link time armlink links against AArch64 library code that can use floating-point and SIMD instructions and registers. This still applies if you compile the source with -march=<name>+nofp+nosimd to prevent the compiler from using floating-point and SIMD instructions and registers.

To prevent the use of any floating-point instruction or register, either re-implement the library functions or create your own library that does not use floating-point instructions or registers.

Default

For AArch64 targets (--target=aarch64-arm-none-eabi), unless you target a particular processor using -mcpu, the compiler defaults to -march=armv8-a, generating generic code for Armv8‑A in AArch64 state.

For AArch32 targets (--target=arm-arm-none-eabi), there is no default. You must specify either -march (to target an architecture) or -mcpu (to target a processor).

Was this page helpful? Yes No