OrcV2 is more strict with linkage.

When we compile incremental inputs we store each input in a separate
llvm::Module. In order to preserve the semantics, we make all symbols from
each module with external linkage, that is, accessible from other modules.

This model works well for almost all symbols, except for the clang-generated
ones which have the same name. For example clang stores strings in variables
`.strN` which may clash accross modules. Luckily, these strings are used within
a single module and thus we can avoid the JIT error by keeping them with their
non-external linkage.
This commit is contained in:
Vassil Vassilev 2022-03-19 17:57:47 +00:00 committed by jenkins
parent 7b27b283f9
commit 357a4c8377

View File

@ -43,6 +43,8 @@ namespace {
if (GV.isDeclaration())
return false; // no change.
if (GV.getName().startswith(".str"))
return false;
// GV is a definition.
llvm::GlobalValue::LinkageTypes LT = GV.getLinkage();