dev-java/openjdk: force gcc for openjdk 8

despite we have workaround "-std=gnu++14", but openjdk 8 doesn't fully
respect CXXFLAGS in various places and that patching that in now is a bit
risky given JDK 8 is so old.

e.g., see hotspot/make/linux/makefiles/adlc.make, CXXFLAGS defined by:

61 # set flags for adlc compilation
62 CXXFLAGS = $(SYSDEFS) $(INCLUDES)
63
64 # Force assertions on.
65 CXXFLAGS += -DASSERT

Bug: https://bugs.gentoo.org/918655
Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40746
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Z. Liu
2025-02-25 14:27:32 +08:00
committed by Sam James
parent d682a75978
commit 2c9bffc2f3

View File

@@ -96,6 +96,7 @@ DEPEND="
BDEPEND="
virtual/pkgconfig
sys-devel/gcc:*
"
PDEPEND="javafx? ( dev-java/openjfx:${SLOT} )"
@@ -156,6 +157,15 @@ src_prepare() {
hotspot/make/linux/makefiles/gcc.make || die
chmod +x configure || die
# Force gcc because build failed with modern clang, #918655
if ! tc-is-gcc; then
ewarn "openjdk/8 can be built with gcc only."
ewarn "Ignoring CC=$(tc-getCC) and forcing ${CHOST}-gcc"
export CC=${CHOST}-gcc
export CXX=${CHOST}-g++
tc-is-gcc || die "tc-is-gcc failed in spite of CC=${CC}"
fi
}
src_configure() {