[PATCH] D146778: [lld] Preliminary fat-lot-object support

Paul Kirth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 17:58:17 PDT 2023


paulkirth created this revision.
paulkirth added reviewers: phosek, MaskRay, alexander-shaposhnikov.
Herald added subscribers: ormris, steven_wu, hiraditya, arichardson, emaste.
Herald added a project: All.
paulkirth requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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 <https://reviews.llvm.org/D146777>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146778

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/Options.td
  lld/test/ELF/fatlto/Inputs/a-LTO.ll
  lld/test/ELF/fatlto/Inputs/a-fatLTO.yaml
  lld/test/ELF/fatlto/Inputs/a.yaml
  lld/test/ELF/fatlto/Inputs/main-LTO.ll
  lld/test/ELF/fatlto/Inputs/main-fatLTO.yaml
  lld/test/ELF/fatlto/Inputs/main.yaml
  lld/test/ELF/fatlto/fatlto.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146778.507932.patch
Type: text/x-patch
Size: 29970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230324/1afa42bb/attachment.bin>


More information about the llvm-commits mailing list