Remove alignment from ctors/dtors lists in an attempt to placate LTO.

llvm-svn: 287458
This commit is contained in:
John McCall 2016-11-19 20:12:25 +00:00
parent 1cb63183af
commit 18081afc1d
1 changed files with 9 additions and 3 deletions

View File

@ -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();
}