projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1cb6318
)
Remove alignment from ctors/dtors lists in an attempt to placate LTO.
author
John McCall
<rjmccall@apple.com>
Sat, 19 Nov 2016 20:12:25 +0000
(20:12 +0000)
committer
John McCall
<rjmccall@apple.com>
Sat, 19 Nov 2016 20:12:25 +0000
(20:12 +0000)
llvm-svn: 287458
clang/lib/CodeGen/CodeGenModule.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/CodeGen/CodeGenModule.cpp
b/clang/lib/CodeGen/CodeGenModule.cpp
index
c931bbf
..
869f009
100644
(file)
--- 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();
}