Keil Logo

Technical Support

On-Line Manuals

Compiler Reference Guide

Preface armclang Command-line Options Support level definitions Summary of armclang command-line options -C -c -D -E -e -fbare-metal-pie -fbracket-depth=N -fcommon, -fno-common -fdata-sections, -fno-data-sections -ffast-math, -fno-fast-math -ffixed-rN -ffp-mode -ffunction-sections, -fno-function-sections -fident, -fno-ident @file -fldm-stm, -fno-ldm-stm -fno-builtin -fno-inline-functions -flto, -fno-lto -fexceptions, -fno-exceptions -fomit-frame-pointer, -fno-omit-frame-pointer -fropi, -fno-ropi -fropi-lowering, -fno-ropi-lowering -frwpi, -fno-rwpi -frwpi-lowering, -fno-rwpi-lowering -fshort-enums, -fno-short-enums -fshort-wchar, -fno-short-wchar -fstack-protector, -fstack-protector-all, -fstack- -fstrict-aliasing, -fno-strict-aliasing -ftrapv -fvectorize, -fno-vectorize -fvisibility -fwrapv -g, -gdwarf-2, -gdwarf-3, -gdwarf-4 -I -include -L -l -M, -MM -MD, -MMD -MF -MG -MP -MT -march -marm -masm -mbig-endian -mbranch-protection -mcmse -mcpu -mexecute-only -mfloat-abi -mfpu -mimplicit-it -mlittle-endian -mmemtag-stack, -mno-memtag-stack -mno-neg-immediates -moutline, -mno-outline -mpixolib -munaligned-access, -mno-unaligned-access -mthumb -nostdlib -nostdlibinc -o -O -pedantic -pedantic-errors -Rpass -S -save-temps -std --target -U -u -v --version --version_number --vsn -W -Wl -Xlinker -x -### Compiler-specific Keywords and Operators Compiler-specific Function, Variable, and Type Att Compiler-specific Intrinsics Compiler-specific Pragmas Other Compiler-specific Features Standard C Implementation Definition Standard C++ Implementation Definition armclang Integrated Assembler armclang Inline Assembler

-masm

1.49 -masm

Enables Arm® Development Studio to select the correct assembler for the input assembly source files.

Default

-masm=gnu

Syntax

-masm=assembler

Parameters

The value of assembler can be one of:

auto

Automatically detect the correct assembler from the syntax of the input assembly source file.

If the assembly source file contains GNU syntax assembly code, then invoke armclang integrated assembler.

If the assembly source file contains legacy armasm syntax assembly code, then invoke the legacy armasm assembler. The most commonly used options are translated from the armclang command-line options to the appropriate armasm command-line options.

Note:

In rare circumstances, the auto-detection might select the wrong assembler for the input file. For example, if the input file is a .S file that requires preprocessing, auto-detection might select the wrong assembler. For the files where auto-detection selects the wrong assembler, you must select -masm=gnu or -masm=armasm explicitly.
gnu
Invoke the armclang integrated assembler.
armasm
Invoke the legacy armasm assembler. The most commonly used options are translated from the armclang command-line options to the appropriate armasm command-line options.

Operation

If you use Arm Development Studio to build projects with the CMSIS-Pack, use -masm=auto, because some of the assembly files in the CMSIS-Pack contain legacy armasm syntax assembly code. When invoking the legacy armasm assembler, the most commonly used options are translated from the armclang command-line options to the appropriate armasm command-line options, which the Translatable options table shows.

Table 1-4 Translatable options

armclang option armasm option
-mcpu, -march --cpu
-marm --arm
-mthumb --thumb
-fropi --apcs=/ropi
-frwpi --apcs=/rwpi

-mfloat-abi=soft

-mfloat-abi=softfp

-mfloat-abi=hard

--apcs=/softfp

--apcs=/softfp

--apcs=/hardfp

-mfpu --fpu
-mbig-endian --bigend
-mlittle-endian --littleend
-g -g
-ffp-mode --fpmode
-DNAME --predefine "NAME SETA 1"
-Idir -idir

If you need to provide additional options to the legacy armasm assembler, which are not listed in the Translatable options table, then use -Wa,armasm,option,value. For example:

  • If you want to use the legacy armasm assembler option --show_cmdline to see the command-line options that have been passed to the legacy armasm assembler, then use:

    -Wa,armasm,--show_cmdline
  • If the legacy armasm syntax source file requires the option --predefine "NAME SETA 100", then use:

    -Wa,armasm,--predefine,"NAME SETA 100"
  • If the legacy armasm syntax source file requires the option --predefine "NAME SETS \"Version 1.0\"", then use:

    -Wa,armasm,--predefine,"NAME SETS \"Version 1.0\""

    Note:

    The command-line interface of your system might require you to enter special character combinations to achieve correct quoting, such as \" instead of ".

Note:

Arm Compiler 6 provides the -masm option as a short term solution to enable the assembly of legacy armasm syntax assembly source files. The -masm option will be removed in a future release of Arm Compiler 6. Arm recommends that you migrate all legacy armasm syntax assembly source files into GNU syntax assembly source files. For more information, see Migrating from armasm to the armclang integrated assembler in the Migration and Compatibility Guide.

If you are using the compiler from outside Arm Development Studio, such as from the command-line, then Arm recommends that you do not specify the -masm option, and instead invoke the correct assembler explicitly.

Non-ConfidentialPDF file icon PDF version100067_0612_00_en
Copyright © 2014–2019 Arm Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.