Fix for issue #535.

The symbols must have weak_odr linkage if they result from a template instantiation.
This commit is contained in:
kai
2013-11-03 22:06:49 +01:00
parent 8408afcf6d
commit 8d7f0bf0eb
3 changed files with 7 additions and 5 deletions

View File

@@ -293,8 +293,10 @@ llvm::GlobalVariable * IrAggr::getInterfaceVtbl(BaseClass * b, bool new_instance
DtoConstSize_t(interfaces_index)
};
llvm::GlobalVariable* interfaceInfosZ = getInterfaceArraySymbol();
interfaceInfosZ->setLinkage(DtoExternalLinkage(cd, false));
llvm::Constant* c = llvm::ConstantExpr::getGetElementPtr(
getInterfaceArraySymbol(), idxs, true);
interfaceInfosZ, idxs, true);
constants.push_back(c);
}
@@ -389,7 +391,7 @@ llvm::GlobalVariable * IrAggr::getInterfaceVtbl(BaseClass * b, bool new_instance
*gIR->module,
vtbl_constant->getType(),
true,
llvm::GlobalValue::ExternalLinkage,
DtoExternalLinkage(cd, false),
vtbl_constant,
mangle
);