-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-132257: Remove -flto-partition=none for Linux LTO builds #132258
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
Conversation
I just want to check that it’s the compatible with old gcc too? |
How old are we talking about? I dont know the performance on ancient gcc, but I tested on the faster cpython machines which purportedly uses gcc 9 and 11, and it had no significant slowdown. GCC 9 was released in 2019 (6 years old by now). Ancient gcc night have some perf loss, but if thats the case we should not backport this so it releases with 3.14 and distros that use it will be new and bundle new gcc. |
Ah apparently flyo=auto is only gcc 10 and above. Good catch! I will try to guard this on gcc version |
Alternatively i can just remove the auto since that is the default behaviiot apparently https://www.phoronix.com/news/GCC-10-LTO-flto-Available-Cores |
IIRC we should consider gcc that supports C11. |
Can you please include the news item's text in the PR description/commit message? That way it's much easier to see what a change meant to do when looking at commit messages. |
First version of GCC to support C11 is 4-5ish. First version that seems to work with |
@corona10 ok I pushed a commit to support older compilers by not turning on the flag if it detects GCC 7 or below. |
I will take a look at ths PR by today :) Sorry for the delay. |
This comment was marked as resolved.
This comment was marked as resolved.
Buildbot compilation times for
Clearly a sample size of N=1, but encouraging results! A |
This comment was marked as resolved.
This comment was marked as resolved.
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.
Thank you. Overall, I'm quite happy to see -flto-partition dropped. I do have a small nit though.
@corona10 note that this might expose more concurrency problems in our makefile. As apparently the previous makefile did not respect jobserver, so was not parallelising stuff properly! |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@eli-schwartz or @thesamesam can you please check out if this speeds up CPython LTO build times on Gentoo with newer GNU make? I tried building make from source on Ubuntu 22.04 but apparently the autoconf on there is 2.71 which is too old to build GNU make from source. https://launchpad.net/ubuntu/+source/autoconf |
Sure, will try, but FWIW, the GNU Make release tarballs should already be autoreconf'd, so only need to run ./configure in those. |
A thanks Sam I pulled from source not the tarball. Will try again. |
Ok can confirm this works wonderfully with GNU make |
Make-only, with the patch,
Without the patch:
GNU Make from source only requires autoconf 2.69 anyway. (Notwithstanding what Sam said about the release tarball). |
|
Change the default LTO flags on GCC to not pass
-flto-partition=none
, and allow parallelization of LTO. This has a multiple factor speedup for LTO build times on GCC, with no noticeable loss in performance.On newer make and newer GCC, this passes the jobserver automatically to GCC (or more like GCC grabs it from the env vars).
On older make, this will have benign warnings about serial compilation. It's safe to ignore them.