RFR: 8345265: Minor improvements for LTO across all compilers [v2]

Matthias Baesken mbaesken at openjdk.org
Wed Oct 22 14:17:43 UTC 2025


On Mon, 20 Oct 2025 21:08:52 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> > So should we still offer LTO for more libs as an option to enable for the lib, even with the mentioned issues?
> 
> Provide an option for library owners to opt-in, which can be enabled per-library, per-platform and per-compiler after appropriate testing for performance, functionality, and footprint. So it will be possible to mix size/perf and lto optimizations. Then later we can decide what to use by default.

Yeah, maybe something like

LINK_TIME_OPTIMIZATION := YES

that can be set by lib owners and passed as an optional parameter to  SetupJdkLibrary / SetupNativeCompilation or similar.
We just need the lto settings per toolchain in 'make/autoconf'  (probably the c/cxx/ld flags can be borrowed from Hotspot where the functionality was available for some time as a configurable 'JVMFeature') , and in case LINK_TIME_OPTIMIZATION was set for a lib, we have to add them in a proper way.
(On the other hand, we need some LIB owners testing and hopefully using it, otherwise the new functionality just rots in the m4-files)

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

PR Comment: https://git.openjdk.org/jdk/pull/22464#issuecomment-3432544610


More information about the build-dev mailing list