r287458 - Remove alignment from ctors/dtors lists in an attempt to placate LTO.
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 19 12:12:26 PST 2016
Author: rjmccall
Date: Sat Nov 19 14:12:25 2016
New Revision: 287458
URL: http://llvm.org/viewvc/llvm-project?rev=287458&view=rev
Log:
Remove alignment from ctors/dtors lists in an attempt to placate LTO.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=287458&r1=287457&r2=287458&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Nov 19 14:12:25 2016
@@ -756,9 +756,15 @@ void CodeGenModule::EmitCtorList(CtorLis
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();
}
More information about the cfe-commits
mailing list