On Mon, 20 Oct 2025 21:08:52 GMT, Sergey Bylokhov <[email protected]> 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

Reply via email to