You copied the Doc URL to your clipboard.

Summary of armclang command-line options

This provides a summary of the armclang command-line options that ARM® Compiler 6 supports.

The command-line options either affect both compilation and assembly, or only affect compilation. The command-line options that only affect compilation without affecting assembly are shown in the table as Compilation only. The command-line options that affect both compilation and assembly are shown in the table as Compilation and assembly.

Note

The command-line options that affect assembly are for the armclang integrated assembler, and do not apply to armasm. These options affect both inline assembly and assembly source files.

Table 1-1 armclang command-line options

Option Description Compilation or Assembly
‑c Only perform the compile step, do not invoke armlink. Compilation and assembly.
‑D Defines a preprocessor macro. Compilation and assembly.
‑E Only perform the preprocess step, do not compile or link. Compilation and assembly.
‑e Specifies the unique initial entry point of the image. Compilation and assembly.
‑fbare‑metal‑pie Generates position-independent code. Compilation only.

‑fcommon,

‑fno‑common

Generates common zero-initialized values for tentative definitions. Compilation only.

‑fdata‑sections,

‑fno‑data‑sections

Enables or disables the generation of one ELF section for each variable in the source file. Compilation only.

‑ffast‑math,

‑fno‑fast‑math

Enables or disables the use of aggressive floating-point optimizations. Compilation only.

‑ffp‑mode

Specifies floating-point standard conformance. Compilation only.

‑ffunction‑sections,

‑fno‑function‑sections

Enables or disables the generation of one ELF section for each function in the source file. Compilation only.
@file Reads a list of command-line options from a file. Compilation and assembly.

‑fldm‑stm,

‑fno‑ldm‑stm

Enable or disable the generation of LDM and STM instructions. AArch32 only. Compilation only.
‑fno‑inline‑functions Disables the automatic inlining of functions at optimization levels ‑O2 and ‑O3. Compilation only.
‑flto Enables link time optimization, and outputs bitcode wrapped in an ELF file for link time optimization. Compilation only.

‑fexceptions,

‑fno‑exceptions

Enables or disables the generation of code needed to support C++ exceptions. Compilation only.

‑fomit‑frame‑pointer,

‑fno‑omit‑frame‑pointer

Enables or disables the storage of stack frame pointers during function calls. Compilation only.

‑fropi,

‑fno‑ropi

Enables or disables the generation of Read-Only Position-Independent (ROPI) code. Compilation only.

‑fropi‑lowering,

‑fno‑ropi‑lowering

Enables or disables runtime static initialization when generating Read-Only Position-Independent (ROPI) code. Compilation only.

‑frwpi,

‑fno‑rwpi

Enables or disables the generation of Read-Write Position-Independent (RWPI) code. Compilation only.

‑frwpi‑lowering,

‑fno‑rwpi‑lowering

Enables or disables runtime static initialization when generating Read-Write Position-Independent (RWPI) code. Compilation only.

‑fshort‑enums,

‑fno‑short‑enums

Allows or disallows the compiler to set the size of an enumeration type to the smallest data type that can hold all enumerator values. Compilation only.

‑fshort‑wchar,

‑fno‑short‑wchar

Sets the size of wchar_t to 2 or 4 bytes. Compilation only.

‑fstrict‑aliasing,

‑fno‑strict‑aliasing

Instructs the compiler to apply or not apply the strictest aliasing rules available. Compilation only.

‑fvectorize,

‑fno‑vectorize

Enables or disables the generation of Advanced SIMD vector instructions directly from C or C++ code at optimization levels ‑O1 and higher. Compilation only.
‑ftrapv Instructs the compiler to generate traps for signed arithmetic overflow on addition, subtraction, and multiplication operations. Compilation only.
‑fwrapv Instructs the compiler to assume that signed arithmetic overflow of addition, subtraction, and multiplication, wraps using two's-complement representation. Compilation only.

‑g,

‑gdwarf‑2,

