File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -76,3 +76,40 @@ Supported File Formats
76
76
The current implementation only supports ELF files. At time of writing, it is
77
77
unclear if it will be useful to support other object file formats like ``COFF ``
78
78
or ``Mach-O ``.
79
+
80
+ Usage
81
+ =====
82
+
83
+ Clang users can specify ``-ffat-lto-objects `` with ``-flto `` or ``-flto=thin ``.
84
+ Without the ``-flto `` option, ``-ffat-lto-objects `` has no effect.
85
+
86
+ Compile an object file using FatLTO:
87
+
88
+ .. code-block :: console
89
+
90
+ $ clang -flto -ffat-lto-objects example.c -c -o example.o
91
+
92
+ Link using the object code from the fat object without LTO. This turns
93
+ ``-ffat-lto-objects `` into a no-op, when ``-fno-lto `` is specified:
94
+
95
+ .. code-block :: console
96
+
97
+ $ clang -fno-lto -ffat-lto-objects -fuse-ld=lld example.o
98
+
99
+ Alternatively, you can omit any references to LTO with fat objects and retain standard linker behavior:
100
+
101
+ .. code-block :: console
102
+
103
+ $ clang -fuse-ld=lld example.o
104
+
105
+ Link using the LLVM bitcode from the fat object with Full LTO:
106
+
107
+ .. code-block :: console
108
+
109
+ $ clang -flto -ffat-lto-objects -fuse-ld=lld example.o # clang will pass --lto=full --fat-lto-objects to ld.lld
110
+
111
+ Link using the LLVM bitcode from the fat object with Thin LTO:
112
+
113
+ .. code-block :: console
114
+
115
+ $ clang -flto=thin -ffat-lto-objects -fuse-ld=lld example.o # clang will pass --lto=thin --fat-lto-objects to ld.lld
You can’t perform that action at this time.
0 commit comments