Skip to content

Commit 66fdae7

Browse files
authored
Merge pull request #9283 from aschwaighofer/fix_linkage_of_private_irgenmodule_accessors_wmo
2 parents f146e16 + e0e3555 commit 66fdae7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,8 +1388,12 @@ getIRLinkage(const UniversalLinkageInfo &info, SILLinkage linkage,
13881388
case SILLinkage::Private:
13891389
// In case of multiple llvm modules (in multi-threaded compilation) all
13901390
// private decls must be visible from other files.
1391+
// We use LinkOnceODR instead of External here because private lazy protocol
1392+
// witness table accessors could be emitted by two different IGMs during
1393+
// IRGen into different object files and the linker would complain about
1394+
// duplicate symbols.
13911395
if (info.HasMultipleIGMs)
1392-
return RESULT(External, Hidden, Default);
1396+
return RESULT(LinkOnceODR, Hidden, Default);
13931397
return RESULT(Internal, Default, Default);
13941398

13951399
case SILLinkage::PublicExternal: {

0 commit comments

Comments
 (0)