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.4 Order of compiler command-line options<br />

In general, compiler command-line options can appear in any order in a single compiler<br />

invocation. However, <strong>the</strong> effects of some options depend on <strong>the</strong> order <strong>the</strong>y appear in <strong>the</strong><br />

command line and how <strong>the</strong>y are combined with o<strong>the</strong>r related options, <strong>for</strong> example, optimization<br />

options prefixed by -O, or PreCompiled Header (PCH) options.<br />

The compiler enables you to use multiple options even where <strong>the</strong>se might conflict. This means<br />

that you can append new options to an existing command line, <strong>for</strong> example, in a makefile or a<br />

via file.<br />

Where options override previous options on <strong>the</strong> same command line, <strong>the</strong> last option specified<br />

always takes precedence. For example:<br />

armcc -O1 -O3 -Ospace -Otime ...<br />

is executed by <strong>the</strong> compiler as:<br />

armcc -O3 -Otime<br />

The environment variable <strong>ARM</strong>CCnn_CCOPT can be used to specify compiler command-line<br />

options. Options specified on <strong>the</strong> command line take precedence over options specified in <strong>the</strong><br />

environment variable.<br />

To see how <strong>the</strong> compiler has processed <strong>the</strong> command line, use <strong>the</strong> --show_cmdline option. This<br />

shows nondefault options that <strong>the</strong> compiler used. The contents of any via files are expanded. In<br />

<strong>the</strong> example used here, although <strong>the</strong> compiler executes armcc -O2 -Otime, <strong>the</strong> output from<br />

--show_cmdline does not include -O2. This is because -O2 is <strong>the</strong> default optimization level, and<br />

--show_cmdline does not show options that apply by default.<br />

3.4.1 See also<br />

Concepts<br />

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

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

• Specifying command-line options with an environment variable on page 2-24.<br />

Reference<br />

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

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

• Toolchain environment variables on page 2-12.<br />

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

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!