summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-10-12 18:39:29 +0000
committerTeresa Johnson <tejohnson@google.com>2016-10-12 18:39:29 +0000
commit4b9b3791727dd8664c2d228ce3abeb5be82719ca (patch)
tree03a824116b6a3073ee8c6da758dc66915b022db2 /llvm/lib/Linker/LinkModules.cpp
parentd2775ec8de822620d1cd060c8f790189d165bffa (diff)
downloadbcm5719-llvm-4b9b3791727dd8664c2d228ce3abeb5be82719ca.tar.gz
bcm5719-llvm-4b9b3791727dd8664c2d228ce3abeb5be82719ca.zip
[ThinLTO] Don't link module level assembly when importing
Module inline asm was always being linked/concatenated when running the IRLinker. This is correct for full LTO but not when we are importing for ThinLTO, as it can result in multiply defined symbols when the module asm defines a global symbol. In order to test with llvm-lto2, I had to work around PR30396, where a symbol that is defined in module assembly but defined in the LLVM IR appears twice. Added workaround to llvm-lto2 with a FIXME. Fixes PR30610. Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25359 llvm-svn: 284030
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index fae9c95ebe8..cf4826f4c02 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -582,7 +582,8 @@ bool ModuleLinker::run() {
if (Error E = Mover.move(std::move(SrcM), ValuesToLink.getArrayRef(),
[this](GlobalValue &GV, IRMover::ValueAdder Add) {
addLazyFor(GV, Add);
- })) {
+ },
+ !isPerformingImport())) {
handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) {
DstM.getContext().diagnose(LinkDiagnosticInfo(DS_Error, EIB.message()));
HasErrors = true;
OpenPOWER on IntegriCloud