--ltcg

This option instructs the compiler to create objects in an intermediate format so that Link-Time Code Generation (LTCG) optimizations can be performed. The optimizations applied include cross-module inlining to improve performance, and sharing of base addresses to reduce code size.

Note

  • This option might significantly increase link time and memory requirements. For large applications it is recommended that you do the code generation in partial link steps with a subset of the objects.

  • The LTCG feature is deprecated. As an alternative ARM recommends you use the --multifile option.

Show/hideExample

The following example shows how to use the --ltcg option.

armcc -c --ltcg file1.c
armcc -c --ltcg file2.c
armlink --ltcg file1.o file2.o -o prog.axf

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0491E
Non-ConfidentialID071611