-
Notifications
You must be signed in to change notification settings - Fork 472
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
clang and link-time-optimization #242
Comments
I think this may theoretically be possible, but in practice there are likely a lot of issues to arise due to differing LLVM versions. In any case I don't think this is somethign this crate will do automatically, so I'm going to close this. |
Thanks! |
http://blog.llvm.org/2019/09/closing-gap-cross-language-lto-between.html?m=1 |
As the person who implemented a lot of the Firefox side of cross-language LTO, I would strongly recommend not doing this automatically. xLTO is broken by the Mac linker in easy-to-hit ways, which immediately rules out a whole platform for this sort of work. (Firefox made it work, but we also cross-compile from Linux and fixed the bug in the open-source version of the Mac linker; the first is not viable for many people and asking people to compile and use a fixed linker is also not realistic.) The version mismatch thing was already mentioned in the above discussion, and I think trying to get that right in Even an |
I would agree with @froydnj that this is pretty unlikely to ever be turned on by default. I think exploring various options for turning it on explicitly can be explored, be it a method-per-crate or something like an env var. It would always be opt-in, however. |
Opt in is obviously the right choice. Currently with my testing the biggest problems are making sure the llvm version matches and that it's using the correct linker. |
Like rustc, clang uses LLVM. I think that therefore it should be possible to inline functions from the clang output into rustc output using LLVM LTO. Would this be possible to implement?
The text was updated successfully, but these errors were encountered: