File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2559,13 +2559,22 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
2559
2559
// rdar://problem/50968433: Unnamed_addr constants appear to get emitted
2560
2560
// with incorrect alignment by the LLVM JIT in some cases. Don't use
2561
2561
// unnamed_addr as a workaround.
2562
- if (!IGM.getOptions ().UseJIT ) {
2562
+ // rdar://problem/53836960: LLVM miscompiles relative references to local
2563
+ // symbols.
2564
+ if (!IGM.getOptions ().UseJIT
2565
+ && (!IGM.Triple .isOSDarwin ()
2566
+ || (IGM.Triple .getArch () != llvm::Triple::x86 &&
2567
+ IGM.Triple .getArchName () != " armv7" &&
2568
+ IGM.Triple .getArchName () != " armv7s" &&
2569
+ IGM.Triple .getArchName () != " thumbv7" &&
2570
+ IGM.Triple .getArchName () != " thumbv7s" &&
2571
+ !IGM.Triple .isWatchABI ()))) {
2563
2572
gotEquivalent->setUnnamedAddr (llvm::GlobalValue::UnnamedAddr::Global);
2564
2573
} else {
2565
2574
ApplyIRLinkage (IRLinkage::InternalLinkOnceODR)
2566
2575
.to (gotEquivalent);
2567
2576
}
2568
-
2577
+
2569
2578
return gotEquivalent;
2570
2579
}
2571
2580
You can’t perform that action at this time.
0 commit comments