11.79 --lto, --no_lto

Enables link time optimization.

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:

When you specify the -flto option, armclang produces ELF files that contain bitcode in a .llvmbc section.

With the --no_lto option, armlink gives an error message if it encounters any .llvmbc sections.

Default

The default is --no_lto.

Dependencies

Link time optimization requires the dependent library libLTO.

Table 11-4 Link time optimization dependencies

Dependency Windows filename Linux filename
libLTO LTO.dll libLTO.so

By default, the dependent library libLTO is present in the same directory as armlink.

The search order for these dependencies is as follows.

LTO.dll:

  1. The same directory as the armlink executable.
  2. The directories in the current directory search path.

libLTO.so:

  1. The same directory as the armlink executable.
  2. The directories in the LD_LIBRARY_PATH environment variable.
  3. The cache file /etc/ld.so.cache.
  4. The directories /lib and /usr/lib.

    These directories might have the suffix 64 on some 64-bit Linux systems. For example, on 64-bit Red Hat Enterprise Linux the directories are /lib64 and /usr/lib64.

Note:

The armclang executables and the libLTO library must come from the same Arm® Compiler 6 installation. Any use of libLTO other than that supplied with Arm Compiler 6 is unsupported.

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.
Non-ConfidentialPDF file icon PDF versionDUI0803J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.