-
-
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
Copy global variable linkages when moving functions #31272
Copy global variable linkages when moving functions #31272
Conversation
This seems fine to me, though I have no particular frame of reference. I guess we should try Cxx.jl and see if that still works, since the way this code was originally written was to try that and see if it works. |
By "we" I assume you mean "you" since I doubt anyone else is able to do that right now 😁 |
Actually, I haven't tried Cxx.jl in quite some time - there's some other folks actively using it though, but yes, I could try it, though I'm unlikely to get to it for another couple days. |
So I gave it a whirl and Cxx passes on master, but fails on this branch with:
So Cxx.jl will need some adjustment (sadly I don't have time to play around with it),l I found this old thing, but I didn't try it out https://github.com/Keno/Cxx.jl/blob/c62cb578ebde43d040e3f175ea2365b292c6f487/src/bootstrap.cpp#L1729 |
Thanks! I restored those commented-out lines and sent a PR to Cxx.jl. I'm still waiting for the CI builds to come back, but the changes in that PR seem to be sufficient to make Cxx.jl's tests pass on my machine, even when run by a version of Julia compiled from this PR. |
Hi everyone. It's been a while since I sent this PR and the accompanying PR for Cxx.jl. The latter works locally for me but the CI builds are broken by what I think is bitrot: routine steps of the CI build process are failing. The Linux CI builds fail because a download 404s; the macOS CI builds try to delete folders without the appropriate permissions. I'm not sure how to proceed here. I think the change I'm proposing in this PR—to not overwrite global linkages—is reasonable. I'm working on a fork of CUDAnative that includes a garbage collector and said fork depends on this PR, among other things. I'd like to upstream my changes eventually, but I can't realistically expect for that to happen until my fork runs on Julia's master branch. Is there anything I can do to get this PR merged in? |
This change sounds reasonable for me. Can you rebase (so that we get current CI) and maybe add a test (even though I don't quite know how to test this.) |
fab0773
to
49124a1
Compare
Sure! I rebased and added a test. I'm still waiting for the CI results to come back for the commit where I added the test, but the CI results for my previous commit seem promising. |
Thanks for the approval! The buildbot CI builds seem to succeed, but the Travis and AppVeyor builds are failing due to unsatisfiable package requirements in the Pkg tests. I reckon those are unrelated to my PR because the same errors also appear in the CI builds for the latest master branch commit. Is there anything I can do to fix the failing AppVeyor and Travis CI builds for this PR? Should I rebase again? |
@Keno any objections to merge this? |
Hi! I'd like to propose a one-line change to the
GlobalVariable
copying logic that is invoked whenllvmcall
is passed a pointer to an LLVM function. Currently, any global variables that are used by such a function are copied to the module that performs thellvmcall
. However, the current global variable copying logic discards linkage information by making all copied globals external.It'd be really nice if linkage information didn't get discarded—the current semantics are not what
llvmcall
users seem to expect, judging from, e.g., this line of code in CUDAnative. The change I'm proposing is to copy global variable linkages when copying global variables. Is that okay?