1.18 -flto, -fno-lto

Enables or disables link time optimization. -flto outputs bitcode wrapped in an ELF file for link time optimization.

The primary use for files containing bitcode is for link time optimization. See Optimizing across modules with link time optimization in the Software Development Guide for more information about link time optimization.

Usage

The compiler creates one file for each source file, with a .o file extension replacing the file extension on the input source file.

The -flto option passes the --lto option to armlink to enable link time optimization, unless the -c option is specified.

-flto is automatically enabled when you specify the armclang -Omax option.

Note:

Object files produced with -flto contain bitcode, which cannot be disassembled into meaningful disassembly using the -S option or the fromelf tool.

Caution:

Object files generated using the -flto option are not suitable for creating static libraries, or ROPI or RWPI images.

Caution:

Link Time Optimization performs aggressive optimizations by analyzing the dependencies between bitcode format objects. This can result in the removal of unused variables and functions in the source code.

Note:

Link Time Optimization does not honor the armclang -mexecute-only option. If you use the armclang -flto or -Omax options, then the compiler cannot generate execute-only code and produces a warning.

Default

The default is -fno-lto, except when you specify the optimization level -Omax.

Non-ConfidentialPDF file icon PDF versionDUI0774J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.