-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Backport symbol versioning patch from LLVM 4.0 #24890
Backport symbol versioning patch from LLVM 4.0 #24890
Conversation
Fantastic! This should help to alleviate issues we have been encountering in OpenCL.jl and other packages, when they loaded libraries that were using a different version of LLVM. I don't think it solves the issue of loading two versions of LLVM that are the same base version (one Julia build with patches, the other one vanilla) so maybe we can use a similar mechanism to add a |
I think it could be as simple as adding
Btw
|
If it's going to differ between platforms, depending on eg. the linker, we should have a way of accessing the prefix for packages like LLVM.jl to be able to call into Julia's |
I also believe this is correct. Windows and macOS always identifies symbols by library id (typically equal to the file base name), for performance, and thereby generally avoiding this problem. |
@Keno this might have implications for Cxx. |
I forgot that this patch existed and was about to open my own PR, but instead with https://reviews.llvm.org/D30997 at https://github.com/JuliaLang/julia/tree/vc/vendorllvm I don't know why LLVM introduced two options to solve the same problem, but my instinct is to prefer this one (#24890) over my patch since it allows us more flexibility. In any case we should have this for 1.0 since it is a general nuisance on any system that uses LLVM in mesa. |
Seems like it just needs a rebase and a review by @vchuravy and it should be good to go. |
Should help with crashes when loading multiple libLLVM versions in the same process, as happens with mesa/llvmpipe when mesa is dynamically linked against libLLVM. See JuliaLang#19606 patch: https://reviews.llvm.org/D31524 commit: https://reviews.llvm.org/rL300496
10ce1cc
to
912ea1e
Compare
Rebased. |
Shouldn't we prefix with
|
Sounds good. AFK, please go ahead and edit/merge if it passes CI.
|
I will do a round testing today and merge later.
…On Tue, Jan 16, 2018, 08:44 Isaiah Norton ***@***.***> wrote:
Sounds good. AFK, please go ahead and edit/merge if it passes CI.
On Tue, Jan 16, 2018 at 3:22 AM Tim Besard ***@***.***>
wrote:
> Shouldn't we prefix with JL_LLVM_$X.$Y just to be sure? Given that this
> is part of upstream, chances are Mesa/... also use this mechanic to
prefix
> with LLVM_$X.$Y
>
> I don't think it solves the issue of loading two versions of LLVM that
are
> the same base version (one Julia build with patches, the other one
vanilla)
> so maybe we can use a similar mechanism to add a jl-(pre|suf)fix.
>
> —
>
>
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#24890 (comment)>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AAUAGqSU8NSRHNnZ6k3n9g3yE8Ee_s2Oks5tLFw1gaJpZM4Qzl0z
>
> .
>
--
Sent from phone. Please excuse typos.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24890 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI3alQV6UeDCMh2OHTKfAGKAQEQfl9Fks5tLKfHgaJpZM4Qzl0z>
.
|
Ok this is looking good:
Libraries that are using dynamic symbol lookup are unaffected since it is a version suffix. I have a patch that adds the |
Should help with crashes when loading multiple libLLVM versions in
the same process, as happens with mesa/llvmpipe when mesa is
dynamically linked against libLLVM. See
#19606
patch: https://reviews.llvm.org/D31524
commit: https://reviews.llvm.org/rL300496