[PATCH] D22677: [ThinLTO/gold] Support for getting list of included objects from gold

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 07:10:30 PDT 2016


tejohnson created this revision.
tejohnson added reviewers: davidxl, mehdi_amini.
tejohnson added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.

In the distributed backend case, the ThinLink step and the final native
object link are separate processes. This can be problematic when archive
libraries are involved in the link (e.g. via --start-lib/--end-lib
pairs). The linker only includes objects from libraries when
there is a strong reference to them, and depending on the intervening
ThinLTO backend processes' importing/inlining, the strong references
may appear different in the two link steps. See D22356 and D22467
for two scenarios where this causes issues.

To ensure that the final link includes the same objects, this patch
adds support for an "=filename" form of the thinlto-index-only plugin
option, in which case objects gold included in the link are emitted to
the given filename. This should be used as input to the final link (e.g.
via the @filename option to gold), instead of listing all the objects
within --start-lib/--end-lib pairs again.

Note that the support for the gold callback that identifies included
objects was added in gold version 1.12.

https://reviews.llvm.org/D22677

Files:
  test/tools/gold/X86/Inputs/thinlto_emit_linked_objects.ll
  test/tools/gold/X86/thinlto_emit_linked_objects.ll
  tools/gold/gold-plugin.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22677.65073.patch
Type: text/x-patch
Size: 5401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160722/e22243c0/attachment.bin>


More information about the llvm-commits mailing list