Page MenuHomePhabricator

[lld] Preliminary fat-lto-object support
Needs ReviewPublic

Authored by paulkirth on Mar 23 2023, 5:58 PM.

Details

Summary

This patch adds support to lld for -fat-lto-objects. We add a new
-fat-lto-objects flag to LLD, and slightly change how it chooses input
files in the driver when the flag is set.

Fat LTO objects contain both LTO compatible IR, as well as generated object
code. This allows users to defer the choice of whether to use LTO or not to
link-time. This is a feature available in GCC for some time, and makes the
existing -ffat-lto-objects flag functional in the same way as GCC's.

If the -fat-lto-objects flag is passed to LLD and the input files are fat
object files, then the linker will chose the LTO compatible bitcode sections
embedded within the fat object and link them together using LTO. Otherwise,
standard object file linking is done using the assembly section in the object
files.

Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977

Depends on D146777

Diff Detail

Event Timeline

paulkirth created this revision.Mar 23 2023, 5:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2023, 5:58 PM
paulkirth requested review of this revision.Mar 23 2023, 5:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2023, 5:58 PM
paulkirth updated this revision to Diff 507940.Mar 23 2023, 7:08 PM

remove unused yaml input files for testing

paulkirth updated this revision to Diff 507945.Mar 23 2023, 7:15 PM

Fix typo in test code.

paulkirth updated this revision to Diff 508775.Mar 27 2023, 1:16 PM
paulkirth retitled this revision from [lld] Preliminary fat-lot-object support to [lld] Preliminary fat-lto-object support.

Fix typo in title

Add release note

aeubanks added inline comments.
lld/docs/ReleaseNotes.rst
29

typo

paulkirth updated this revision to Diff 517731.Apr 27 2023, 3:24 PM
paulkirth marked an inline comment as done.

Fix typo