RFR: 8304893: Link Time Optimization with gcc can be faster [v4]

Erik Joelsson erikj at openjdk.org
Mon Apr 3 13:14:12 UTC 2023


On Sun, 2 Apr 2023 06:59:02 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> A previous argument against link time optimization support that we have for gcc is that it was extremely slow. After some checks it turns out we are passing rather inefficient flags to gcc in optimized builds. Changing these flags to run the linker optimizations in parallel and passing additional flags to the compiler have the ability to speed this process up significantly. Also fixes some incorrect flags passed to ld for linking as well, since strict-aliasing is required for both linker and compiler, and the same optimization level should be specified instead of letting the default -O1 be passed to the linker
>
> Julian Waters has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Should auto detect cores as a safer fallback

You made a change to the patch just before integrating, on a weekend when most reviewers aren't paying attention. I would probably have argued against that change, as the JOBS setting reflects the concurrency the user has requested, which may very well be less than the number of available hardware threads in the system. I will most likely never use this feature, so it's not important enough to change it back to warrant another bug/PR/review. This is more about the principle of integrating the code as reviewed.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13180#issuecomment-1494300072



More information about the build-dev mailing list