@@ -249,6 +249,9 @@ during the traditional link step.
249249
250250The implementation is documented here: https://llvm.org/docs/DTLTO.html.
251251
252+ Command-Line Options
253+ ^^^^^^^^^^^^^^^^^^^^
254+
252255DTLTO requires the LLD linker (``-fuse-ld=lld ``).
253256
254257``-fthinlto-distributor=<path> ``
@@ -260,17 +263,29 @@ DTLTO requires the LLD linker (``-fuse-ld=lld``).
260263 - Can be specified multiple times to pass multiple options.
261264 - Multiple options can also be specified by separating them with commas.
262265
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-
267266If ``-fthinlto-distributor= `` is specified, Clang supplies the path to a
268267compiler to be executed remotely to perform the ThinLTO backend
269268compilations. Currently, this is Clang itself.
270269
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+
271286 Note that currently, DTLTO is only supported in some LLD flavors. Support can
272287be 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.
274289
275290More Information
276291================
0 commit comments