RFR: 8370438: Offer link time optimization support on library level
Julian Waters
jwaters at openjdk.org
Tue Oct 28 14:41:12 UTC 2025
On Fri, 24 Oct 2025 12:58:15 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> We currently have support for LTO (link time optimization) for Hotspot/libjvm, that can be enabled as a JVM feature.
> But for other JDK native libs, we do not have support for this feature.
> LTO and sometimes lead to faster and also in some cases smaller binaries, so support for this might be interesting also for other libs and not only libjvm.
It might be better if we offered this as an option to turn off and on through configure (My personal fork of the JDK has something along the lines of --enable-linktime-opt, can't remember the exact name) rather than making some native code have to use LTO. Additionally I also think this is better done similar to how HotSpot does it instead of adding LTO options as an exported Makefile variable and adding a new parameter to SetupNativeCompilation.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27976#issuecomment-3443306972
More information about the client-libs-dev
mailing list