-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support LLVM 11.0 #9829
Support LLVM 11.0 #9829
Conversation
Since LLVM 8 there is progress towards "opaque pointer types". The build_call and build_invoke methods are deprecated and the new alternatives should be used. These alternative require passing the function type also as an argument. Since LLVM 9 there is a FunctionCallee structure that wrap these two values. Eventually the Crystal LLVM::Function could be replaced by a LLVM::FunctionCallee. That is delayed until the oldest support LLVM version is bumped to 9 to avoid additional mess.
Expose LibLLVM.build_call and LibLLVM.build_invoke on LLVM < 11.0 Expose LibLLVM.build_call2 and LibLLVM.build_invoke2 on LLVM >= 8.0 Use opaque pointers alternatives in llvm_ext.cc and in LLVM::Builder for LLVM >= 8.0 since they are available from that version.
Ok, the support for llvm 11 is ready for review. There 1 std spec failing when running against llvm 11.
But when run without debug information if works fine.
When I use lldb I get the following.
I'm not sure if something is getting wrongly optimized and end up generating an ud2 instruction. So --release builds with llvm might require an additional --no-debug if this is merged. This affects Linux and Darwin. |
I iterated a bit more to get rid of one more deprecation ahead of time. Improved a bit how dwarf information is loaded to avoid reloading it. The underlying issue pointed in #9829 (comment) smells like an llvm optimization issue to me. The best I could get the hack/workaround submitted. With that code there the issue is gone in Linux and Darwin. So if I can have another review we can claim llvm 11 support I guess. The bonus in this PR is that if the load_dwarf fails (due to some runtime exception) the program will not crash, it will report the error on start, and the runtime backtraces will have no dwarf information. |
Closes #9809
Pending unresolved issue #9809 (comment)