mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 00:20:40 +03:00
Emulate @weak functions on Windows and don't emit COMDATs for ELF anymore
Emulation for @weak global variables is still left out but should be
analogous.
The test adaptations are mostly a revert of 3893840f
. The testcase has
shown that @weak hasn't worked properly for ELF (linker apparently
prefers the version in the 1st object file, independent of whether it's
weak or not), because the functions are emitted in COMDATs.
clang emits COMDATs for templates and inline functions only, not for
regular functions.
This commit is contained in:
parent
24af7a32e7
commit
967947eb84
12 changed files with 104 additions and 30 deletions
|
@ -85,7 +85,7 @@ void RTTIBuilder::push_void_array(llvm::Constant *CI, Type *valtype,
|
|||
mangleToBuffer(mangle_sym, &initname);
|
||||
initname.writestring(".rtti.voidarr.data");
|
||||
|
||||
const LinkageWithCOMDAT lwc(TYPEINFO_LINKAGE_TYPE, supportsCOMDAT());
|
||||
const LinkageWithCOMDAT lwc(TYPEINFO_LINKAGE_TYPE, needsCOMDAT());
|
||||
|
||||
auto G = new LLGlobalVariable(gIR->module, CI->getType(), true, lwc.first, CI,
|
||||
initname.peekChars());
|
||||
|
@ -111,7 +111,7 @@ void RTTIBuilder::push_array(llvm::Constant *CI, uint64_t dim, Type *valtype,
|
|||
initname.writestring(tmpStr.c_str());
|
||||
initname.writestring(".data");
|
||||
|
||||
const LinkageWithCOMDAT lwc(TYPEINFO_LINKAGE_TYPE, supportsCOMDAT());
|
||||
const LinkageWithCOMDAT lwc(TYPEINFO_LINKAGE_TYPE, needsCOMDAT());
|
||||
|
||||
auto G = new LLGlobalVariable(gIR->module, CI->getType(), true, lwc.first, CI,
|
||||
initname.peekChars());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue