Sets the optimization level for the link time optimization feature.
Syntax
--lto_level=Olevel
Where level is one of the following:
0
Minimum optimization for the performance of the compiled binary. Turns off most optimizations. When debugging is enabled, this option generates code that directly corresponds to the source code. Therefore, this optimization might result in a larger image.
1
Restricted optimization. When debugging is enabled, this option selects a
good compromise between image size, performance, and quality of debug
view.
Arm recommends -O1
rather than -O0 for the best trade-off
between debug view, code size, and performance.
2
High optimization. When debugging is enabled, the debug view might be less satisfactory because the mapping of object code to source code is not always clear. The linker might perform optimizations that the debug information cannot describe.
This optimization is the default optimization level.
3
Very high optimization. When debugging is enabled, this
option typically gives a poor debug view. Arm recommends
debugging at lower optimization levels.
fast
Enables the optimizations from both the -O3 and -ffp-mode=fastarmclang options.
Note:
Enabling the
aggressive optimizations that the -ffp-mode=fastarmclang option performs might violate strict
compliance with language standards.
max
Maximum optimization. Specifically targets performance
optimization. Enables all the optimizations from level fast, together with other aggressive
optimizations.
Caution:
This option is not
guaranteed to be fully standards-compliant for all code cases.
Note:
Code-size, build-time, and the debug view can
each be adversely affected when using this option.
Arm
cannot guarantee that the best performance optimization is
achieved in all code cases.
s
Performs optimizations to reduce code size, balancing code
size against code speed.
z
Performs optimizations to minimize image size.
min
Minimum image size.
Specifically targets minimizing code size. Enables all the optimizations
from level -Oz, together with
link-time optimizations aimed at removing unused code and data,
and virtual function elimination.
Caution:
This option is not
guaranteed to be fully standards-compliant for all code cases.
Note:
Performance, build-time, and the debug view can
each be adversely affected when using this option.
Arm
cannot guarantee that the best code size optimization is
achieved in all code cases.
Default
If you do not specify Olevel, the linker assumes O2.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.