Skip to content

Commit 335be17

Browse files
committed
IRGen: Reinstate JIT workaround removed in PR #28704
The usage of private vars that seemingly are accessed accross object files confuses the JIT. rdar://59782487
1 parent c1edc2c commit 335be17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2667,7 +2667,10 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
26672667

26682668
// rdar://problem/53836960: i386 ld64 also mis-links relative references
26692669
// to GOT entries.
2670-
if (!IGM.Triple.isOSDarwin() || IGM.Triple.getArch() != llvm::Triple::x86) {
2670+
// rdar://problem/59782487: issue with on-device JITd expressions.
2671+
// The JIT gets confused by private vars accessed accross object files.
2672+
if (!IGM.getOptions().UseJIT &&
2673+
(!IGM.Triple.isOSDarwin() || IGM.Triple.getArch() != llvm::Triple::x86)) {
26712674
gotEquivalent->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
26722675
} else {
26732676
ApplyIRLinkage(IRLinkage::InternalLinkOnceODR)

0 commit comments

Comments
 (0)