‑gdwarf‑3,

‑gdwarf‑4

Adds debug tables for source-level debugging. Compilation and assembly.
‑I Adds the specified directory to the list of places that are searched to find include files. Compilation and assembly.
‑include Includes the source code of the specified file at the beginning of the compilation. Compilation only.
‑L Specifies a list of paths that the linker searches for user libraries. Compilation only.
‑l Add the specified library to the list of searched libraries. Compilation only.

‑M,

‑MM

Produces a list of makefile dependency rules suitable for use by a make utility. Compilation and assembly.

‑MD,

‑MMD

Compiles or assembles source files and produces a list of makefile dependency rules suitable for use by a make utility. Compilation and assembly.
‑MF Specifies a filename for the makefile dependency rules produced by the ‑M and ‑MD options. Compilation only.
‑MG Prints dependency lines for header files even if the header files are missing. Compilation only.
‑MP Emits dummy dependency rules that work around make errors that are generated if you remove header files without a corresponding update to the makefile. Compilation only.
‑MT Changes the target of the makefile dependency rule produced by dependency generating options. Compilation and assembly.
‑march Targets an architecture profile, generating generic code that runs on any processor of that architecture. Compilation and assembly.
‑marm Requests that the compiler targets the A32 or ARM instruction sets. Compilation only.
‑mbig‑endian Generates code suitable for an ARM processor using byte-invariant big-endian (BE‑8) data. Compilation and assembly.
‑mcmse Enables the generation of code for the Secure state of the ARMv8-M Security Extensions. Compilation only.
‑mcpu Targets a specific processor, generating optimized code for that specific processor. Compilation and assembly.
‑mexecute‑only Generates execute-only code, and prevents the compiler from generating any data accesses to code sections. Compilation only.
‑mfloat‑abi Specifies whether to use hardware instructions or software library functions for floating-point operations, and which registers are used to pass floating-point parameters and return values. Compilation only.
‑mfpu Specifies the target FPU architecture, that is the floating-point hardware available on the target. Compilation and assembly.
‑mimplicit‑it Specifies the behavior of the integrated assembler if there are conditional instructions outside IT blocks. Compilation and assembly.
‑mlittle‑endian Generates code suitable for an ARM processor using little-endian data. Compilation and assembly.

‑munaligned‑access,

‑mno‑unaligned‑access

Enables or disables unaligned accesses to data on ARM processors. Compilation only.
‑mthumb Requests that the compiler targets the T32 or Thumb instruction sets. Compilation only.
‑o Specifies the name of the output file. Compilation and assembly.
‑O Specifies the level of optimization to use when compiling source files. Compilation only.
‑S Outputs the disassembly of the machine code generated by the compiler. Compilation only.
‑save‑temps Instructs the compiler to generate intermediate assembly files from the specified C/C++ file. Compilation only.
‑std Specifies the language standard to compile for. Compilation only.
‑‑target Generate code for the specified target triple. Compilation and assembly.
‑U Removes any initial definition of the specified preprocessor macro. Compilation only.
‑u Prevents the removal of a specified symbol if it is undefined. Compilation and assembly.
‑v Displays the commands that invoke the compiler and linker, and executes those commands. Compilation and assembly.
‑‑version Displays the same information as ‑‑vsn. Compilation and assembly.
‑‑version_number Displays the version of armclang you are using. Compilation and assembly.
‑‑vsn Displays the version information and the license details. Compilation and assembly.
‑W Controls diagnostics. Compilation only.
‑Wl Specifies linker command-line options to pass to the linker when a link step is being performed after compilation. Compilation only.
‑Xlinker Specifies linker command-line options to pass to the linker when a link step is being performed after compilation. Compilation only.
‑x Specifies the language of source files. Compilation and assembly.
‑### Displays the commands that invoke the compiler and sub-tools, such as armlink, without executing those commands. Compilation and assembly.
Was this page helpful? Yes No