-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: Work around JIT bug with GOT equivalents. #24944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please test |
Build failed |
@swift-ci Please test |
Build failed |
lib/IRGen/GenDecl.cpp
Outdated
@@ -2419,7 +2420,9 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM, | |||
llvm::GlobalValue::PrivateLinkage, | |||
global, | |||
llvm::Twine("got.") + globalName); | |||
gotEquivalent->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global); | |||
if (!IGM.getOptions().UseJIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be nice to annotate with a FIXME
and a reference to the SR and PR
ad89fa5
to
05fe130
Compare
@swift-ci Please test |
Build failed |
Build failed |
05fe130
to
c7c8e5e
Compare
@swift-ci Please test |
Build failed |
Build failed |
lib/IRGen/GenDecl.cpp
Outdated
if (!IGM.getOptions().UseJIT) { | ||
gotEquivalent->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global); | ||
} else { | ||
gotEquivalent->setLinkage(llvm::GlobalValue::LinkOnceODRLinkage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ApplyIRLinkage
here. Without the COMDAT, this will break the Windows build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably wouldn't matter in this case, because there'd never be any time we feed two -use-jit
-built modules into LINK simultaneously. In immediate mode there's only one module, and in integrated-REPL mode, the REPL does its own ad-hoc coalescing and linking of separate modules.
SR-10590 | rdar://problem/50968433 appears to be caused by an LLVM JIT bug where GOT-equivalent globals get emitted with incorrect alignment. Not marking the GOT equivalent as unnamed_addr (which prevents it from getting folded into the GOT, or other equivalent constants) appears to work around the issue.
c7c8e5e
to
81c7f84
Compare
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test Linux |
SR-10590 | rdar://problem/50968433 appears to be caused by an LLVM JIT bug where GOT-equivalent
globals get emitted with incorrect alignment. Not marking the GOT equivalent as unnamed_addr
(which prevents it from getting folded into the GOT, or other equivalent constants) appears
to work around the issue.
rdar://problem/50971519