dev-java/openjdk: drop USE=lto, use tc-is-lto instead

As we've done in other packages, migrate away from USE=lto towards
tc-is-lto so users enable via -flto in *FLAGS.

This doesn't fix/workaround bug #960257 but it does make it very easy
for us to add such a workaround later.

Bug: https://bugs.gentoo.org/960257
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2025-07-28 06:54:25 +01:00
parent d023c6d5ed
commit 962499a101
10 changed files with 76 additions and 80 deletions

View File

@@ -55,7 +55,7 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
KEYWORDS="amd64 ~arm arm64 ppc64 ~riscv x86"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap lto selinux source system-bootstrap systemtap"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source system-bootstrap systemtap"
REQUIRED_USE="
javafx? ( alsa !headless-awt )
@@ -161,6 +161,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if ! use system-bootstrap; then
local xpakvar="${ARCH^^}_XPAK"
export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}"
@@ -175,9 +177,9 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -188,7 +190,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--enable-full-docs=no
@@ -218,8 +220,6 @@ src_configure() {
)
! use riscv && myconf+=( --with-jvm-features=shenandoahgc )
use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
# this is not useful for users, just for upstream developers
# build system compares mesa version in md file

View File

@@ -55,7 +55,7 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap lto selinux source system-bootstrap systemtap"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source system-bootstrap systemtap"
REQUIRED_USE="
javafx? ( alsa !headless-awt )
@@ -161,6 +161,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if ! use system-bootstrap; then
local xpakvar="${ARCH^^}_XPAK"
export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}"
@@ -175,9 +177,9 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -188,7 +190,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--enable-full-docs=no
@@ -218,8 +220,6 @@ src_configure() {
)
! use riscv && myconf+=( --with-jvm-features=shenandoahgc )
use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
# this is not useful for users, just for upstream developers
# build system compares mesa version in md file

View File

@@ -55,7 +55,7 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
KEYWORDS="amd64 ~arm arm64 ppc64 ~riscv x86"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap lto selinux source system-bootstrap systemtap"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source system-bootstrap systemtap"
REQUIRED_USE="
javafx? ( alsa !headless-awt )
@@ -167,6 +167,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if has_version dev-java/openjdk:${SLOT}; then
export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT}
elif use !system-bootstrap ; then
@@ -189,9 +191,9 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -199,7 +201,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--disable-warnings-as-errors
@@ -229,8 +231,6 @@ src_configure() {
$(tc-is-clang && echo "--with-toolchain-type=clang")
)
use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then

View File

@@ -55,7 +55,7 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap lto selinux source system-bootstrap systemtap"
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source system-bootstrap systemtap"
REQUIRED_USE="
javafx? ( alsa !headless-awt )
@@ -167,6 +167,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if has_version dev-java/openjdk:${SLOT}; then
export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT}
elif use !system-bootstrap ; then
@@ -189,9 +191,9 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -199,7 +201,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--disable-warnings-as-errors
@@ -229,8 +231,6 @@ src_configure() {
$(tc-is-clang && echo "--with-toolchain-type=clang")
)
use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then

View File

