-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
LLVM 9.0.x support #3320
LLVM 9.0.x support #3320
Conversation
Ok, will do. |
@kulibali i deleted my comment. decided that it was out of scope and should be done as part of a different PR. only thing i think we need is a changelog for 9.0.0 support when it comes. |
I'm wondering if there is any list of pending tasks or known bugs on moving toward 9.0? |
There are failing tests on both Windows and Linux that need to be fixed -- that's the main area that we need help in. Also the Linux CI setup needs to be updated to build with LLVM 9, but the branch should be rebased before doing that since Sean has been making lots of changes to the CI. |
I just came up with some small fixes, what is the best way to present them here? Fork and PR maybe? |
Yes please. |
Or if the diff is small enough, just include it here. |
The diff is pretty small so I'll just post it here:
|
Here is the root cause: The new API we use, The fix I just presented will match the behavior of old LLVM: If the scope passed in is null, don't even create a |
Awesome, thanks @mshockwave! |
Windows is working now. The one remaining issue is that |
Yes I also found that problem. It didn't appear when using LLVM 7 and it's more difficult to debug since most of the stack frames are corrupted when looking into it with a debugger. My rough guess will be something to do with different EH behaviors in LLVM 9 or libunwind. |
Building with 9.0.1-rc1 shows the same problem in |
@kulibali all the tests are passing, what environment are you getting a failure in? |
O I C, this isn't testing with using 9.0.0, right? |
@SeanTAllen I don't think any of the bot is using 9.x now |
So I finally figure out the problem on the Again, the problem falls inside the LLVM part. Apply the following patch on the
Just an off-topic story: this bug has been discovered since 2015: https://bugs.llvm.org/show_bug.cgi?id=23991 Also, this bug is actually pretty hard to triggered in real-world Pony: you need to invoke PonyJIT several times (at lease 10 times) within single program execution. |
Awesome! Thanks so much @mshockwave! |
Update: During my development I temporarily comment out the
And I found my solution doesn't work if I restore the Makefile 😢 |
We have decided to:
|
@mshockwave your fix worked for me in a fresh docker container (i confirmed the segfault prior to applying your diff):
|
@kulibali that sounds a reasonable decision. This issue has taken me and rest of us too much time. Regardless, I think we still can create a JIT fix patch mentioned earlier for our vendored LLVM @dipinhora thanks for your verifying. That reminded me a config that was different from the usual building process: I'm linking all the LLVM libraries dynamically. I will also report our discovery regarding the JIT issue to the LLVM community. |
There was a small twist regarding the JIT fix patch I posted earlier: One of the ORC JIT creators, Lang Hames, also committed a patch to solve the same problem (i.e. missing EH frames deregistration in ORCv2) but with a more general solution. So I think (before we synchronize with upstream LLVM) we should use that patch instead. Also, I did some extra experiments to confirm that under the following conditions, both my patch and Lang's patch will fix our problem:
Which, are the "normal" build configurations. |
Thanks very much to @mshockwave for their help!
@kulibali LLVM 9.0.1 doesn't seem to have been released yet, what version is the vendored LLVM updated to? 9.0.0? an rc candidate for 9.0.1? |
9.0.1 final has been tagged; the vendored LLVM is at |
Awesome. @kulibali I'm going to add a couple of CHANGELOG entries to this PR. |
@kulibali I fixed a small formatting error. I'm going to make sure it passes CI and will then merge. |
Party time @kulibali. This one was merged. |
This PR is for compiling with LLVM 9.0.0.