From d241ee7943383a8ad8aacd70d5e301a6acf22c38 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Tue, 28 Jul 2020 09:41:37 -0400 Subject: Initial commit --- dev-java/openj9-openjdk/Manifest | 4 + dev-java/openj9-openjdk/files/omr-fam.patch | 70 +++++ .../files/omr-omrstr-iconv-failure-overflow.patch | 13 + .../openj9-openjdk/files/openj9-j9utf8-fam.patch | 26 ++ .../openj9-make-jvmti-test-variables-static.patch | 68 +++++ .../files/openj9-subscriptionID.patch | 36 +++ dev-java/openj9-openjdk/files/openjdk-14.env.sh | 16 ++ .../files/openjdk-8238380-childproc-fcommon.patch | 48 ++++ dev-java/openj9-openjdk/metadata.xml | 21 ++ .../openj9-openjdk/openj9-openjdk-11.0.21.0.ebuild | 318 +++++++++++++++++++++ .../openj9-openjdk/openj9-openjdk-14.0.21.0.ebuild | 318 +++++++++++++++++++++ 11 files changed, 938 insertions(+) create mode 100644 dev-java/openj9-openjdk/Manifest create mode 100644 dev-java/openj9-openjdk/files/omr-fam.patch create mode 100644 dev-java/openj9-openjdk/files/omr-omrstr-iconv-failure-overflow.patch create mode 100644 dev-java/openj9-openjdk/files/openj9-j9utf8-fam.patch create mode 100644 dev-java/openj9-openjdk/files/openj9-make-jvmti-test-variables-static.patch create mode 100644 dev-java/openj9-openjdk/files/openj9-subscriptionID.patch create mode 100644 dev-java/openj9-openjdk/files/openjdk-14.env.sh create mode 100644 dev-java/openj9-openjdk/files/openjdk-8238380-childproc-fcommon.patch create mode 100644 dev-java/openj9-openjdk/metadata.xml create mode 100644 dev-java/openj9-openjdk/openj9-openjdk-11.0.21.0.ebuild create mode 100644 dev-java/openj9-openjdk/openj9-openjdk-14.0.21.0.ebuild (limited to 'dev-java/openj9-openjdk') diff --git a/dev-java/openj9-openjdk/Manifest b/dev-java/openj9-openjdk/Manifest new file mode 100644 index 0000000..a97ce7d --- /dev/null +++ b/dev-java/openj9-openjdk/Manifest @@ -0,0 +1,4 @@ +DIST openj9-0.21.0.tar.gz 16216102 BLAKE2B 7536e61b742562b7782239d600b78bfa4c00850589cc80bbe8820d97842db55cc001bfbdbb81eb1da534c250a4315ce772fdbe1bcdd1e26863df1fb548618853 SHA512 8137318d9cde6a6383539d2b1a0535951cab178d4f31ccd83260460bdf2b57569e784d205d2fd6e17e0fbc04b6e4aa5a57b81fe46112d38eb0fc5b374b55cf16 +DIST openj9-omr-0.21.0.tar.gz 7704671 BLAKE2B e97b4bd8b975814af74c569f71a4aa35df373eb8c583d21a44065e2db140eca3649b674b5347fd031831c10701ccdb2a263eeeacf19bd4831c1e63ab18398f65 SHA512 7eed6eb68d251934291be859f061801b41b95abc481d3e3d059fc4f3eee94ba2b31143aa00b9abd39dc2325540ed0a4f16e075396e34741f57e36fe69d376b0f +DIST openj9-openjdk-jdk11-openj9-0.21.0.tar.gz 104216281 BLAKE2B 21716b92b07a72be19b53f926dc1248e633ba01a82f0ad841883eed325d3caaa887c6ea87c8f2e13aff9f230d981418d2b7ff6bd6fb99cf0ff6dcda948c6a3dc SHA512 2b915c88b62b04c0549037d6be42428ba9f99b51f00d364c0ba9c9c7340d1b67da99f583a2623b04d8708703f789ef680ea70b8259e8557af34da830a136a0d8 +DIST openj9-openjdk-jdk14-openj9-0.21.0.tar.gz 95491120 BLAKE2B b4d17dadda4d209f04126520ec5a86fc38bfab6af75d9ce2047555c8cec0dca28205b1a056b7294c111947cafa2eaaadebb2851ec8958367626e9c4b0940ad57 SHA512 83b08fc63dfc06e97583720ccfb4643f07398700b93d8328a5fd730764bba9665cde57e7f149024f11e752aa04f6450114dd3cecf5e589e24991c3340292c009 diff --git a/dev-java/openj9-openjdk/files/omr-fam.patch b/dev-java/openj9-openjdk/files/omr-fam.patch new file mode 100644 index 0000000..9141ec1 --- /dev/null +++ b/dev-java/openj9-openjdk/files/omr-fam.patch @@ -0,0 +1,70 @@ +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/omr-omrstr-iconv-failure-overflow.patch b/dev-java/openj9-openjdk/files/omr-omrstr-iconv-failure-overflow.patch new file mode 100644 index 0000000..f90c431 --- /dev/null +++ b/dev-java/openj9-openjdk/files/omr-omrstr-iconv-failure-overflow.patch @@ -0,0 +1,13 @@ +diff --git a/port/common/omrstr.c b/port/common/omrstr.c +index ad76cdf93..f936f0026 100644 +--- a/port/common/omrstr.c ++++ b/port/common/omrstr.c +@@ -3121,7 +3121,7 @@ convertPlatformToWide(struct OMRPortLibrary *portLibrary, charconvState_t encodi + } else if (E2BIG == errno) { + resultSize = (outBufferSize - wideBufferLimit); /* number of bytes written */ + } else { +- resultSize = OMRPORT_ERROR_STRING_ILLEGAL_STRING; ++ return OMRPORT_ERROR_STRING_ILLEGAL_STRING; + } + } else { + resultSize = (outBufferSize - wideBufferLimit); /* number of bytes written */ diff --git a/dev-java/openj9-openjdk/files/openj9-j9utf8-fam.patch b/dev-java/openj9-openjdk/files/openj9-j9utf8-fam.patch new file mode 100644 index 0000000..f45a539 --- /dev/null +++ b/dev-java/openj9-openjdk/files/openj9-j9utf8-fam.patch @@ -0,0 +1,26 @@ +diff --git a/runtime/cfdumper/romdump.c b/runtime/cfdumper/romdump.c +index 5040c2c25..1cfcd36c7 100644 +--- a/runtime/cfdumper/romdump.c ++++ b/runtime/cfdumper/romdump.c +@@ -154,7 +154,7 @@ addRegion(J9Pool *regionPool, UDATA offset, UDATA length, UDATA type, const char + static UDATA + getUTF8Length(J9UTF8 *utf8) + { +- UDATA length = sizeof(J9UTF8) + J9UTF8_LENGTH(utf8) - sizeof(J9UTF8_DATA(utf8)); ++ UDATA length = sizeof(J9UTF8) + J9UTF8_LENGTH(utf8); + if (length & 1) { + length++; + } +diff --git a/runtime/oti/j9nonbuilder.h b/runtime/oti/j9nonbuilder.h +index c5705188d..e9babe227 100644 +--- a/runtime/oti/j9nonbuilder.h ++++ b/runtime/oti/j9nonbuilder.h +@@ -3219,7 +3219,7 @@ typedef struct J9ClassLoader { + + typedef struct J9UTF8 { + U_16 length; +- U_8 data[2]; ++ U_8 data[]; + } J9UTF8; + + typedef struct J9ROMClass { diff --git a/dev-java/openj9-openjdk/files/openj9-make-jvmti-test-variables-static.patch b/dev-java/openj9-openjdk/files/openj9-make-jvmti-test-variables-static.patch new file mode 100644 index 0000000..5d5b8a7 --- /dev/null +++ b/dev-java/openj9-openjdk/files/openj9-make-jvmti-test-variables-static.patch @@ -0,0 +1,68 @@ +From b91f42fc90179585c3e2a9866e93a3168b1ada9d Mon Sep 17 00:00:00 2001 +From: Graham Chapman +Date: Sat, 25 Jul 2020 16:13:13 -0400 +Subject: [PATCH] Make JVMTI test variables static + +Two tests declare the same named global non-statically which breaks some +newer compilers. + +Fixes: #10252 + +[ci skip] + +Signed-off-by: Graham Chapman +--- + .../src/com/ibm/jvmti/tests/traceSubscription/ts001.c | 4 ++-- + .../jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c +index 97843fc7c7..2c1e1ae67f 100644 +--- a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c ++++ b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2001, 2018 IBM Corp. and others ++ * Copyright (c) 2001, 2020 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this +@@ -35,7 +35,7 @@ static jvmtiExtensionFunction subscribe = NULL; + static jvmtiExtensionFunction unsubscribe = NULL; + static jvmtiExtensionFunction flush = NULL; + static jvmtiExtensionFunction metadata = NULL; +-void *subscriptionID; ++static void *subscriptionID; + volatile static jint bufferCount = 0; + volatile static jint bufferCountFinal = 0; + volatile static int completed = 0; +diff --git a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c +index 2fda9e8bd7..f1601298af 100644 +--- a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c ++++ b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2001, 2018 IBM Corp. and others ++ * Copyright (c) 2001, 2020 IBM Corp. and others + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this +@@ -31,15 +31,15 @@ static agentEnv * env; + static jvmtiExtensionFunction subscribe = NULL; + static jvmtiExtensionFunction unsubscribe = NULL; + +-void *subscriptionID; ++static void *subscriptionID; + volatile static jint bufferCount = 0; + volatile static int alarmed = 0; + +-void *subscriptionID2; ++static void *subscriptionID2; + volatile static jint bufferCount2 = 0; + volatile static int alarmed2 = 0; + +-void *subscriptionID3; ++static void *subscriptionID3; + volatile static jint bufferCount3 = 0; + volatile static int alarmed3 = 0; + diff --git a/dev-java/openj9-openjdk/files/openj9-subscriptionID.patch b/dev-java/openj9-openjdk/files/openj9-subscriptionID.patch new file mode 100644 index 0000000..e754e05 --- /dev/null +++ b/dev-java/openj9-openjdk/files/openj9-subscriptionID.patch @@ -0,0 +1,36 @@ +diff --git a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c +index 97843fc7c..a2cc3ffe6 100644 +--- a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c ++++ b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/traceSubscription/ts001.c +@@ -35,7 +35,7 @@ static jvmtiExtensionFunction subscribe = NULL; + static jvmtiExtensionFunction unsubscribe = NULL; + static jvmtiExtensionFunction flush = NULL; + static jvmtiExtensionFunction metadata = NULL; +-void *subscriptionID; ++static void *subscriptionID; + volatile static jint bufferCount = 0; + volatile static jint bufferCountFinal = 0; + volatile static int completed = 0; +diff --git a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c +index 2fda9e8bd..d11047e44 100644 +--- a/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c ++++ b/runtime/tests/jvmtitests/src/com/ibm/jvmti/tests/verboseGC/vgc001.c +@@ -31,15 +31,15 @@ static agentEnv * env; + static jvmtiExtensionFunction subscribe = NULL; + static jvmtiExtensionFunction unsubscribe = NULL; + +-void *subscriptionID; ++static void *subscriptionID; + volatile static jint bufferCount = 0; + volatile static int alarmed = 0; + +-void *subscriptionID2; ++static void *subscriptionID2; + volatile static jint bufferCount2 = 0; + volatile static int alarmed2 = 0; + +-void *subscriptionID3; ++static void *subscriptionID3; + volatile static jint bufferCount3 = 0; + volatile static int alarmed3 = 0; + diff --git a/dev-java/openj9-openjdk/files/openjdk-14.env.sh b/dev-java/openj9-openjdk/files/openjdk-14.env.sh new file mode 100644 index 0000000..96c4be7 --- /dev/null +++ b/dev-java/openj9-openjdk/files/openjdk-14.env.sh @@ -0,0 +1,16 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +VERSION="OpenJDK ${PV}" +JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}" +JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}" +JAVAC="\${JAVA_HOME}/bin/javac" +PATH="\${JAVA_HOME}/bin" +ROOTPATH="\${JAVA_HOME}/bin" +LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/" +MANPATH="" +PROVIDES_TYPE="JDK JRE" +PROVIDES_VERSION="${SLOT}" +BOOTCLASSPATH="" +GENERATION="2" +ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH" diff --git a/dev-java/openj9-openjdk/files/openjdk-8238380-childproc-fcommon.patch b/dev-java/openj9-openjdk/files/openjdk-8238380-childproc-fcommon.patch new file mode 100644 index 0000000..a972bc6 --- /dev/null +++ b/dev-java/openj9-openjdk/files/openjdk-8238380-childproc-fcommon.patch @@ -0,0 +1,48 @@ + +# HG changeset patch +# User qpzhang +# Date 1580822830 -28800 +# Node ID 6925fca959590dd0f747a9cffa5f0664ec02c7b1 +# Parent 8f6ffa575f63db3f07f96e52c97883fbaff459b4 +8238380: java.base/unix/native/libjava/childproc.c "multiple definition" link errors with GCC10 +Reviewed-by: stuefe, clanger, rriggs +Contributed-by: patrick@os.amperecomputing.com + +diff -r 8f6ffa575f63 -r 6925fca95959 src/java.base/unix/native/libjava/childproc.c +--- a/src/java.base/unix/native/libjava/childproc.c Tue Feb 11 11:17:37 2020 +0800 ++++ b/src/java.base/unix/native/libjava/childproc.c Tue Feb 04 21:27:10 2020 +0800 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -34,6 +34,7 @@ + + #include "childproc.h" + ++const char * const *parentPathv; + + ssize_t + restartableWrite(int fd, const void *buf, size_t count) +diff -r 8f6ffa575f63 -r 6925fca95959 src/java.base/unix/native/libjava/childproc.h +--- a/src/java.base/unix/native/libjava/childproc.h Tue Feb 11 11:17:37 2020 +0800 ++++ b/src/java.base/unix/native/libjava/childproc.h Tue Feb 04 21:27:10 2020 +0800 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -126,7 +126,7 @@ + * The cached and split version of the JDK's effective PATH. + * (We don't support putenv("PATH=...") in native code) + */ +-const char * const *parentPathv; ++extern const char * const *parentPathv; + + ssize_t restartableWrite(int fd, const void *buf, size_t count); + int restartableDup2(int fd_from, int fd_to); + diff --git a/dev-java/openj9-openjdk/metadata.xml b/dev-java/openj9-openjdk/metadata.xml new file mode 100644 index 0000000..2c13f5e --- /dev/null +++ b/dev-java/openj9-openjdk/metadata.xml @@ -0,0 +1,21 @@ + + + + + Java™ is the world's leading programming language and platform. + The code for Java is open source and available at OpenJDK™. + + + Java™ version 11 + + + Use custom -O flags instead of upstream defaults + Enable Direct Dump Reader + Don't install the X backend for AWT, needed by some GUIs + Allow this JDK to be recognised by Gentoo (package manager, eselect, java-config, EXPERIMENTAL!) + Import OpenJFX modules at build time, via dev-java/openjfx + Build OpenJDK twice, the second time using the result of the first + Enable SystemTAP/DTrace tracing + Provide javaws command through symlink to icedtea-web + + diff --git a/dev-java/openj9-openjdk/openj9-openjdk-11.0.21.0.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-11.0.21.0.ebuild new file mode 100644 index 0000000..f3a49a3 --- /dev/null +++ b/dev-java/openj9-openjdk/openj9-openjdk-11.0.21.0.ebuild @@ -0,0 +1,318 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs + +# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to +# set build version properly +SLOT="$(get_major_version)" +OPENJ9_PV="$(get_version_component_range 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" +SRC_URI=" + 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 -> ${OPENJ9_P}.tar.gz + https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz + " + +LICENSE="GPL-2" +KEYWORDS="~amd64" + +IUSE="alsa custom-cflags custom-optimization cups ddr debug doc gentoo-vm headless-awt javafx +jbootstrap nsplugin +pch selinux systemtap webstart" + +COMMON_DEPEND=" + media-libs/freetype:2= + media-libs/giflib:0/7 + media-libs/libpng:0= + media-libs/lcms:2= + sys-libs/zlib + virtual/jpeg:0= + systemtap? ( dev-util/systemtap ) + + dev-libs/elfutils + dev-libs/libdwarf + sys-process/numactl +" + +# Many libs are required to build, but not to run, make is possible to remove +# by listing conditionally in RDEPEND unconditionally in DEPEND +RDEPEND=" + ${COMMON_DEPEND} + >=sys-apps/baselayout-java-0.1.0-r1 + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + ) + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + selinux? ( sec-policy/selinux-java ) +" + +DEPEND=" + ${COMMON_DEPEND} + app-arch/zip + media-libs/alsa-lib + net-print/cups + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + javafx? ( dev-java/openjfx:${SLOT}= ) + || ( + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) + || ( + dev-java/freemarker-bin + dev-java/freemarker + ) +" + +PDEPEND=" + webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] ) +" + +REQUIRED_USE="javafx? ( alsa !headless-awt )" + +S=${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_P} + +# The space required to build varies wildly depending on USE flags, +# ranging from 2GB to 16GB. This function is certainly not exact but +# should be close enough to be useful. +openjdk_check_requirements() { + local M + M=2048 + M=$(( $(usex jbootstrap 2 1) * $M )) + M=$(( $(usex debug 3 1) * $M )) + M=$(( $(usex doc 320 0) + + 192 + $M )) + + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} +} + +pkg_pretend() { + openjdk_check_requirements + if [[ ${MERGE_TYPE} != binary ]]; then + has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}" + fi +} + +pkg_setup() { + openjdk_check_requirements + java-vm-2_pkg_setup + + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" + JAVA_PKG_WANT_SOURCE="${SLOT}" + JAVA_PKG_WANT_TARGET="${SLOT}" + + # The nastiness below is necessary while the gentoo-vm USE flag is + # masked. First we call java-pkg-2_pkg_setup if it looks like the + # flag was unmasked against one of the possible build VMs. If not, + # we try finding one of them in their expected locations. This would + # have been slightly less messy if openjdk-bin had been installed to + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env + # file but disable it so that it would not normally be selectable. + + local vm + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do + if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then + java-pkg-2_pkg_setup + return + fi + done + + if has_version --host-root dev-java/openjdk:${SLOT}; then + export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT} + else + if [[ ${MERGE_TYPE} != "binary" ]]; then + JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT}) + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + export JDK_HOME + fi + fi +} + +src_prepare() { + ln -s ../openj9-${OPENJ9_P} openj9 || die + ln -s ../openj9-omr-${OPENJ9_P} omr || die + default + ( + cd openj9 || die + #eapply "${FILESDIR}/openj9-j9utf8-fam.patch" + eapply "${FILESDIR}/openj9-make-jvmti-test-variables-static.patch" + ) + ( + cd omr || die + eapply "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" + #eapply "${FILESDIR}/omr-fam.patch" + ) + sed -i -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + closed/OpenJ9.gmk + chmod +x configure || die +} + +src_configure() { + if ! use custom-cflags; then + strip-flags + + # Work around stack alignment issue, bug #647954. in case we ever have x86 + use x86 && append-flags -mincoming-stack-boundary=2 + + # Work around -fno-common ( GCC10 default ), bug #713180 + append-flags -fcommon + fi + + if ! use custom-optimization; then + filter-flags '-O*' + fi + + local freemarker_jar + local diefunc=$(declare -f die) + die() { :; } + freemarker_jar=$(java-pkg_getjar --build-only freemarker freemarker.jar) + local r=$? + eval "$diefunc" + if [[ $r != 0 ]]; then + freemarker_jar=$(java-pkg_getjar --build-only freemarker-bin freemarker.jar) + fi + + # 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 + --enable-full-docs=no + --with-boot-jdk="${JDK_HOME}" + --with-extra-cflags="${CFLAGS}" + --with-extra-cxxflags="${CXXFLAGS}" + --with-extra-ldflags="${LDFLAGS}" + --with-giflib=system + --with-lcms=system + --with-libjpeg=system + --with-libpng=system + --with-native-debug-symbols=$(usex debug internal none) + --with-vendor-name="Gentoo" + --with-vendor-url="https://gentoo.org" + --with-vendor-bug-url="https://bugs.gentoo.org" + --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" + --with-zlib=system + --enable-dtrace=$(usex systemtap yes no) + --enable-headless-only=$(usex headless-awt yes no) + --with-vendor-version-string="${PVR}" + --with-version-pre="" + + --with-freemarker-jar=${freemarker_jar} + --disable-warnings-as-errors{,-omr,-openj9} + $(use_enable ddr) + ) + + if use javafx; then + local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" + if [[ -r ${zip} ]]; then + myconf+=( --with-import-modules="${zip}" ) + else + die "${zip} not found or not readable" + 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= \ + CONFIG_SITE=/dev/null \ + econf "${myconf[@]}" + ) +} + +src_compile() { + local myemakeargs=( + JOBS=$(makeopts_jobs) + LOG=debug + CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror + $(usex doc docs '') + $(usex jbootstrap bootcycle-images product-images) + ) + emake "${myemakeargs[@]}" -j1 #nowarn +} + +src_install() { + local dest="/usr/$(get_libdir)/${PN}-${SLOT}" + local ddest="${ED}${dest#/}" + + cd "${S}"/build/*-release/jdk || die + + # Create files used as storage for system preferences. + mkdir .systemPrefs || die + touch .systemPrefs/.system.lock || die + touch .systemPrefs/.systemRootModFile || die + + # Oracle and IcedTea have libjsoundalsa.so depending on + # libasound.so.2 but OpenJDK only has libjsound.so. Weird. + if ! use alsa ; then + rm -v lib/libjsound.* || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + einfo "Creating the Class Data Sharing archives and disabling usage tracking" + "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die + + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.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}" + 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-14.0.21.0.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-14.0.21.0.ebuild new file mode 100644 index 0000000..f3a49a3 --- /dev/null +++ b/dev-java/openj9-openjdk/openj9-openjdk-14.0.21.0.ebuild @@ -0,0 +1,318 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs + +# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to +# set build version properly +SLOT="$(get_major_version)" +OPENJ9_PV="$(get_version_component_range 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" +SRC_URI=" + 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 -> ${OPENJ9_P}.tar.gz + https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz + " + +LICENSE="GPL-2" +KEYWORDS="~amd64" + +IUSE="alsa custom-cflags custom-optimization cups ddr debug doc gentoo-vm headless-awt javafx +jbootstrap nsplugin +pch selinux systemtap webstart" + +COMMON_DEPEND=" + media-libs/freetype:2= + media-libs/giflib:0/7 + media-libs/libpng:0= + media-libs/lcms:2= + sys-libs/zlib + virtual/jpeg:0= + systemtap? ( dev-util/systemtap ) + + dev-libs/elfutils + dev-libs/libdwarf + sys-process/numactl +" + +# Many libs are required to build, but not to run, make is possible to remove +# by listing conditionally in RDEPEND unconditionally in DEPEND +RDEPEND=" + ${COMMON_DEPEND} + >=sys-apps/baselayout-java-0.1.0-r1 + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + ) + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + selinux? ( sec-policy/selinux-java ) +" + +DEPEND=" + ${COMMON_DEPEND} + app-arch/zip + media-libs/alsa-lib + net-print/cups + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + javafx? ( dev-java/openjfx:${SLOT}= ) + || ( + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) + || ( + dev-java/freemarker-bin + dev-java/freemarker + ) +" + +PDEPEND=" + webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] ) +" + +REQUIRED_USE="javafx? ( alsa !headless-awt )" + +S=${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_P} + +# The space required to build varies wildly depending on USE flags, +# ranging from 2GB to 16GB. This function is certainly not exact but +# should be close enough to be useful. +openjdk_check_requirements() { + local M + M=2048 + M=$(( $(usex jbootstrap 2 1) * $M )) + M=$(( $(usex debug 3 1) * $M )) + M=$(( $(usex doc 320 0) + + 192 + $M )) + + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} +} + +pkg_pretend() { + openjdk_check_requirements + if [[ ${MERGE_TYPE} != binary ]]; then + has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}" + fi +} + +pkg_setup() { + openjdk_check_requirements + java-vm-2_pkg_setup + + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" + JAVA_PKG_WANT_SOURCE="${SLOT}" + JAVA_PKG_WANT_TARGET="${SLOT}" + + # The nastiness below is necessary while the gentoo-vm USE flag is + # masked. First we call java-pkg-2_pkg_setup if it looks like the + # flag was unmasked against one of the possible build VMs. If not, + # we try finding one of them in their expected locations. This would + # have been slightly less messy if openjdk-bin had been installed to + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env + # file but disable it so that it would not normally be selectable. + + local vm + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do + if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then + java-pkg-2_pkg_setup + return + fi + done + + if has_version --host-root dev-java/openjdk:${SLOT}; then + export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT} + else + if [[ ${MERGE_TYPE} != "binary" ]]; then + JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT}) + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + export JDK_HOME + fi + fi +} + +src_prepare() { + ln -s ../openj9-${OPENJ9_P} openj9 || die + ln -s ../openj9-omr-${OPENJ9_P} omr || die + default + ( + cd openj9 || die + #eapply "${FILESDIR}/openj9-j9utf8-fam.patch" + eapply "${FILESDIR}/openj9-make-jvmti-test-variables-static.patch" + ) + ( + cd omr || die + eapply "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" + #eapply "${FILESDIR}/omr-fam.patch" + ) + sed -i -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + closed/OpenJ9.gmk + chmod +x configure || die +} + +src_configure() { + if ! use custom-cflags; then + strip-flags + + # Work around stack alignment issue, bug #647954. in case we ever have x86 + use x86 && append-flags -mincoming-stack-boundary=2 + + # Work around -fno-common ( GCC10 default ), bug #713180 + append-flags -fcommon + fi + + if ! use custom-optimization; then + filter-flags '-O*' + fi + + local freemarker_jar + local diefunc=$(declare -f die) + die() { :; } + freemarker_jar=$(java-pkg_getjar --build-only freemarker freemarker.jar) + local r=$? + eval "$diefunc" + if [[ $r != 0 ]]; then + freemarker_jar=$(java-pkg_getjar --build-only freemarker-bin freemarker.jar) + fi + + # 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 + --enable-full-docs=no + --with-boot-jdk="${JDK_HOME}" + --with-extra-cflags="${CFLAGS}" + --with-extra-cxxflags="${CXXFLAGS}" + --with-extra-ldflags="${LDFLAGS}" + --with-giflib=system + --with-lcms=system + --with-libjpeg=system + --with-libpng=system + --with-native-debug-symbols=$(usex debug internal none) + --with-vendor-name="Gentoo" + --with-vendor-url="https://gentoo.org" + --with-vendor-bug-url="https://bugs.gentoo.org" + --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" + --with-zlib=system + --enable-dtrace=$(usex systemtap yes no) + --enable-headless-only=$(usex headless-awt yes no) + --with-vendor-version-string="${PVR}" + --with-version-pre="" + + --with-freemarker-jar=${freemarker_jar} + --disable-warnings-as-errors{,-omr,-openj9} + $(use_enable ddr) + ) + + if use javafx; then + local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" + if [[ -r ${zip} ]]; then + myconf+=( --with-import-modules="${zip}" ) + else + die "${zip} not found or not readable" + 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= \ + CONFIG_SITE=/dev/null \ + econf "${myconf[@]}" + ) +} + +src_compile() { + local myemakeargs=( + JOBS=$(makeopts_jobs) + LOG=debug + CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror + $(usex doc docs '') + $(usex jbootstrap bootcycle-images product-images) + ) + emake "${myemakeargs[@]}" -j1 #nowarn +} + +src_install() { + local dest="/usr/$(get_libdir)/${PN}-${SLOT}" + local ddest="${ED}${dest#/}" + + cd "${S}"/build/*-release/jdk || die + + # Create files used as storage for system preferences. + mkdir .systemPrefs || die + touch .systemPrefs/.system.lock || die + touch .systemPrefs/.systemRootModFile || die + + # Oracle and IcedTea have libjsoundalsa.so depending on + # libasound.so.2 but OpenJDK only has libjsound.so. Weird. + if ! use alsa ; then + rm -v lib/libjsound.* || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + einfo "Creating the Class Data Sharing archives and disabling usage tracking" + "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die + + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.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}" + 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 +} -- cgit v1.2.3-54-g00ecf