summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2016-11-19 20:12:25 +0000
committerJohn McCall <rjmccall@apple.com>2016-11-19 20:12:25 +0000
commitaedeadddd4ccdc50dd68d7a65166e2635a7e03e2 (patch)
treeee5e6f6886b84951b7c28a25a587c3ea14237ede /lib/CodeGen/CodeGenModule.cpp
parentb806c5ad660436db46eba99b8d26081324bc2af4 (diff)
downloadclang-aedeadddd4ccdc50dd68d7a65166e2635a7e03e2.tar.gz
Remove alignment from ctors/dtors lists in an attempt to placate LTO.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index c931bbff06..869f0097c7 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -756,9 +756,15 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) {
ctors.add(ctor.finish());
}
- (void) ctors.finishAndCreateGlobal(GlobalName, getPointerAlign(),
- /*constant*/ false,
- llvm::GlobalValue::AppendingLinkage);
+ auto list =
+ ctors.finishAndCreateGlobal(GlobalName, getPointerAlign(),
+ /*constant*/ false,
+ llvm::GlobalValue::AppendingLinkage);
+
+ // The LTO linker doesn't seem to like it when we set an alignment
+ // on appending variables. Take it off as a workaround.
+ list->setAlignment(0);
+
Fns.clear();
}