Download PDF version - ARM Information Center

Transcript
Getting started with the ARM Compiler
If a source file is an assembly file, that is, one with an extension
of .s, the compiler activates the ARM assembler to process the
source file.
The ARM compiler accepts one or more input files, for example:
armcc -c [options] ifile_1 ... ifile_n
Specifying a dash - for an input file causes the compiler to read from stdin. To specify
that all subsequent arguments are treated as filenames, not as command switches, use
the POSIX option --. See Using command-line options on page 2-2 for more
information.
Default behavior
The compiler startup configuration is determined by the compiler according to the
specified command-line options and the filename extensions. Command-line options
override the default configuration determined by the filename extension. The compiler
startup language can be C or C++ and the instruction set can be ARM or Thumb.
When you compile multiple files with a single command, all files must be of the same
type, either C or C++. The compiler cannot switch the language based on the file
extension. The following example produces an error, because the specified source files
have different languages:
armcc -c test1.c test2.cpp
If you specify files with conflicting file extensions you can force the compiler to
compile either for C or for C++, regardless of file extension. For example:
armcc -c --cpp test1.c test2.cpp
Where an unrecognized extension begins with .c, for example, filename.cmd, a warning
is given.
Support for processing PreCompiled Header (PCH) files is not available when you
specify multiple source files in a single compilation. If you request PCH processing and
specify more than one primary source file, the compiler issues an error message, and
aborts the compilation.
See Precompiled header files on page 2-16 for more information.
2-8
Copyright © 2002-2007 ARM Limited. All rights reserved.
Non-Confidential
ARM DUI 0205H