-
-
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
[RDY] Add LTO support #8654
[RDY] Add LTO support #8654
Conversation
CMakeLists.txt
Outdated
| @@ -2,7 +2,7 @@ | |||
| # intro: https://codingnest.com/basic-cmake/ | |||
| # best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 | |||
|
|
|||
| cmake_minimum_required(VERSION 2.8.12) | |||
| cmake_minimum_required(VERSION 3.9) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to use 2.8.12? We need to be able to build on as many systems as possible.
|
@justinmk Updated. |
|
We tried LTO in #4313 , later reverted in mgraczyk@c2b2e0e . But it looks like you did something like what was discussed in #4313 (comment) , which was never tried. @mhinz @Yamakaky @ZyX-I @jamessan @jszakmeister any comments/objections? AppVeyor build had some weird failures; restarted. |
|
The new CMake policy CMP0069 has much better LTO support for compilers other than intel. It was introduced in CMake 3.9. This patch only enables LTO if both the CMake and the compiler support LTO/CMP0069. |
|
What would be the exact advantage for Neovim? Is there a benchmark that shows an improvement in any way? Does anyone know how to check if Mach-O executable was compiled with LTO? (clang or gcc) |
The same sorts of advantages that come from compiling with
There's no marker for the compiler using LTO. It's sort of doing another compilation pass but with all of the intermediate files available, which is why the linker needs the same optimization flags as the original compile. |
|
As a semi-related note, in my little rust project adding lto has had a pretty serious performance impact. Benchmarks would be best, of course. |
|
Ah, okay. I read that gcc added a Best answer I found: https://stackoverflow.com/questions/51048414/clang-how-to-check-if-lto-was-performed Well, LGTM. |
|
MINGW_64 build failed. Restarted. If it fails again, @zhou13 can you try disabling LTO for mingw (by default)? |
|
MINGW_64 build seems to be OK. Failed on test. |
|
Restarted AppVeyor again. It's very unusual for the AppVeyor build to fail, so I'm hesitant to merge this until it succeeds. Can you try disabling LTO for mingw, to see if that allows appveyor to succeed? |
|
Seems that Mingw32 passed while Mingw64 failed with a bunch of "plugin needed to handle lto object" errors. |
|
@ZviRackover Thanks for finding the clues! @justinmk Should I just disable LTO for mingw, or add put the LTO plugin into the bfd-plugins directory? I don't think I can change the appveyor's CI. |
Let's do that for now. Just add a one-line comment above the line in CMakeLists.txt, something like this: ( https://github.com/Alexpux/MINGW-packages/issues/3516 has better info than the SO post. ) |
|
Updated. Waiting for the CI. |
No description provided.