29.10.2014 Views

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Getting started with <strong>the</strong> <strong>Compiler</strong><br />

3.3 Default compiler behavior<br />

The default compiler configuration is determined by <strong>the</strong> filename extension, <strong>for</strong> example,<br />

filename.c, filename.cpp, but <strong>the</strong> command-line options can override this.<br />

The compiler startup language can be C or C++ and <strong>the</strong> instruction set can be <strong>ARM</strong> or Thumb.<br />

When you compile multiple files with a single command, all files must be of <strong>the</strong> same type,<br />

ei<strong>the</strong>r C or C++. The compiler cannot switch <strong>the</strong> language based on <strong>the</strong> file extension. The<br />

following example produces an error because <strong>the</strong> specified source files have different<br />

languages:<br />

armcc -c test1.c test2.cpp<br />

If you specify files with conflicting file extensions you can <strong>for</strong>ce <strong>the</strong> compiler to compile both<br />

files <strong>for</strong> C or <strong>for</strong> C++, regardless of file extension. For example:<br />

armcc -c --cpp test1.c test2.cpp<br />

Where an unrecognized extension begins with .c, <strong>for</strong> example, filename.cmd, an error message<br />

is generated.<br />

Support <strong>for</strong> processing PreCompiled Header (PCH) files is not available when you specify<br />

multiple source files in a single compilation. If you request PCH processing and specify more<br />

than one primary source file, <strong>the</strong> compiler issues an error message, and aborts <strong>the</strong> compilation.<br />

armcc can in turn invoke armasm and armlink. For example, if your source code contains<br />

embedded assembler, armasm is called. With regard to where armcc looks <strong>for</strong> <strong>the</strong> armasm and<br />

armlink binaries, it first checks <strong>the</strong> same location as armcc. If not found, it <strong>the</strong>n checks <strong>the</strong> PATH<br />

locations <strong>for</strong> <strong>the</strong>se binaries.<br />

3.3.1 See also<br />

Tasks<br />

• <strong>Using</strong> stdin to input source code to <strong>the</strong> compiler on page 3-11.<br />

Introducing <strong>the</strong> <strong>ARM</strong> <strong>Compiler</strong> <strong>toolchain</strong>:<br />

• <strong>Using</strong> a text file to specify command-line options on page 2-20.<br />

Concepts<br />

• Order of compiler command-line options on page 3-10<br />

• Filename suffixes recognized by <strong>the</strong> compiler on page 3-14<br />

• <strong>Compiler</strong> output files on page 3-16<br />

• Factors influencing how <strong>the</strong> compiler searches <strong>for</strong> header files on page 3-17<br />

• <strong>Compiler</strong> search rules and <strong>the</strong> current place on page 3-19<br />

• The <strong>ARM</strong>CCnnINC environment variable on page 3-20<br />

• <strong>Compiler</strong> command-line options and search paths on page 3-18<br />

• PreCompiled Header (PCH) files on page 4-29.<br />

Introducing <strong>the</strong> <strong>ARM</strong> <strong>Compiler</strong> <strong>toolchain</strong>:<br />

• Autocompletion of compilation tools command-line option on page 2-19<br />

• TMP environment variable <strong>for</strong> temporary file directories on page 2-23.<br />

Reference<br />

• <strong>Compiler</strong> command-line syntax on page 3-3<br />

• <strong>Compiler</strong> command-line options listed by group on page 3-4.<br />

<strong>ARM</strong> DUI 0375C Copyright © 2007-2008, 2011 <strong>ARM</strong>. All rights reserved. 3-8<br />

ID061811<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!