Skip to content

Conversation

@llvmbot
Copy link
Member

@llvmbot llvmbot commented Aug 1, 2025

Backport c129d65

Requested by: @bd1976bris

@llvmbot
Copy link
Member Author

llvmbot commented Aug 1, 2025

@tru What do you think about merging this PR to the release branch?

@llvmbot llvmbot requested a review from tru August 1, 2025 08:22
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Aug 1, 2025
@llvmbot
Copy link
Member Author

llvmbot commented Aug 1, 2025

@llvm/pr-subscribers-clang

Author: None (llvmbot)

Changes

Backport c129d65

Requested by: @bd1976bris


Full diff: https://github.com/llvm/llvm-project/pull/151670.diff

1 Files Affected:

  • (modified) clang/docs/ThinLTO.rst (+20-5)
diff --git a/clang/docs/ThinLTO.rst b/clang/docs/ThinLTO.rst
index 569405ff5b2b7..8cb3e0b2b0d11 100644
--- a/clang/docs/ThinLTO.rst
+++ b/clang/docs/ThinLTO.rst
@@ -249,6 +249,9 @@ during the traditional link step.
 
 The implementation is documented here: https://llvm.org/docs/DTLTO.html.
 
+Command-Line Options
+^^^^^^^^^^^^^^^^^^^^
+
 DTLTO requires the LLD linker (``-fuse-ld=lld``).
 
 ``-fthinlto-distributor=<path>``
@@ -260,17 +263,29 @@ DTLTO requires the LLD linker (``-fuse-ld=lld``).
    - Can be specified multiple times to pass multiple options.
    - Multiple options can also be specified by separating them with commas.
 
-Examples:
-   - ``clang -flto=thin -fthinlto-distributor=incredibuild.exe -Xthinlto-distributor=--verbose,--j10 -fuse-ld=lld``
-   - ``clang -flto=thin -fthinlto-distributor=$(which python) -Xthinlto-distributor=incredibuild.py -fuse-ld=lld``
-
 If ``-fthinlto-distributor=`` is specified, Clang supplies the path to a
 compiler to be executed remotely to perform the ThinLTO backend
 compilations. Currently, this is Clang itself.
 
+Usage
+^^^^^
+
+Compilation is unchanged from ThinLTO. DTLTO options need to supplied for the link step:
+
+.. code-block:: console
+
+  % clang -flto=thin -fthinlto-distributor=distribute.sh -Xthinlto-distributor=--verbose,--j10 -fuse-ld=lld file1.o file2.o
+  % clang -flto=thin -fthinlto-distributor=$(which python) -Xthinlto-distributor=distribute.py -fuse-ld=lld file1.o file2.o
+
+When using lld-link:
+
+.. code-block:: console
+
+  % lld-link /out:a.exe file1.obj file2.obj /thinlto-distributor:distribute.exe /thinlto-remote-compiler:${LLVM}\bin\clang.exe /thinlto-distributor-arg:--verbose
+
 Note that currently, DTLTO is only supported in some LLD flavors. Support can
 be added to other LLD flavours in the future.
-See `DTLTO <https://lld.llvm.org/dtlto.html>`_ for more information.
+See `DTLTO <https://lld.llvm.org/DTLTO.html>`_ for more information.
 
 More Information
 ================

@github-project-automation github-project-automation bot moved this from Needs Triage to Needs Merge in LLVM Release Status Aug 5, 2025
As the COFF linker is usually invoked independently, update the Clang
DTLTO section to show an example. This follows what is done earlier in
the document.

Also some minor fixes and improvements:
- Use generic distributor names to avoid implying anything about what an
Incredibuild distributor may or should support.
- Use subheadings for readability.
- Correct a mis-cased hyperlink.

(cherry picked from commit c129d65)
@tru tru merged commit 8b85cf5 into llvm:release/21.x Aug 5, 2025
@github-project-automation github-project-automation bot moved this from Needs Merge to Done in LLVM Release Status Aug 5, 2025
@github-actions
Copy link

github-actions bot commented Aug 5, 2025

@bd1976bris (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

Development

Successfully merging this pull request may close these issues.

3 participants