Skip to content
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

Add LTO for OpenJDK #107

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Add LTO for OpenJDK #107

merged 2 commits into from
Jan 5, 2024

Conversation

ventureoo
Copy link
Member

OpenJDK officially supports building with LTO from Java 9 and up (https://bugs.openjdk.org/browse/JDK-8292226), but it is disabled by default for all architectures except ARM, and unlike other packages, enabling it via options=(lto) causes build errors (See similar bug in Gentoo - https://bugs.gentoo.org/833098). Instead, LTO optimizations should be enabled via a special flag --with-jvm-features=link-time-opt. The LTO flag has been used for OpenJDK in Gentoo for a long time, so I think we can add it to ours as well.

@ventureoo
Copy link
Member Author

JDK 11 doesn't seem to be very buildable with LTO. So I'll have to drop it. Debian has already done the same thing (https://metadata.ftp-master.debian.org/changelogs//main/o/openjdk-11/openjdk-11_11.0.21+9-1~deb11u1_changelog, yes they build OpenJDK with LTO too).

@ventureoo ventureoo marked this pull request as ready for review January 5, 2024 11:49
@ventureoo ventureoo requested a review from ptr1337 January 5, 2024 11:49
@ptr1337 ptr1337 merged commit 2313037 into CachyOS:master Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants