@@ -249,6 +249,9 @@ during the traditional link step.
249
249
250
250
The implementation is documented here: https://llvm.org/docs/DTLTO.html.
251
251
252
+ Command-Line Options
253
+ ^^^^^^^^^^^^^^^^^^^^
254
+
252
255
DTLTO requires the LLD linker (``-fuse-ld=lld ``).
253
256
254
257
``-fthinlto-distributor=<path> ``
@@ -260,17 +263,29 @@ DTLTO requires the LLD linker (``-fuse-ld=lld``).
260
263
- Can be specified multiple times to pass multiple options.
261
264
- Multiple options can also be specified by separating them with commas.
262
265
263
- Examples:
264
- - ``clang -flto=thin -fthinlto-distributor=incredibuild.exe -Xthinlto-distributor=--verbose,--j10 -fuse-ld=lld ``
265
- - ``clang -flto=thin -fthinlto-distributor=$(which python) -Xthinlto-distributor=incredibuild.py -fuse-ld=lld ``
266
-
267
266
If ``-fthinlto-distributor= `` is specified, Clang supplies the path to a
268
267
compiler to be executed remotely to perform the ThinLTO backend
269
268
compilations. Currently, this is Clang itself.
270
269
270
+ Usage
271
+ ^^^^^
272
+
273
+ Compilation is unchanged from ThinLTO. DTLTO options need to supplied for the link step:
274
+
275
+ .. code-block :: console
276
+
277
+ % clang -flto=thin -fthinlto-distributor=distribute.sh -Xthinlto-distributor=--verbose,--j10 -fuse-ld=lld file1.o file2.o
278
+ % clang -flto=thin -fthinlto-distributor=$(which python) -Xthinlto-distributor=distribute.py -fuse-ld=lld file1.o file2.o
279
+
280
+ When using lld-link:
281
+
282
+ .. code-block :: console
283
+
284
+ % lld-link /out:a.exe file1.obj file2.obj /thinlto-distributor:distribute.exe /thinlto-remote-compiler:${LLVM}\bin\clang.exe /thinlto-distributor-arg:--verbose
285
+
271
286
Note that currently, DTLTO is only supported in some LLD flavors. Support can
272
287
be added to other LLD flavours in the future.
273
- See `DTLTO <https://lld.llvm.org/dtlto .html >`_ for more information.
288
+ See `DTLTO <https://lld.llvm.org/DTLTO .html >`_ for more information.
274
289
275
290
More Information
276
291
================
0 commit comments