@@ -51,7 +51,6 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
KEYWORDS="amd64 arm64 ppc64 ~riscv ~x86"
# lto temporarily disabled due to https://bugs.gentoo.org/916735
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap"
REQUIRED_USE="
@@ -165,6 +164,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if has_version dev-java/openjdk:${SLOT}; then
export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT}
elif use !system-bootstrap ; then
@@ -187,9 +188,12 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
#
# .. but because of -Werror=odr (bug #916735), we disable it
# entirely for now.
#tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -197,7 +201,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--disable-warnings-as-errors
@@ -230,12 +234,6 @@ src_configure() {
use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" )
# Werror=odr
# https://bugs.gentoo.org/916735
#
# Disable it for now.
#use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then

View File

@@ -51,7 +51,6 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
# lto temporarily disabled due to https://bugs.gentoo.org/916735
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap"
REQUIRED_USE="
@@ -165,6 +164,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if has_version dev-java/openjdk:${SLOT}; then
export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT}
elif use !system-bootstrap ; then
@@ -187,9 +188,12 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
#
# .. but because of -Werror=odr (bug #916735), we disable it
# entirely for now.
#tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -197,7 +201,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--disable-warnings-as-errors
@@ -230,12 +234,6 @@ src_configure() {
use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" )
# Werror=odr
# https://bugs.gentoo.org/916735
#
# Disable it for now.
#use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then

View File

@@ -52,7 +52,6 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
# KEYWORDS="" # LTS but not yet released
# lto temporarily disabled due to https://bugs.gentoo.org/916735
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap"
REQUIRED_USE="
@@ -166,6 +165,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if has_version dev-java/openjdk:${SLOT}; then
export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT}
elif use !system-bootstrap ; then
@@ -185,9 +186,12 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
#
# .. but because of -Werror=odr (bug #916735), we disable it
# entirely for now.
#tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -195,7 +199,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--disable-warnings-as-errors
@@ -228,12 +232,6 @@ src_configure() {
use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" )
# Werror=odr
# https://bugs.gentoo.org/916735
#
# Disable it for now.
#use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then

View File

@@ -52,7 +52,6 @@ LICENSE="GPL-2-with-classpath-exception"
SLOT="${MY_PV%%[.+]*}"
# KEYWORDS="" # Not an LTS candidate
# lto temporarily disabled due to https://bugs.gentoo.org/916735
IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap"
REQUIRED_USE="
@@ -167,6 +166,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if has_version dev-java/openjdk:25; then
export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-25
elif has_version dev-java/openjdk:${SLOT}; then
@@ -188,9 +189,12 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, we rely on USE=lto and --with-jvm-features=link-time-opt
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
#
# .. but because of -Werror=odr (bug #916735), we disable it
# entirely for now.
#tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -198,7 +202,7 @@ src_configure() {
# explicitly disabled, the flag will get auto-enabled if pandoc and
# graphviz are detected. pandoc has loads of dependencies anyway.
local myconf=(
myconf+=(
--disable-ccache
--disable-precompiled-headers
--disable-warnings-as-errors
@@ -231,12 +235,6 @@ src_configure() {
use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" )
# Werror=odr
# https://bugs.gentoo.org/916735
#
# Disable it for now.
#use lto && myconf+=( --with-jvm-features=link-time-opt )
if use javafx; then
local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then

View File

@@ -172,6 +172,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if ! use system-bootstrap; then
local xpakvar="${ARCH^^}_XPAK"
export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}"
@@ -189,9 +191,9 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, no support in this version.
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -200,7 +202,7 @@ src_configure() {
tc-export_build_env CC CXX PKG_CONFIG STRIP
local myconf=(
myconf+=(
--disable-ccache
--disable-freetype-bundling
--disable-precompiled-headers

View File

@@ -172,6 +172,8 @@ src_prepare() {
}
src_configure() {
local myconf=()
if ! use system-bootstrap; then
local xpakvar="${ARCH^^}_XPAK"
export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}"
@@ -189,9 +191,9 @@ src_configure() {
# Strip some flags users may set, but should not. #818502
filter-flags -fexceptions
# Strip lto related flags, no support in this version.
# https://bugs.gentoo.org/833097
# https://bugs.gentoo.org/833098
# Strip lto related flags, we rely on --with-jvm-features=link-time-opt
# See bug #833097 and bug #833098.
tc-is-lto && myconf+=( --with-jvm-features=link-time-opt )
filter-lto
filter-flags -fdevirtualize-at-ltrans
@@ -200,7 +202,7 @@ src_configure() {
tc-export_build_env CC CXX PKG_CONFIG STRIP
local myconf=(
myconf+=(
--disable-ccache
--disable-freetype-bundling
--disable-precompiled-headers