2.3.1. Invoking the compiler

The command for invoking the ARM compilers is:

compiler_name [PCS-options] [source-language] [search-paths] [preprocessor-options] [output-format] [target-options] [debug-options] [code-generation-options] [warning-options] [additional-checks] [error-options] [miscellaneous-options] {source}...

where:

compiler_name

is one of armcc, tcc, armcpp, tcpp.

PCS-options

specify the procedure call standard to use. See Procedure Call Standard options for details.

source-language

specifies the source language that is accepted by the compiler. The default is ANSI C for the C compilers and Draft Standard C++ for the C++ compilers. See Setting the source language for details.

search-paths

specify the directories that are searched for included files. See Specifying search paths for details.

preprocessor-options

control aspects of the preprocessor, including preprocessor output and macro definitions. See Setting preprocessor options for details.

output-format

specifies the format for the compiler output. You can use these options to generate assembly language output (including interleaved source and assembly language), listing files and unlinked object files. See Specifying output format for details.

target-options

specify the target processor and architecture. See Specifying the target processor and architecture for details.

debug-options

specify whether or not debug tables are generated, and their format. See Generating debug information for details.

code-generation-options

specify options such as optimization, endianness, and alignment of data produced by the compiler. See Controlling code generation for details.

warning-options

control whether specific warning messages are generated. See Controlling warning messages for details.

additional-checks

specify a number of additional checks that can be applied to your code, such as checks for data flow anomalies and unused declarations. See Specifying additional checks for details.

error-options

allow you to:

  • turn specific recoverable errors off

  • downgrade specific errors to warnings.

See Controlling error messages for details.

pragma-options

allows you to emulate #pragma directives. See Pragma emulation for details.

source

are the filenames of one or more text files containing C or C++ source code, or - to specify keyboard input. By default, the compiler looks for source files, and creates object, assembler, and listing files in the current directory.

The following points apply to specifying compiler options:

Reading compiler options from a file

The following option enables you to read additional command-line options from a file:

-via filename

Opens a file and reads additional command-line options from it. For example:


armcpp -via input.txt options source.c

The options specified in filename are read at the same time as any other command-line options are parsed. If -via is specified in the Extra command line arguments text box of the APM Compiler Configuration dialog, the command-line options are immediately read into the tool configuration settings.

You can nest -via calls within -via files.

Specifying keyboard input

Use - (minus) as the source filename to instruct the compiler to take input from the keyboard. Input is terminated by entering Ctrl-D under UNIX, or Ctrl-Z under a MS Windows DOS environment.

An assembly listing for the function is sent to the output stream at the end of each C or C++ function if either:

  • no output file is specified

  • the -E compiler option is not specified.

If an output file is specified with the -o option, an object file is written. If the -E option is specified, the preprocessor output is sent to the output stream.

Getting help and version information

Use the -help compiler option to view a summary of the compiler command-line options.

Use the -vsn compiler option to display the version string for the compiler.

Redirecting standard errors

Use the -errors filename compiler option to redirect compiler error output to a file.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0041C