diff options
author | John McCall <rjmccall@apple.com> | 2016-11-19 20:12:25 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2016-11-19 20:12:25 +0000 |
commit | 18081afc1da8358d4c2139ab7b6e8ce0072f4eea (patch) | |
tree | 7c0cbdc9a4a19795a3ef51708b958ec97bba01e1 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1cb63183afbc0fcada7230311493ea7069ba5bfd (diff) | |
download | bcm5719-llvm-18081afc1da8358d4c2139ab7b6e8ce0072f4eea.tar.gz bcm5719-llvm-18081afc1da8358d4c2139ab7b6e8ce0072f4eea.zip |
Remove alignment from ctors/dtors lists in an attempt to placate LTO.
llvm-svn: 287458
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c931bbff063..869f0097c7f 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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(); } |