-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[DTLTO][Clang][Docs] Update for COFF support #149988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bd1976bris
merged 1 commit into
llvm:main
from
bd1976bris:dtlto_clang_doc_coff_improvments
Aug 1, 2025
Merged
[DTLTO][Clang][Docs] Update for COFF support #149988
bd1976bris
merged 1 commit into
llvm:main
from
bd1976bris:dtlto_clang_doc_coff_improvments
Aug 1, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Member
|
@llvm/pr-subscribers-clang Author: bd1976bris (bd1976bris) ChangesAs 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:
Full diff: https://github.com/llvm/llvm-project/pull/149988.diff 1 Files Affected:
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
================
|
This comment was marked as off-topic.
This comment was marked as off-topic.
MaskRay
approved these changes
Aug 1, 2025
tru
approved these changes
Aug 1, 2025
Collaborator
Author
|
/cherry-pick c129d65 |
Member
|
/pull-request #151670 |
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this pull request
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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: