-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[docs][NFC] Add usage instructions for FatLTO #75853
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
Conversation
We included these in the commit message when we added `-ffat-lto-objects`, but they should be in the documentation as well.
llvm/docs/FatLTO.rst
Outdated
|
||
.. code-block:: console | ||
|
||
$ clang -fno-lto -ffat-lto-objects -fuse-ld=lld foo.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a nit, but would it be possible to use example.c
instead of foo.c
here and below?
llvm/docs/FatLTO.rst
Outdated
no effect. | ||
|
||
|
||
Compile and link. Use the object code from the fat object without LTO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these "compile and link" examples make a lot of sense. I think fat LTO is only meaningful if compile and link is separate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'll revise the examples to have a common first compile step and then different link steps.
llvm/docs/FatLTO.rst
Outdated
|
||
.. code-block:: console | ||
|
||
$ clang -flto=thin -ffat-lto-objects -funified-lto -fuse-ld=lld foo.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't -funified-lto
the default/required for fat LTO now? I'd expect the flag to have no additional effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. Thanks.
Rename foo.c to example.c Remove UnifiedLTO examples, since FatLTO always uses that pipeline now.
llvm/docs/FatLTO.rst
Outdated
@@ -76,3 +76,40 @@ Supported File Formats | |||
The current implementation only supports ELF files. At time of writing, it is | |||
unclear if it will be useful to support other object file formats like ``COFF`` | |||
or ``Mach-O``. | |||
|
|||
Usage | |||
=========== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorten ===========
?
llvm/docs/FatLTO.rst
Outdated
|
||
.. code-block:: console | ||
|
||
$ clang -flto -ffat-lto-objects example.c -o example.o |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing -c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thank you!
|
||
.. code-block:: console | ||
|
||
$ clang -fno-lto -ffat-lto-objects -fuse-ld=lld example.o |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description can state that -ffat-lto-objects
is a no-op for linking when -fno-lto
is specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
llvm/docs/FatLTO.rst
Outdated
Usage | ||
=========== | ||
|
||
Users are expected to pass ``-ffat-lto-objects`` to clang in addition to one of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang users can specify -ffat-lto-objects
along with -flto
or -flto=thin
. Without the -flto
flag, -ffat-lto-objects
has no effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
We included these in the commit message when we added
-ffat-lto-objects
, but they should be in the documentation as well.