-ffat-lto-objects

Purpose

When Link Time Optimization (LTO) is enabled, produces XCOFF object files that contain both native object code and LLVM bitcode. The XCOFF object files are supported by the AIX® linker starting from AIX 7.2 TL5 SP5 and AIX 7.3 TL1.

Syntax

Read syntax diagramSkip visual syntax diagram-f no-fat-lto-objectsfat-lto-objects

Defaults

-fno-fat-lto-objects

Usage

You can use the -ffat-lto-objects option when the same object file is to be used in both LTO enabled and native linking. For example, if an object file is to be linked into both unit tests where -flto is not desired and a main binary where linking with -flto is desired, use the -ffat-lto-objects option to create a fat object file that contains both the native XCOFF and LLVM bitcode representations of the file to satisfy both cases.

Examples

Example 1
When -ffat-lto-objects is not in effect, -flto produces bitcode files that can be used only with -flto.
ibm-clang –O –flto –c myfile.c
$ file myfile.o
myfile.o: LLVM IR bitcode
$
Example 2

When -ffat-lto-objects is in effect, -flto produces XCOFF object files that contain embedded bitcode sections. These object files can be used with or without -flto.

ibm-clang –O –flto -ffat-lto-objects –c myfile.c
$ file myfile.o
myfile.o: executable (RISC System/6000) or object module not stripped
$

Related information