forked from OSchip/llvm-project
1e2708c9e0
Summary: 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. Reviewers: davidxl, mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D22677 llvm-svn: 276450 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
README.txt | ||
gold-plugin.cpp | ||
gold.exports |
README.txt
The LLVM Gold LTO Plugin ======================== This directory contains a plugin that is designed to work with binutils gold linker. At present time, this is not the default linker in binutils, and the default build of gold does not support plugins. See docs/GoldPlugin.html for complete build and usage instructions. NOTE: libLTO and LLVMgold aren't built without PIC because they would fail to link on x86-64 with a relocation error: PIC and non-PIC can't be combined. As an alternative to passing --enable-pic, you can use 'make ENABLE_PIC=1' in your entire LLVM build.