diff options
Diffstat (limited to 'dev-java/openj9-openjdk')
-rw-r--r-- | dev-java/openj9-openjdk/Manifest | 8 | ||||
-rw-r--r-- | dev-java/openj9-openjdk/files/omr-fam.patch | 70 | ||||
-rw-r--r-- | dev-java/openj9-openjdk/files/openj9-no-o3.patch | 11 | ||||
-rw-r--r-- | dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch | 11 | ||||
-rw-r--r-- | dev-java/openj9-openjdk/files/openj9-openjdk.env.sh | 3 | ||||
-rw-r--r-- | dev-java/openj9-openjdk/metadata.xml | 14 | ||||
-rw-r--r-- | dev-java/openj9-openjdk/openj9-openjdk-11.0.48.0.ebuild (renamed from dev-java/openj9-openjdk/openj9-openjdk-16.0.27.1.ebuild) | 150 | ||||
-rw-r--r-- | dev-java/openj9-openjdk/openj9-openjdk-21.0.48.0.ebuild (renamed from dev-java/openj9-openjdk/openj9-openjdk-11.0.27.1.ebuild) | 161 |
8 files changed, 183 insertions, 245 deletions
diff --git a/dev-java/openj9-openjdk/Manifest b/dev-java/openj9-openjdk/Manifest index 89d0bef..533a846 100644 --- a/dev-java/openj9-openjdk/Manifest +++ b/dev-java/openj9-openjdk/Manifest @@ -1,4 +1,4 @@ -DIST openj9-0.27.1.tar.gz 16668711 BLAKE2B 091047b3770d86b652042b49f419c4d4597bb13630b853223a909fa0a135b0252d280e9ba2f1735c9f1c02dceb33a997e7906464d83669cd20d7993766ac46fc SHA512 1ba28787cf92eafb0e789ecac33b0f772bea6d4856f6120befe9c1928a8dcac04569808b053209fafa09a097c32fd3eed2c6c7137250a4e8b6cb96d37e4eec4e -DIST openj9-omr-0.27.1.tar.gz 7815053 BLAKE2B 97d4481dbcd8643e95e2ff50b873f1018c297dff0140207c3352ba5c5395092d21a1b2abcb5796f4d96daf4635f3a86cf76fab8376457fca7f8d1f4692ff9b03 SHA512 980d13ad900aec0d644058f3738f53b29467f4fbda03a2094ccceaa34955e79165002dc2d441af0fe878b523f62b15d315375dea2d5fa57942b5d1509e7afbbd -DIST openj9-openjdk-jdk11-openj9-0.27.1.tar.gz 108889106 BLAKE2B 32260d462fd1daab077cd72f5bd16ae793309d1efa930dcc5cbb2c56b1fc33194f93a4aaef904b23c9a6d16b0206042fbd3a1bc812005e2d115a3f5564849b6f SHA512 a33d0382c4a13cc608341715214c52ef3a81d8476291c078f6a808ebd0674b5f6153645fbd61ec818298e8e82d962b92107b73be67d3ab2610bbbae06804c28b -DIST openj9-openjdk-jdk16-openj9-0.27.1.tar.gz 90946973 BLAKE2B 6e06d96e74b8201fbec23eca14329b13f2a828a0abc6b29658a0b84af927f04142d2f9fd7810e93a00ab6d99e8bc71d38c21fc4bc26eb334166d596567b0f51b SHA512 c170ded18e3f1a41b3cc83d8d16202b4debdcd3d2fa4fbca7ce2c78be1d3d3fa8bc0d466b0a280b7c63a1161e3f50ece3b468096876a61e0cdb999d402895e06 +DIST openj9-0.48.0.tar.gz 18480709 BLAKE2B 4d3d593ce295c0ba40ef32cc79f0e00b4864d2bc5d36e26c0bd0e2c3aa3406888e8a764472c212ff45ab59d092055e9e9775231fd8d979643d91d022911bd147 SHA512 28247eb763056becf881f1a3f431a073f4605d062e26bfc30a8cad86cab7b7a9a114a44faff40743957315d808a42ff7636554ff794dac640578ec75e9328749 +DIST openj9-omr-0.48.0.tar.gz 8126272 BLAKE2B d343b0129d639cd2887c98fe64b92c66ff2932537520158faa2dbaa465cfb32d6ff0c5c7bf0a5591a8f57e25f85cfc1a85f34c7f6bd9f07e04a35d5b50eb09f7 SHA512 090aee202bb7dd46fcc93f94a7168d22f3b2546d86456d40ba12aba7d76699345502aafc25ca5b675ba7683cfa2414564113c91ba31ad720d1f6867d63f70aab +DIST openj9-openjdk-jdk11-openj9-0.48.0.tar.gz 102800187 BLAKE2B 82a04892e389a5e24c59a17d2efa95a37e092480dfbbf89f47da965179aaead0b56c1cbe26efcd905bfeb018667880faf077e410bf0d689a1b99178acf398fb4 SHA512 9288f83706aeb945a479b4478b365911408a92ac703f43418f3f98fc1beaefb008c8d0b46dd055200122a9d549da89cd727a2eef8598b7ba069cf36055d1207d +DIST openj9-openjdk-jdk21-openj9-0.48.0.tar.gz 100484633 BLAKE2B c23d1325c8db43a7076cc589ea0a485cae2d0d26668f8da5cb2a2db2cc6b43052a7e848d04e7c66f03f7696a19690a0812f9aff92deedf7c426ede03b9aa36c7 SHA512 5b4a390c53643ee10affd5b0c6277f5ac6be873f34035c28fb7b75fca04f9e08e91b66ed505e8a5c0eb114f0cf00d6af2bb8c42f2495e3b6913cc253a7969836 diff --git a/dev-java/openj9-openjdk/files/omr-fam.patch b/dev-java/openj9-openjdk/files/omr-fam.patch deleted file mode 100644 index 9141ec1..0000000 --- a/dev-java/openj9-openjdk/files/omr-fam.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/ddr/tools/blob_reader/blob_reader.cpp b/ddr/tools/blob_reader/blob_reader.cpp -index 028decd0c..a0212609f 100644 ---- a/ddr/tools/blob_reader/blob_reader.cpp -+++ b/ddr/tools/blob_reader/blob_reader.cpp -@@ -85,7 +85,7 @@ struct BlobHeaderV1 { - - struct BlobString { - uint16_t length; -- char data[1]; /* flexible array member */ -+ char data[]; - - void endian_swap() - { -diff --git a/include_core/ute_core.h b/include_core/ute_core.h -index 8b3b1c65d..330ea52c6 100644 ---- a/include_core/ute_core.h -+++ b/include_core/ute_core.h -@@ -125,7 +125,7 @@ typedef struct UtTraceRecord { - uint64_t threadSyn2; /* Thread synonym 2 */ - int32_t firstEntry; /* Offset to first trace entry */ - int32_t nextEntry; /* Offset to next entry */ -- char threadName[1]; /* Thread name */ -+ char threadName[]; /* Thread name */ - } UtTraceRecord; - - /* -diff --git a/include_core/ute_dataformat.h b/include_core/ute_dataformat.h -index 71d9e36ad..8a9dcb487 100644 ---- a/include_core/ute_dataformat.h -+++ b/include_core/ute_dataformat.h -@@ -180,7 +180,7 @@ typedef struct UtProcSection { - #define UT_TRACE_ACTIVE_SECTION_NAME "UTTA" - typedef struct UtActiveSection { - UtDataHeader header; /* Eyecatcher, version etc */ -- char active[1]; /* Trace activation commands */ -+ char active[]; /* Trace activation commands */ - } UtActiveSection; - - /* -@@ -191,7 +191,7 @@ typedef struct UtActiveSection { - #define UT_TRACE_SERVICE_SECTION_NAME "UTSS" - typedef struct UtServiceSection { - UtDataHeader header; /* Eyecatcher, version etc */ -- char level[1]; /* Service level info */ -+ char level[]; /* Service level info */ - } UtServiceSection; - - /* -@@ -202,7 +202,7 @@ typedef struct UtServiceSection { - #define UT_TRACE_STARTUP_SECTION_NAME "UTSO" - typedef struct UtStartupSection { - UtDataHeader header; /* Eyecatcher, version etc */ -- char options[1]; /* Startup options */ -+ char options[]; /* Startup options */ - } UtStartupSection; - - /* -diff --git a/omrtrace/omrtrace_internal.h b/omrtrace/omrtrace_internal.h -index e52347eac..a68a88abd 100644 ---- a/omrtrace/omrtrace_internal.h -+++ b/omrtrace/omrtrace_internal.h -@@ -157,7 +157,7 @@ typedef struct OMR_TraceGlobal OMR_TraceGlobal; - typedef struct UtTraceCfg { - UtDataHeader header; - struct UtTraceCfg *next; /* Next trace config command */ -- char command[1]; /* Start of variable length section */ -+ char command[]; /* Start of variable length section */ - } UtTraceCfg; - - typedef struct UtDeferredConfigInfo { diff --git a/dev-java/openj9-openjdk/files/openj9-no-o3.patch b/dev-java/openj9-openjdk/files/openj9-no-o3.patch index 63d1dcf..b332052 100644 --- a/dev-java/openj9-openjdk/files/openj9-no-o3.patch +++ b/dev-java/openj9-openjdk/files/openj9-no-o3.patch @@ -1,11 +1,10 @@ -diff -ru a/runtime/cmake/platform/toolcfg/gnu.cmake b/runtime/cmake/platform/toolcfg/gnu.cmake ---- a/runtime/cmake/platform/toolcfg/gnu.cmake 2021-07-20 17:24:52.000000000 -0400 -+++ b/runtime/cmake/platform/toolcfg/gnu.cmake 2021-08-07 09:46:15.685325927 -0400 +--- a/runtime/cmake/platform/toolcfg/gnu.cmake ++++ b/runtime/cmake/platform/toolcfg/gnu.cmake @@ -20,7 +20,6 @@ # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception ################################################################################ -list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -O3 -g -fstack-protector) - list(APPEND OMR_PLATFORM_C_COMPILE_OPTIONS -Wimplicit -Wreturn-type) - list(APPEND OMR_PLATFORM_CXX_COMPILE_OPTIONS -fno-threadsafe-statics) - + if(OMR_DDR AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 11)) + # In gcc 11+ the default is to use DWARF version 5 which is not yet + # supported by ddrgen: tell the compiler to use DWARF version 4. diff --git a/dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch b/dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch new file mode 100644 index 0000000..1652627 --- /dev/null +++ b/dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch @@ -0,0 +1,11 @@ +--- a/closed/OpenJ9.gmk ++++ b/closed/OpenJ9.gmk +@@ -44,7 +44,7 @@ + # $4 - 'required' for a required repository, anything else for an optional one + GetVersion = $(eval $(call GetVersionHelper,$(strip $1),$(strip $2),$(strip $3),$(strip $4))) + define GetVersionHelper +- $2 := $$(if $(wildcard $3),$$(shell $(GIT) -C $3 rev-parse --short HEAD)) ++ $2 := $$(if $$($2),$$($2),$$(if $(wildcard $3),$$(shell $(GIT) -C $3 rev-parse --short HEAD))) + ifneq (,$$($2)) + VersionLabelWidth := $(shell $(ECHO) "$1" | $(AWK) "{ width = length; print (width > $(VersionLabelWidth) ? width : $(VersionLabelWidth)) }") + VersionPairs += "$1" "$$($2)" diff --git a/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh b/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh index 5aac9c7..8d0d130 100644 --- a/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh +++ b/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh @@ -1,6 +1,3 @@ -# Copyright 1999-2018 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - VERSION="OpenJDK ${SLOT} with OpenJ9 ${OPENJ9_PV}" JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}" JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}" diff --git a/dev-java/openj9-openjdk/metadata.xml b/dev-java/openj9-openjdk/metadata.xml index 50669cc..dadf469 100644 --- a/dev-java/openj9-openjdk/metadata.xml +++ b/dev-java/openj9-openjdk/metadata.xml @@ -1,19 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <longdescription> - Java™ is the world's leading programming language and platform. - The code for Java is open source and available at OpenJDK™. - </longdescription> - <slots> - <slot name="11">Java™ version 11</slot> - </slots> + <maintainer type="person"> + <email>alex_y_xu@yahoo.ca</email> + <name>Alex Xu (Hello71)</name> + </maintainer> <use> <flag name="ddr">Enable Direct Dump Reader</flag> <flag name="headless-awt">Don't install the X backend for AWT, needed by some GUIs</flag> - <flag name="gentoo-vm">Allow this JDK to be recognised by Gentoo (package manager, eselect, java-config, EXPERIMENTAL!)</flag> <flag name="javafx">Import OpenJFX modules at build time, via <pkg>dev-java/openjfx</pkg></flag> <flag name="jbootstrap">Build OpenJDK twice, the second time using the result of the first</flag> + <flag name="jitserver">OpenJ9 JITServer support</flag> + <flag name="numa">Enable NUMA support using sys-process/numactl (NUMA kernel support is also required)</flag> <flag name="systemtap">Enable SystemTAP/DTrace tracing</flag> </use> </pkgmetadata> diff --git a/dev-java/openj9-openjdk/openj9-openjdk-16.0.27.1.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-11.0.48.0.ebuild index 12447f2..4e7eb58 100644 --- a/dev-java/openj9-openjdk/openj9-openjdk-16.0.27.1.ebuild +++ b/dev-java/openj9-openjdk/openj9-openjdk-11.0.48.0.ebuild @@ -1,17 +1,16 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=8 -inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs versionator +inherit check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing toolchain-funcs -SLOT="$(get_major_version)" -OPENJ9_PV="$(get_version_component_range 2-4)" +SLOT="$(ver_cut 1)" +OPENJ9_PV="$(ver_cut 2-4)" OPENJ9_P=openj9-${OPENJ9_PV} -FREEMARKER_PV=2.3.30 -DESCRIPTION="Open source implementation of the Java programming language" -HOMEPAGE="https://openjdk.java.net" +DESCRIPTION="Extensions for OpenJDK for Eclipse OpenJ9" +HOMEPAGE="https://www.eclipse.org/openj9/" if [[ ${OPENJ9_PV} == 9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}.git" @@ -19,16 +18,20 @@ if [[ ${OPENJ9_PV} == 9999 ]]; then OPENJ9_OMR_EGIT_REPO_URI="https://github.com/eclipse/openj9-omr.git" else SRC_URI=" - https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/v${OPENJ9_PV}-release.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz - https://github.com/eclipse/openj9/archive/${OPENJ9_P}.tar.gz -> ${OPENJ9_P}.tar.gz + https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/${OPENJ9_P}.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz + https://github.com/eclipse/openj9/archive/${OPENJ9_P}.tar.gz https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz " fi -LICENSE="GPL-2" +LICENSE="GPL-2-with-classpath-exception" KEYWORDS="~amd64" -IUSE="alsa cups ddr debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap" +IUSE="alsa cups ddr debug doc headless-awt javafx +jbootstrap jitserver numa selinux source systemtap" + +REQUIRED_USE=" + javafx? ( alsa !headless-awt ) +" COMMON_DEPEND=" media-libs/freetype:2= @@ -37,12 +40,12 @@ COMMON_DEPEND=" media-libs/libpng:0= media-libs/lcms:2= sys-libs/zlib - virtual/jpeg:0= - systemtap? ( dev-util/systemtap ) + media-libs/libjpeg-turbo:0= + systemtap? ( dev-debug/systemtap ) dev-libs/elfutils - dev-libs/libdwarf - sys-process/numactl + ddr? ( dev-libs/libdwarf ) + numa? ( sys-process/numactl ) " # Many libs are required to build, but not to run, make is possible to remove @@ -80,18 +83,14 @@ DEPEND=" x11-libs/libXtst javafx? ( dev-java/openjfx:${SLOT}= ) || ( - virtual/jdk:${SLOT} - virtual/jdk:$((SLOT-1)) + dev-java/openj9-openjdk-bin:${SLOT} + dev-java/openj9-openjdk:${SLOT} + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} ) " -REQUIRED_USE="javafx? ( alsa !headless-awt )" - -if [[ ${OPENJ9_PV} == 9999 ]]; then - S="${WORKDIR}/openj9-openjdk-jdk${SLOT}" -else - S="${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_PV}-release" -fi +S="${WORKDIR}/${PN}-jdk${SLOT}-${OPENJ9_P}" # The space required to build varies wildly depending on USE flags, # ranging from 3GB to 16GB. This function is certainly not exact but @@ -110,13 +109,23 @@ pkg_pretend() { openjdk_check_requirements if [[ ${MERGE_TYPE} != binary ]]; then has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876" - [[ $(gcc-major-version) == 11 ]] && die "gcc 11 hangs when optimizing exploded image" + + if use jitserver && tc-is-clang; then + die "jitserver does not compile with clang" + fi fi } pkg_setup() { openjdk_check_requirements java-vm-2_pkg_setup + + [[ ${MERGE_TYPE} == "binary" ]] && return + + JAVA_PKG_WANT_BUILD_VM="openj9-openjdk-${SLOT} openj9-openjdk-bin-${SLOT} openjdk-${SLOT} openjdk-bin-${SLOT}" + JAVA_PKG_WANT_SOURCE="${SLOT}" + JAVA_PKG_WANT_TARGET="${SLOT}" + java-pkg-2_pkg_setup } @@ -142,31 +151,37 @@ src_prepare() { default + eapply -- "${FILESDIR}/openj9-openjdk-override-version.patch" eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" - eapply -d omr -- "${FILESDIR}/omr-fam.patch" - if [[ ${OPENJ9_PV} != 9999 ]]; then - sed -i -e '/^OPENJDK_SHA :=/s/:=.*/:= __OPENJDK_SHA__/' \ - -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - closed/OpenJ9.gmk - fi + find openj9/ omr/ -name CMakeLists.txt -exec sed -i -e '/set(OMR_WARNINGS_AS_ERRORS ON/s/ON/OFF/' {} + || die + sed -i -e '/^ OPENJ9_CONFIGURE_NUMA$/d' closed/autoconf/custom-hook.m4 || die chmod +x configure || die } src_configure() { - # Work around stack alignment issue, bug #647954. in case we ever have x86 + # Work around stack alignment issue, bug #647954. use x86 && append-flags -mincoming-stack-boundary=2 + # 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 + filter-lto + filter-flags -fdevirtualize-at-ltrans + # Enabling full docs appears to break doc building. If not # explicitly disabled, the flag will get auto-enabled if pandoc and # graphviz are detected. pandoc has loads of dependencies anyway. local myconf=( --disable-ccache + --disable-precompiled-headers + --disable-warnings-as-errors{,-omr,-openj9} --enable-full-docs=no --with-boot-jdk="${JDK_HOME}" --with-extra-cflags="${CFLAGS}" @@ -186,19 +201,25 @@ src_configure() { --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" --with-vendor-version-string="${PVR}" --with-version-pre="" - --with-version-opt="" --with-zlib=system --enable-dtrace=$(usex systemtap yes no) --enable-headless-only=$(usex headless-awt yes no) $(tc-is-clang && echo "--with-toolchain-type=clang") - --disable-warnings-as-errors{,-omr,-openj9} --with-cmake $(use_enable ddr) + $(use_enable jitserver) ) + use lto && myconf+=( --with-jvm-features=link-time-opt ) + if use javafx; then - local zip="${EPREFIX%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" + # this is not useful for users, just for upstream developers + # build system compares mesa version in md file + # https://bugs.gentoo.org/822612 + export LEGAL_EXCLUDES=mesa3d.md + + local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" if [[ -r ${zip} ]]; then myconf+=( --with-import-modules="${zip}" ) else @@ -206,13 +227,6 @@ src_configure() { fi fi - # PaX breaks pch, bug #601016 - if use pch && ! host-is-pax; then - myconf+=( --enable-precompiled-headers ) - else - myconf+=( --disable-precompiled-headers ) - fi - ( unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS CFLAGS= CXXFLAGS= LDFLAGS= \ @@ -222,21 +236,37 @@ src_configure() { } src_compile() { + # Too brittle - gets confused by e.g. -Oline + export MAKEOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset GNUMAKEFLAGS MAKEFLAGS + + local mycmakeargsx=( + "-DCMAKE_C_FLAGS='${CFLAGS}'" + "-DJ9JIT_EXTRA_CFLAGS='${CFLAGS}'" + "-DCMAKE_CXX_FLAGS='${CXXFLAGS}'" + "-DJ9JIT_EXTRA_CXXFLAGS='${CXXFLAGS}'" + "-DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS}'" + -DOMR_WARNINGS_AS_ERRORS=OFF + -DOMR_PORT_NUMA_SUPPORT=$(usex numa) + ) local myemakeargs=( JOBS=$(makeopts_jobs) - # https://github.com/ibmruntimes/openj9-openjdk-jdk14/issues/72 - #LOG=debug + LOG=debug $(usex doc docs '') $(usex jbootstrap bootcycle-images product-images) - EXTRA_CMAKE_ARGS="-DOMR_WARNINGS_AS_ERRORS=OFF" + EXTRA_CMAKE_ARGS="${mycmakeargsx[*]}" + OPENJDK_SHA=$(ver_cut 1-3) + OPENJ9_SHA=${OPENJ9_P} + OPENJ9_TAG=${OPENJ9_P} + OPENJ9OMR_SHA=${OPENJ9_P} ) emake "${myemakeargs[@]}" -j1 #nowarn } src_install() { local dest="/usr/$(get_libdir)/${PN}-${SLOT}" - local ddest="${ED}${dest#/}" + local ddest="${ED}/${dest#/}" cd "${S}"/build/*-release/images/jdk || die @@ -251,10 +281,6 @@ src_install() { rm -v lib/libjsound.* || die fi - if ! use examples ; then - rm -vr demo/ || die - fi - if ! use source ; then rm -v lib/src.zip || die fi @@ -264,34 +290,22 @@ src_install() { dodir "${dest}" cp -pPR * "${ddest}" || die - dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + dosym8 -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts # must be done before running itself java-vm_set-pax-markings "${ddest}" - use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}.env.sh + java-vm_install-env "${FILESDIR}"/${PN}.env.sh java-vm_revdep-mask java-vm_sandbox-predict /dev/random /proc/self/coredump_filter if use doc ; then docinto html dodoc -r "${S}"/build/*-release/images/docs/* - dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" + dosym -r /usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" fi } pkg_postinst() { java-vm-2_pkg_postinst - - if use gentoo-vm ; then - ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK" - ewarn "recognised by the system. This will almost certainly break" - ewarn "many java ebuilds as they are not ready for openjdk-11" - else - ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK" - ewarn "will not be recognised by the system. For example, simply calling" - ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo" - ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its" - ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}." - fi } diff --git a/dev-java/openj9-openjdk/openj9-openjdk-11.0.27.1.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-21.0.48.0.ebuild index c9285f0..6bf8ca9 100644 --- a/dev-java/openj9-openjdk/openj9-openjdk-11.0.27.1.ebuild +++ b/dev-java/openj9-openjdk/openj9-openjdk-21.0.48.0.ebuild @@ -1,17 +1,16 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=8 -inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs versionator +inherit check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing toolchain-funcs -SLOT="$(get_major_version)" -OPENJ9_PV="$(get_version_component_range 2-4)" +SLOT="$(ver_cut 1)" +OPENJ9_PV="$(ver_cut 2-4)" OPENJ9_P=openj9-${OPENJ9_PV} -FREEMARKER_PV=2.3.30 -DESCRIPTION="Open source implementation of the Java programming language" -HOMEPAGE="https://openjdk.java.net" +DESCRIPTION="Extensions for OpenJDK for Eclipse OpenJ9" +HOMEPAGE="https://www.eclipse.org/openj9/" if [[ ${OPENJ9_PV} == 9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}.git" @@ -19,16 +18,20 @@ if [[ ${OPENJ9_PV} == 9999 ]]; then OPENJ9_OMR_EGIT_REPO_URI="https://github.com/eclipse/openj9-omr.git" else SRC_URI=" - https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/v${OPENJ9_PV}-release.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz + https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/${OPENJ9_P}.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz https://github.com/eclipse/openj9/archive/${OPENJ9_P}.tar.gz https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz " fi -LICENSE="GPL-2" +LICENSE="GPL-2-with-classpath-exception" KEYWORDS="~amd64" -IUSE="alsa cups ddr debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap" +IUSE="alsa cups ddr debug doc headless-awt javafx +jbootstrap jitserver lto numa selinux source systemtap" + +REQUIRED_USE=" + javafx? ( alsa !headless-awt ) +" COMMON_DEPEND=" media-libs/freetype:2= @@ -37,12 +40,12 @@ COMMON_DEPEND=" media-libs/libpng:0= media-libs/lcms:2= sys-libs/zlib - virtual/jpeg:0= - systemtap? ( dev-util/systemtap ) + media-libs/libjpeg-turbo:0= + systemtap? ( dev-debug/systemtap ) dev-libs/elfutils - dev-libs/libdwarf - sys-process/numactl + ddr? ( dev-libs/libdwarf ) + numa? ( sys-process/numactl ) " # Many libs are required to build, but not to run, make is possible to remove @@ -80,7 +83,6 @@ DEPEND=" x11-libs/libXtst javafx? ( dev-java/openjfx:${SLOT}= ) || ( - virtual/jdk:${SLOT} dev-java/openj9-openjdk-bin:${SLOT} dev-java/openj9-openjdk:${SLOT} dev-java/openjdk-bin:${SLOT} @@ -88,13 +90,7 @@ DEPEND=" ) " -REQUIRED_USE="javafx? ( alsa !headless-awt )" - -if [[ ${OPENJ9_PV} == 9999 ]]; then - S="${WORKDIR}/openj9-openjdk-jdk${SLOT}" -else - S="${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_P}" -fi +S="${WORKDIR}/${PN}-jdk${SLOT}-${OPENJ9_P}" # The space required to build varies wildly depending on USE flags, # ranging from 3GB to 16GB. This function is certainly not exact but @@ -113,7 +109,10 @@ pkg_pretend() { openjdk_check_requirements if [[ ${MERGE_TYPE} != binary ]]; then has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876" - [[ $(gcc-major-version) == 11 ]] && die "gcc 11 hangs when optimizing exploded image" + + if use jitserver && tc-is-clang; then + die "jitserver does not compile with clang" + fi fi } @@ -121,6 +120,8 @@ pkg_setup() { openjdk_check_requirements java-vm-2_pkg_setup + [[ ${MERGE_TYPE} == "binary" ]] && return + JAVA_PKG_WANT_BUILD_VM="openj9-openjdk-${SLOT} openj9-openjdk-bin-${SLOT} openjdk-${SLOT} openjdk-bin-${SLOT}" JAVA_PKG_WANT_SOURCE="${SLOT}" JAVA_PKG_WANT_TARGET="${SLOT}" @@ -135,31 +136,11 @@ pkg_setup() { local vm for vm in ${JAVA_PKG_WANT_BUILD_VM}; do - if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then + if [[ -d ${BROOT}/usr/lib/jvm/${vm} ]]; then java-pkg-2_pkg_setup return fi done - - if [[ ${MERGE_TYPE} != binary ]]; then - if [[ -z ${JDK_HOME} ]]; then - for slot in ${SLOT} $((SLOT-1)); do - for variant in openj9- ''; do - if has_version --host-root dev-java/${variant}openjdk:${slot}; then - JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${slot} - break - elif has_version --host-root dev-java/${variant}openjdk-bin:${slot}; then - JDK_HOME=$(best_version --host-root dev-java/${variant}openjdk-bin:${slot}) - JDK_HOME=${JDK_HOME#*/} - JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} - break - fi - done - done - fi - [[ -n ${JDK_HOME} ]] || die "Build VM not found!" - export JDK_HOME - fi } src_unpack() { @@ -184,30 +165,48 @@ src_prepare() { default + eapply -- "${FILESDIR}/openj9-openjdk-override-version.patch" eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" - eapply -d omr -- "${FILESDIR}/omr-fam.patch" - if [[ ${OPENJ9_PV} != 9999 ]]; then - sed -i -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - closed/OpenJ9.gmk - fi + find openj9/ omr/ -name CMakeLists.txt -exec sed -i -e '/set(OMR_WARNINGS_AS_ERRORS ON/s/ON/OFF/' {} + || die + sed -i -e '/^ OPENJ9_CONFIGURE_NUMA$/d' closed/autoconf/custom-hook.m4 || die chmod +x configure || die } src_configure() { + for variant in openj9- ''; do + if has_version dev-java/${variant}openjdk:${SLOT}; then + JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${SLOT} + break + elif has_version dev-java/${variant}openjdk-bin:${SLOT}; then + JDK_HOME=$(best_version dev-java/${variant}openjdk-bin:${SLOT}) + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + break + fi + done + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + export JDK_HOME + # Work around stack alignment issue, bug #647954. in case we ever have x86 use x86 && append-flags -mincoming-stack-boundary=2 + # /tmp/portage/dev-java/openj9-openjdk-21.0.48.0/work/openj9-openjdk-jdk21-openj9-0.48.0/openj9/runtime/codert_vm/thunkcrt.c:95: error: function 'icallVMprJavaSendVirtualL' redeclared as variable + # 95 | extern void * icallVMprJavaSendVirtualL; + # /tmp/portage/dev-java/openj9-openjdk-21.0.48.0/work/openj9-openjdk-jdk21-openj9-0.48.0/openj9/runtime/compiler/runtime/Runtime.cpp:341:1: note: previously declared here + # 341 | JIT_HELPER(icallVMprJavaSendVirtualL); + filter-lto + # Enabling full docs appears to break doc building. If not # explicitly disabled, the flag will get auto-enabled if pandoc and # graphviz are detected. pandoc has loads of dependencies anyway. local myconf=( --disable-ccache + --disable-precompiled-headers + --disable-warnings-as-errors{,-omr,-openj9} --enable-full-docs=no --with-boot-jdk="${JDK_HOME}" --with-extra-cflags="${CFLAGS}" @@ -227,19 +226,20 @@ src_configure() { --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" --with-vendor-version-string="${PVR}" --with-version-pre="" - --with-version-opt="" --with-zlib=system - --enable-dtrace=$(usex systemtap yes no) + --enable-jvm-feature-dtrace=$(usex systemtap yes no) --enable-headless-only=$(usex headless-awt yes no) $(tc-is-clang && echo "--with-toolchain-type=clang") - --disable-warnings-as-errors{,-omr,-openj9} --with-cmake $(use_enable ddr) + $(use_enable jitserver) ) + use lto && myconf+=( --with-jvm-features=link-time-opt ) + if use javafx; then - local zip="${EPREFIX%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" + local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" if [[ -r ${zip} ]]; then myconf+=( --with-import-modules="${zip}" ) else @@ -247,13 +247,6 @@ src_configure() { fi fi - # PaX breaks pch, bug #601016 - if use pch && ! host-is-pax; then - myconf+=( --enable-precompiled-headers ) - else - myconf+=( --disable-precompiled-headers ) - fi - ( unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS CFLAGS= CXXFLAGS= LDFLAGS= \ @@ -263,21 +256,33 @@ src_configure() { } src_compile() { + local mycmakeargsx=( + "-DCMAKE_C_FLAGS='${CFLAGS}'" + "-DJ9JIT_EXTRA_CFLAGS='${CFLAGS}'" + "-DCMAKE_CXX_FLAGS='${CXXFLAGS}'" + "-DJ9JIT_EXTRA_CXXFLAGS='${CXXFLAGS}'" + "-DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS}'" + -DOMR_WARNINGS_AS_ERRORS=OFF + -DOMR_PORT_NUMA_SUPPORT=$(usex numa) + ) local myemakeargs=( JOBS=$(makeopts_jobs) - # https://github.com/ibmruntimes/openj9-openjdk-jdk14/issues/72 - #LOG=debug + LOG=debug $(usex doc docs '') $(usex jbootstrap bootcycle-images product-images) - EXTRA_CMAKE_ARGS="-DOMR_WARNINGS_AS_ERRORS=OFF" + EXTRA_CMAKE_ARGS="${mycmakeargsx[*]}" + OPENJDK_SHA=$(ver_cut 1-3) + OPENJ9_SHA=${OPENJ9_P} + OPENJ9_TAG=${OPENJ9_P} + OPENJ9OMR_SHA=${OPENJ9_P} ) - emake "${myemakeargs[@]}" -j1 #nowarn + emake "${myemakeargs[@]}" -j1 } src_install() { local dest="/usr/$(get_libdir)/${PN}-${SLOT}" - local ddest="${ED}${dest#/}" + local ddest="${ED}/${dest#/}" cd "${S}"/build/*-release/images/jdk || die @@ -292,10 +297,6 @@ src_install() { rm -v lib/libjsound.* || die fi - if ! use examples ; then - rm -vr demo/ || die - fi - if ! use source ; then rm -v lib/src.zip || die fi @@ -305,12 +306,12 @@ src_install() { dodir "${dest}" cp -pPR * "${ddest}" || die - dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + dosym -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts # must be done before running itself java-vm_set-pax-markings "${ddest}" - use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}.env.sh + java-vm_install-env "${FILESDIR}"/${PN}.env.sh java-vm_revdep-mask java-vm_sandbox-predict /dev/random /proc/self/coredump_filter @@ -323,16 +324,4 @@ src_install() { pkg_postinst() { java-vm-2_pkg_postinst - - if use gentoo-vm ; then - ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK" - ewarn "recognised by the system. This will almost certainly break" - ewarn "many java ebuilds as they are not ready for openjdk-11" - else - ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK" - ewarn "will not be recognised by the system. For example, simply calling" - ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo" - ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its" - ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}." - fi } |