Index: head/java/openjdk11/Makefile =================================================================== --- head/java/openjdk11/Makefile (revision 497063) +++ head/java/openjdk11/Makefile (revision 497064) @@ -1,141 +1,140 @@ # $FreeBSD$ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}.${JDK_BUILD_NUMBER}.${BSD_JDK_VERSION} -PORTREVISION= 3 CATEGORIES= java devel MASTER_SITES= https://github.com/battleblow/openjdk-jdk11u/archive/ PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION} DISTNAME= jdk-${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} MAINTAINER= java@FreeBSD.org COMMENT= Java Development Kit ${JDK_MAJOR_VERSION} LICENSE= GPLv2 ONLY_FOR_ARCHS= amd64 i386 BUILD_DEPENDS= zip:archivers/zip \ autoconf>0:devel/autoconf \ ${LOCALBASE}/include/cups/cups.h:print/cups \ bash:shells/bash -LIB_DEPENDS= libfreetype.so:print/freetype2 \ +LIB_DEPENDS= libasound.so:audio/alsa-lib \ libfontconfig.so:x11-fonts/fontconfig \ - liblcms2.so:graphics/lcms2 \ + libfreetype.so:print/freetype2 \ libgif.so:graphics/giflib \ + liblcms2.so:graphics/lcms2 \ libpng16.so:graphics/png USES= compiler:features gmake iconv jpeg pkgconfig -USE_XORG= xext x11 xrender xtst xi xt +USE_XORG= x11 xext xi xrender xt xtst WRKSRC= ${WRKDIR}/${PORTNAME}-jdk${JDK_MAJOR_VERSION}u-jdk-${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}-${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} _MAKE_JOBS= # CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib MAKE_ENV= LANG="C" \ LC_ALL="C" \ CLASSPATH="" \ JAVA_HOME="" \ LD_LIBRARY_PATH="" \ CC=/usr/bin/cc \ CXX=/usr/bin/c++ \ MAKEFLAGS="" \ USE_CLANG=true JDK_OSARCH= bsd-${ARCH:S/amd64/x86_64/:S/i386/x86/} JDK_BUILDDIR= ${WRKSRC}/build/${JDK_OSARCH}-normal-${JDK_BUILD_JVM}-${JDK_BUILD_TYPE} JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/jdk INSTALLDIR= ${PREFIX}/${PKGBASE} NOPRECIOUSMAKEVARS= yes JDK_MAJOR_VERSION= 11 JDK_MINOR_VERSION= 0 JDK_PATCH_VERSION= 2 JDK_BUILD_NUMBER= 9 -BSD_JDK_VERSION= 2 +BSD_JDK_VERSION= 4 GNU_CONFIGURE= yes CONFIGURE_ENV= CC=/usr/bin/cc \ CXX=/usr/bin/c++ CONFIGURE_ARGS= --with-boot-jdk=${BOOTSTRAPJDKDIR} \ --disable-ccache \ - --disable-dtrace \ --disable-javac-server \ --disable-hotspot-gtest \ --with-alsa=${LOCALBASE} \ --with-cups=${LOCALBASE} \ --with-fontconfig=${LOCALBASE} \ --with-freetype=system \ --with-freetype-include=${LOCALBASE}/include/freetype2 \ --with-freetype-lib=${LOCALBASE}/lib \ --with-libjpeg=system \ --with-giflib=system \ --with-giflib-include=${LOCALBASE}/include \ --with-giflib-lib=${LOCALBASE}/lib \ --with-libpng=system \ --with-zlib=system \ --with-lcms=system \ --with-toolchain-type=clang \ --x-includes=${LOCALBASE}/include \ --x-libraries=${LOCALBASE}/lib \ --with-cacerts-file=${FILESDIR}/cacerts \ --with-version-string=${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} \ --with-native-debug-symbols=none \ --with-debug-level=release JAVAVMS_COMMENT= OpenJDK${JDK_MAJOR_VERSION} ALL_TARGET= images JDK_BUILD_TYPE= release .include BOOTSTRAP_JDKS= ${LOCALBASE}/openjdk11 \ ${LOCALBASE}/bootstrap-openjdk11 # do we have valid native jdk installed? .for BJDK in ${BOOTSTRAP_JDKS} . if !defined(BOOTSTRAPJDKDIR) && exists(${BJDK}/bin/javac) BOOTSTRAPJDKDIR= ${BJDK} . endif .endfor # if no valid jdk found, set dependency .if !defined(BOOTSTRAPJDKDIR) BOOTSTRAPJDKDIR?= ${LOCALBASE}/bootstrap-openjdk11 BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:java/bootstrap-openjdk11 .endif JDK_BUILD_JVM= server .if empty(ICONV_LIB) ICONV_CFLAGS= -DLIBICONV_PLUG .else ICONV_CFLAGS= -I${LOCALBASE}/include ICONV_LDFLAGS= -L${LOCALBASE}/lib ICONV_LIBS= ${ICONV_LIB} .endif post-patch: @${FIND} ${WRKSRC} -name '*.orig' -delete @${CHMOD} 755 ${WRKSRC}/configure @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ ${WRKSRC}/configure \ ${WRKSRC}/src/hotspot/os/bsd/os_bsd.cpp @${REINPLACE_CMD} -e 's|%%ICONV_CFLAGS%%|${ICONV_CFLAGS}|' \ -e 's|%%ICONV_LDFLAGS%%|${ICONV_LDFLAGS}|' \ -e 's|%%ICONV_LIBS%%|${ICONV_LIBS}|' \ ${WRKSRC}/make/autoconf/libraries.m4 do-install: @${MKDIR} ${STAGEDIR}${INSTALLDIR} @cd ${JDK_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR} @cd ${STAGEDIR}${INSTALLDIR} && \ ${FIND} bin -type f -exec ${CHMOD} ${BINMODE} {} \; @${CHMOD} ${BINMODE} ${STAGEDIR}${INSTALLDIR}/lib/jspawnhelper @${FIND} ${STAGEDIR}${INSTALLDIR} -not -type d | ${SORT} | \ ${SED} -e 's|^${STAGEDIR}${PREFIX}/||' >> ${TMPPLIST} .include Index: head/java/openjdk11/distinfo =================================================================== --- head/java/openjdk11/distinfo (revision 497063) +++ head/java/openjdk11/distinfo (revision 497064) @@ -1,3 +1,3 @@ -TIMESTAMP = 1553112684 -SHA256 (jdk-11.0.2+9-2.tar.gz) = 00dbb8e268b9ce2311d5ce95ec18f11524e1ffc5f80d3859bd9a3d6f6b652379 -SIZE (jdk-11.0.2+9-2.tar.gz) = 116739508 +TIMESTAMP = 1553815308 +SHA256 (jdk-11.0.2+9-4.tar.gz) = abaa01c2996eb6e8491c37c400e82658d2305fa2590b157d24095099f1542dec +SIZE (jdk-11.0.2+9-4.tar.gz) = 116770351 Index: head/java/openjdk11/files/patch-make_autoconf_toolchain.m4 =================================================================== --- head/java/openjdk11/files/patch-make_autoconf_toolchain.m4 (revision 497063) +++ head/java/openjdk11/files/patch-make_autoconf_toolchain.m4 (nonexistent) @@ -1,26 +0,0 @@ ---- make/autoconf/toolchain.m4 -+++ make/autoconf/toolchain.m4 -@@ -998,22 +998,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], - [ - # The package path is used only on macosx? - # FIXME: clean this up, and/or move it elsewhere. -- AC_ARG_WITH(package-path, [AS_HELP_STRING([--with-package-path], -- [package path to be used for location of third party packages])]) -- PACKAGE_PATH="$with_package_path" -- if test "x$PACKAGE_PATH" = x; then -- case $OPENJDK_TARGET_OS_ENV in -- bsd.freebsd|bsd.openbsd) -- PACKAGE_PATH=/usr/local -- ;; -- bsd.netbsd) -- PACKAGE_PATH=/usr/pkg -- ;; -- *) -- PACKAGE_PATH=/opt/local -- ;; -- esac -- fi -+ PACKAGE_PATH=/opt/local - AC_SUBST(PACKAGE_PATH) - - # Check for extra potential brokenness. Property changes on: head/java/openjdk11/files/patch-make_autoconf_toolchain.m4 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 =================================================================== --- head/java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 (revision 497063) +++ head/java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 (nonexistent) @@ -1,99 +0,0 @@ ---- make/autoconf/lib-bundled.m4 -+++ make/autoconf/lib-bundled.m4 -@@ -58,18 +58,26 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBJPEG], - - if test "x${with_libjpeg}" = "xbundled"; then - USE_EXTERNAL_LIBJPEG=false -+ JPEG_CFLAGS="" -+ JPEG_LIBS="" - elif test "x${with_libjpeg}" = "xsystem"; then -- AC_CHECK_HEADER(jpeglib.h, [], -- [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])]) -- AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [], -- [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])]) -- -+ PKG_CHECK_MODULES(JPEG, libjpeg, [LIBJPEG_FOUND=yes], [LIBJPEG_FOUND=no]) -+ if test "x${LIBJPEG_FOUND}" = "xno"; then -+ AC_CHECK_HEADER(jpeglib.h, [], -+ [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])]) -+ AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [], -+ [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])]) -+ JPEG_CFLAGS="" -+ JPEG_LIBS="-ljpeg" -+ fi - USE_EXTERNAL_LIBJPEG=true - else - AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled']) - fi - - AC_SUBST(USE_EXTERNAL_LIBJPEG) -+ AC_SUBST(JPEG_CFLAGS) -+ AC_SUBST(JPEG_LIBS) - ]) - - ################################################################################ -@@ -79,6 +87,10 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB], - [ - AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], - [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) -+ AC_ARG_WITH(giflib-include, [AS_HELP_STRING([--with-giflib-include], -+ [specify directory for the system giflib include files])]) -+ AC_ARG_WITH(giflib-lib, [AS_HELP_STRING([--with-giflib-lib], -+ [specify directory for the system giflib library])]) - - AC_MSG_CHECKING([for which giflib to use]) - # default is bundled -@@ -91,11 +103,40 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB], - - if test "x${with_giflib}" = "xbundled"; then - USE_EXTERNAL_LIBGIF=false -+ GIFLIB_CFLAGS="" -+ GIFLIB_LIBS="" - elif test "x${with_giflib}" = "xsystem"; then -- AC_CHECK_HEADER(gif_lib.h, [], -- [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) -- AC_CHECK_LIB(gif, DGifGetCode, [], -- [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) -+ GIFLIB_H_FOUND=no -+ if test "x${with_giflib_include}" != x; then -+ GIFLIB_CFLAGS="-I${with_giflib_include}" -+ GIFLIB_H_FOUND=yes -+ fi -+ if test "x$GIFLIB_H_FOUND" = xno; then -+ AC_CHECK_HEADER(gif_lib.h, -+ [ -+ GIFLIB_CFLAGS="" -+ GIFLIB_H_FOUND=yes -+ ]) -+ fi -+ if test "x$GIFLIB_H_FOUND" = xno; then -+ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!]) -+ fi -+ -+ GIFLIB_LIB_FOUND=no -+ if test "x${with_giflib_lib}" != x; then -+ GIFLIB_LIBS="-L${with_giflib_lib} -lgif" -+ GIFLIB_LIB_FOUND=yes -+ fi -+ if test "x$GIFLIB_LIB_FOUND" = xno; then -+ AC_CHECK_LIB(gif, DGifGetCode, -+ [ -+ GIFLIB_LIBS="-lgif" -+ GIFLIB_LIB_FOUND=yes -+ ]) -+ fi -+ if test "x$GIFLIB_LIB_FOUND" = xno; then -+ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!]) -+ fi - - USE_EXTERNAL_LIBGIF=true - else -@@ -103,6 +144,8 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB], - fi - - AC_SUBST(USE_EXTERNAL_LIBGIF) -+ AC_SUBST(GIFLIB_CFLAGS) -+ AC_SUBST(GIFLIB_LIBS) - ]) - - ################################################################################ Property changes on: head/java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-make_autoconf_lib-cups.m4 =================================================================== --- head/java/openjdk11/files/patch-make_autoconf_lib-cups.m4 (revision 497063) +++ head/java/openjdk11/files/patch-make_autoconf_lib-cups.m4 (nonexistent) @@ -1,17 +0,0 @@ ---- make/autoconf/lib-cups.m4 -+++ make/autoconf/lib-cups.m4 -@@ -75,14 +75,6 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS], - DEFAULT_CUPS=yes - ]) - fi -- if test "x$CUPS_FOUND" = xno -a "x$OPENJDK_TARGET_OS" = xbsd; then -- AC_MSG_CHECKING([for cups headers]) -- if test -s "${PACKAGE_PATH}/include/cups/cups.h"; then -- CUPS_CFLAGS="-I${PACKAGE_PATH}/include" -- CUPS_FOUND=yes -- fi -- AC_MSG_RESULT([$CUPS_FOUND]) -- fi - if test "x$CUPS_FOUND" = xno; then - HELP_MSG_MISSING_DEPENDENCY([cups]) - AC_MSG_ERROR([Could not find cups! $HELP_MSG ]) Property changes on: head/java/openjdk11/files/patch-make_autoconf_lib-cups.m4 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 =================================================================== --- head/java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 (revision 497063) +++ head/java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 (nonexistent) @@ -1,11 +0,0 @@ ---- make/autoconf/flags-cflags.m4 -+++ make/autoconf/flags-cflags.m4 -@@ -416,7 +416,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], - elif test "x$OPENJDK_TARGET_OS" = xaix; then - CFLAGS_OS_DEF_JVM="-DAIX" - elif test "x$OPENJDK_TARGET_OS" = xbsd; then -- CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_BSDONLY_SOURCE -DPACKAGE_PATH='\"$PACKAGE_PATH\"'" -+ CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_BSDONLY_SOURCE" - CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_BSDONLY_SOURCE -D_REENTRANT" - elif test "x$OPENJDK_TARGET_OS" = xwindows; then - CFLAGS_OS_DEF_JVM="-D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_" Property changes on: head/java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c =================================================================== --- head/java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c (revision 497063) +++ head/java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c (nonexistent) @@ -1,303 +0,0 @@ ---- src/java.base/bsd/native/libjava/ProcessHandleImpl_bsd.c -+++ src/java.base/bsd/native/libjava/ProcessHandleImpl_bsd.c -@@ -41,7 +41,8 @@ - #include - - #ifdef __FreeBSD__ --#include // For kinfo_proc -+#include // For MAXPATHLEN -+#include // For kinfo_proc - #endif - - #if defined(__OpenBSD__) -@@ -109,8 +110,14 @@ jint os_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray, - } - - // Get buffer size needed to read all processes -+#if defined(__OpenBSD__) -+ u_int namelen = 6; -+ int mib[6] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), 0}; -+#else -+ u_int namelen = 4; - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0}; -- if (sysctl(mib, 4, NULL, &bufSize, NULL, 0) < 0) { -+#endif -+ if (sysctl(mib, namelen, NULL, &bufSize, NULL, 0) < 0) { - JNU_ThrowByNameWithLastError(env, - "java/lang/RuntimeException", "sysctl failed"); - return -1; -@@ -123,8 +130,12 @@ jint os_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray, - return -1; - } - -+#if defined(__OpenBSD__) -+ mib[5] = bufSize / sizeof(struct kinfo_proc); -+#endif -+ - // Read process info for all processes -- if (sysctl(mib, 4, buffer, &bufSize, NULL, 0) < 0) { -+ if (sysctl(mib, namelen, buffer, &bufSize, NULL, 0) < 0) { - JNU_ThrowByNameWithLastError(env, - "java/lang/RuntimeException", "sysctl failed"); - free(buffer); -@@ -204,9 +215,15 @@ pid_t os_getParentPidAndTimings(JNIEnv *env, pid_t jpid, - size_t bufSize = sizeof kp; - - // Read the process info for the specific pid -+#if defined(__OpenBSD__) -+ u_int namelen = 6; -+ int mib[6] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid, bufSize, 1}; -+#else -+ u_int namelen = 4; - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; -+#endif - -- if (sysctl(mib, 4, &kp, &bufSize, NULL, 0) == -1) { -+ if (sysctl(mib, namelen, &kp, &bufSize, NULL, 0) == -1) { - /* - * Check errno and throw an exception only if appropriate. - * -@@ -232,13 +249,13 @@ pid_t os_getParentPidAndTimings(JNIEnv *env, pid_t jpid, - ppid = kp.KI_PPID; - } - -- // Get cputime if for current process -- if (pid == getpid()) { - #ifdef __OpenBSD__ -- jlong microsecs = kp.p_uutime_sec * 1000 * 1000 + kp.p_uutime_usec + -- kp.p_ustime_sec * 1000 * 1000 + kp.p_ustime_usec; -- *totalTime = microsecs * 1000; -+ jlong microsecs = kp.p_uutime_sec * 1000 * 1000 + kp.p_uutime_usec + -+ kp.p_ustime_sec * 1000 * 1000 + kp.p_ustime_usec; -+ *totalTime = microsecs * 1000; - #else -+ // Get cputime if for current process -+ if (pid == getpid()) { - struct rusage usage; - if (getrusage(RUSAGE_SELF, &usage) == 0) { - jlong microsecs = -@@ -246,8 +263,8 @@ pid_t os_getParentPidAndTimings(JNIEnv *env, pid_t jpid, - usage.ru_stime.tv_sec * 1000 * 1000 + usage.ru_stime.tv_usec; - *totalTime = microsecs * 1000; - } --#endif - } -+#endif - - return ppid; - } -@@ -260,9 +277,15 @@ static uid_t getUID(pid_t pid) { - size_t bufSize = sizeof kp; - - // Read the process info for the specific pid -+#if defined(__OpenBSD__) -+ u_int namelen = 6; -+ int mib[6] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid, bufSize, 1}; -+#else -+ u_int namelen = 4; - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; -+#endif - -- if (sysctl(mib, 4, &kp, &bufSize, NULL, 0) == 0) { -+ if (sysctl(mib, namelen, &kp, &bufSize, NULL, 0) == 0) { - if (bufSize > 0 && kp.KI_PID == pid) { - return kp.KI_UID; - } -@@ -275,22 +298,121 @@ static uid_t getUID(pid_t pid) { - * into the Info object. - */ - void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) { -- int mib[4], maxargs, nargs, i; -+ int mib[4], nargs, i; - size_t size; -- char *args, *cp, *sp, *np; -+ char *args; - - // Get the UID first. This is done here because it is cheap to do it here - // on other platforms like Linux/Solaris/AIX where the uid comes from the - // same source like the command line info. - unix_getUserInfo(env, jinfo, getUID(pid)); - -+#ifdef __OpenBSD__ -+ // Get the buffer size needed -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_PROC_ARGS; -+ mib[2] = pid; -+ mib[3] = KERN_PROC_ARGV; -+ -+ if (sysctl(mib, 4, NULL, &size, NULL, 0) == -1) { -+ JNU_ThrowByNameWithLastError(env, -+ "java/lang/RuntimeException", "sysctl failed"); -+ return; -+ } -+ -+ // Allocate space for args and get the arguments -+ args = (char *)malloc(size); -+ if (args == NULL) { -+ JNU_ThrowOutOfMemoryError(env, "malloc failed"); -+ return; -+ } -+ -+ do { // a block to break out of on error -+ char **argv; -+ jstring cmdexe = NULL; -+ jclass clazzString; -+ jobject argsArray; -+ -+ if (sysctl(mib, 4, args, &size, NULL, 0) == -1) { -+ if (errno != EINVAL) { -+ JNU_ThrowByNameWithLastError(env, -+ "java/lang/RuntimeException", "sysctl failed"); -+ } -+ break; -+ } -+ -+ // count the number of argv elements -+ argv = (char **)args; -+ nargs = 0; -+ while (*argv++) -+ nargs++; -+ -+ if (nargs < 1) -+ break; -+ -+ // reset argv and store command executable path -+ argv = (char **)args; -+ if ((cmdexe = JNU_NewStringPlatform(env, *argv++)) == NULL) -+ break; -+ (*env)->SetObjectField(env, jinfo, ProcessHandleImpl_Info_commandID, cmdexe); -+ if ((*env)->ExceptionCheck(env)) -+ break; -+ nargs--; -+ -+ // process remaining arguments -+ // Create a String array for nargs elements -+ if ((clazzString = JNU_ClassString(env)) == NULL) -+ break; -+ if ((argsArray = (*env)->NewObjectArray(env, nargs, clazzString, NULL)) == NULL) -+ break; -+ -+ for (i = 0; i < nargs; i++) { -+ jstring str; -+ if ((str = JNU_NewStringPlatform(env, argv[i])) == NULL) -+ break; -+ -+ (*env)->SetObjectArrayElement(env, argsArray, i, str); -+ if ((*env)->ExceptionCheck(env)) -+ break; -+ } -+ if (i == nargs) // no errors in for loop? -+ (*env)->SetObjectField(env, jinfo, ProcessHandleImpl_Info_argumentsID, argsArray); -+ } while (0); -+ // Free the arg buffer -+ free(args); -+#else -+ int maxargs; -+ char cmd[MAXPATHLEN]; -+ jstring cmdexe = NULL; -+ -+ // Get the resolved name of the executable -+ size = sizeof(cmd); -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_PROC; -+ mib[2] = KERN_PROC_PATHNAME; -+ mib[3] = pid; -+ if (sysctl(mib, 4, cmd, &size, NULL, 0) == -1) { -+ if (errno != EINVAL && errno != ESRCH && errno != EPERM) { -+ JNU_ThrowByNameWithLastError(env, -+ "java/lang/RuntimeException", "sysctl failed"); -+ } -+ return; -+ } -+ // Make sure it is null terminated -+ cmd[MAXPATHLEN - 1] = '\0'; -+ -+ // Store the command executable -+ if ((cmdexe = JNU_NewStringPlatform(env, cmd)) == NULL) { -+ return; -+ } -+ - // Get the maximum size of the arguments - mib[0] = CTL_KERN; - mib[1] = KERN_ARGMAX; - size = sizeof(maxargs); - if (sysctl(mib, 2, &maxargs, &size, NULL, 0) == -1) { -- JNU_ThrowByNameWithLastError(env, -- "java/lang/RuntimeException", "sysctl failed"); -+ JNU_ThrowByNameWithLastError(env, -+ "java/lang/RuntimeException", "sysctl failed"); - return; - } - -@@ -301,51 +423,44 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) { - return; - } - -- do { // a block to break out of on error -- char *argsEnd; -- jstring cmdexe = NULL; -- unsigned namelen; -+ // A block to break out of on error -+ do { -+ char *cp, *argsEnd = NULL; - - mib[0] = CTL_KERN; --#if defined(__OpenBSD__) -- mib[1] = KERN_PROC_ARGS; -- mib[2] = pid; -- namelen = 3; --#elif defined(__FreeBSD__) -- mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_ARGS; - mib[3] = pid; -- namelen = 4; --#endif - size = (size_t) maxargs; -- if (sysctl(mib, namelen, args, &size, NULL, 0) == -1) { -- if (errno != EINVAL) { -+ if (sysctl(mib, 4, args, &size, NULL, 0) == -1) { -+ if (errno != EINVAL && errno != ESRCH && errno != EPERM) { - JNU_ThrowByNameWithLastError(env, - "java/lang/RuntimeException", "sysctl failed"); - } - break; - } -- memcpy(&nargs, args, sizeof(nargs)); - -- cp = &args[sizeof(nargs)]; // Strings start after nargs -- argsEnd = &args[size]; -+ // At this point args should hold a flattened argument string with -+ // arguments delimited by NUL and size should hold the overall length -+ // of the string - -- // Store the command executable path -- if ((cmdexe = JNU_NewStringPlatform(env, cp)) == NULL) { -- break; -- } -+ // Make sure the string is NUL terminated -+ args[size] = '\0'; - -- // Skip trailing nulls after the executable path -- for (cp = cp + strnlen(cp, argsEnd - cp); cp < argsEnd; cp++) { -- if (*cp != '\0') { -- break; -- } -+ // Count the number of arguments -+ nargs = 0; -+ argsEnd = &args[size]; -+ for (cp = args; *cp != '\0' && (cp < argsEnd); nargs++) { -+ cp += strnlen(cp, (argsEnd - cp)) + 1; - } - -- unix_fillArgArray(env, jinfo, nargs, cp, argsEnd, cmdexe, NULL); -+ // Copy over all the args -+ cp = args; -+ unix_fillArgArray(env, jinfo, nargs, cp, argsEnd, cmdexe, args); - } while (0); -+ - // Free the arg buffer - free(args); -+#endif - } - Property changes on: head/java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk =================================================================== --- head/java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk (revision 497063) +++ head/java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk (nonexistent) @@ -1,77 +0,0 @@ ---- make/lib/Awt2dLibraries.gmk -+++ make/lib/Awt2dLibraries.gmk -@@ -364,7 +364,7 @@ endif - ################################################################################ - - # The fast floor code loses precision. --LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR -+LCMS_CFLAGS+=-DCMS_DONT_USE_FAST_FLOOR - - LCMS_CFLAGS_JDKLIB := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) - -@@ -417,7 +417,6 @@ $(BUILD_LIBLCMS): $(BUILD_LIBAWT) - # work because we have to declare all variables as volatile in result. - - ifeq ($(USE_EXTERNAL_LIBJPEG), true) -- LIBJPEG_LIBS := -ljpeg - BUILD_LIBJAVAJPEG_INCLUDE_FILES := \ - imageioJPEG.c \ - jpegdecoder.c -@@ -425,7 +424,6 @@ ifeq ($(USE_EXTERNAL_LIBJPEG), true) - # as includes, instead the system headers should be used. - LIBJPEG_HEADERS_FROM_SRC := false - else -- LIBJPEG_LIBS := - BUILD_LIBJAVAJPEG_INCLUDE_FILES := - endif - -@@ -433,12 +431,12 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \ - NAME := javajpeg, \ - INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \ - OPTIMIZATION := HIGHEST, \ -- CFLAGS := $(CFLAGS_JDKLIB), \ -+ CFLAGS := $(CFLAGS_JDKLIB) $(JPEG_CFLAGS), \ - HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \ - DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \ - LDFLAGS := $(LDFLAGS_JDKLIB) \ - $(call SET_SHARED_LIBRARY_ORIGIN), \ -- LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \ -+ LIBS := $(JDKLIB_LIBS) $(JPEG_LIBS), \ - LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \ - )) - -@@ -766,7 +764,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) - LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib - else - LIBSPLASHSCREEN_EXCLUDES := giflib -- GIFLIB_LIBS := -lgif - endif - - ifeq ($(USE_EXTERNAL_LIBJPEG), false) -@@ -774,8 +771,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) - # additions to this library, and this was not done previously in the build. - # LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg - LIBSPLASHSCREEN_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg -- else -- LIBJPEG_LIBS := -ljpeg - endif - - ifeq ($(USE_EXTERNAL_LIBPNG), false) -@@ -855,7 +850,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) - EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \ - OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) $(LIBSPLASHSCREEN_CFLAGS) \ -- $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \ -+ $(GIFLIB_CFLAGS) $(JPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \ - EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \ - DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \ - maybe-uninitialized shift-negative-value implicit-fallthrough, \ -@@ -869,7 +864,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) - LDFLAGS_windows := -delayload:user32.dll, \ - LDFLAGS_bsd := $(ICONV_LDFLAGS), \ - LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \ -- $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \ -+ $(GIFLIB_LIBS) $(JPEG_LIBS) $(PNG_LIBS), \ - LIBS_aix := -liconv, \ - )) - Property changes on: head/java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-make_autoconf_platform.m4 =================================================================== --- head/java/openjdk11/files/patch-make_autoconf_platform.m4 (revision 497063) +++ head/java/openjdk11/files/patch-make_autoconf_platform.m4 (nonexistent) @@ -1,11 +0,0 @@ ---- make/autoconf/platform.m4 -+++ make/autoconf/platform.m4 -@@ -497,6 +497,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER], - OPENJDK_$1_OS_INCLUDE_SUBDIR="win32" - elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - OPENJDK_$1_OS_INCLUDE_SUBDIR="darwin" -+ elif test "x$OPENJDK_TARGET_OS" = "xbsd"; then -+ OPENJDK_$1_OS_INCLUDE_SUBDIR=`echo ${OPENJDK_TARGET_OS_ENV} | cut -d'.' -f2` - fi - AC_SUBST(OPENJDK_$1_OS_INCLUDE_SUBDIR) - ]) Property changes on: head/java/openjdk11/files/patch-make_autoconf_platform.m4 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-make_autoconf_spec.gmk.in =================================================================== --- head/java/openjdk11/files/patch-make_autoconf_spec.gmk.in (revision 497063) +++ head/java/openjdk11/files/patch-make_autoconf_spec.gmk.in (nonexistent) @@ -1,14 +0,0 @@ ---- make/autoconf/spec.gmk.in -+++ make/autoconf/spec.gmk.in -@@ -746,7 +746,11 @@ TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@ - ENABLE_AOT:=@ENABLE_AOT@ - ENABLE_INTREE_EC:=@ENABLE_INTREE_EC@ - USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ -+JPEG_CFLAGS:=@JPEG_CFLAGS@ -+JPEG_LIBS:=@JPEG_LIBS@ - USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ -+GIFLIB_CFLAGS:=@GIFLIB_CFLAGS@ -+GIFLIB_LIBS:=@GIFLIB_LIBS@ - USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ - LIBZ_CFLAGS:=@LIBZ_CFLAGS@ - LIBZ_LIBS:=@LIBZ_LIBS@ Property changes on: head/java/openjdk11/files/patch-make_autoconf_spec.gmk.in ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/java/openjdk11/files/patch-make_autoconf_libraries.m4 =================================================================== --- head/java/openjdk11/files/patch-make_autoconf_libraries.m4 (revision 497063) +++ head/java/openjdk11/files/patch-make_autoconf_libraries.m4 (revision 497064) @@ -1,19 +1,15 @@ ---- make/autoconf/libraries.m4 -+++ make/autoconf/libraries.m4 -@@ -181,9 +181,13 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], - LIBS="$save_LIBS" - - if test "x$OPENJDK_TARGET_OS" = "xbsd"; then -- if test "x$OPENJDK_TARGET_OS_ENV" = "xbsd.openbsd"; then -- ICONV_CFLAGS="-I$PACKAGE_PATH/include" -- ICONV_LDFLAGS="-L$PACKAGE_PATH/lib" -+ if test "x$OPENJDK_TARGET_OS_ENV" = "xbsd.freebsd"; then +--- make/autoconf/libraries.m4.orig 2019-03-28 16:54:58.823145000 -0700 ++++ make/autoconf/libraries.m4 2019-03-28 16:55:45.533206000 -0700 +@@ -186,9 +186,9 @@ + ICONV_LDFLAGS="-L/usr/local/lib" + ICONV_LIBS=-liconv + else +- ICONV_CFLAGS= +- ICONV_LDFLAGS= +- ICONV_LIBS= + ICONV_CFLAGS=%%ICONV_CFLAGS%% + ICONV_LDFLAGS=%%ICONV_LDFLAGS%% + ICONV_LIBS=%%ICONV_LIBS%% -+ elif test "x$OPENJDK_TARGET_OS_ENV" = "xbsd.openbsd"; then -+ ICONV_CFLAGS="-I/usr/local/include" -+ ICONV_LDFLAGS="-L/usr/local/lib" - ICONV_LIBS=-liconv - else - ICONV_CFLAGS= + fi + else + ICONV_CFLAGS= Index: head/java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp =================================================================== --- head/java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp (revision 497063) +++ head/java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp (revision 497064) @@ -1,14 +1,11 @@ ---- src/hotspot/os/bsd/os_bsd.cpp -+++ src/hotspot/os/bsd/os_bsd.cpp -@@ -377,8 +377,10 @@ void os::init_system_properties_values() { - #ifndef DEFAULT_LIBPATH - #ifdef __APPLE__ - #define DEFAULT_LIBPATH "/lib:/usr/lib" -+#elif defined(__NetBSD__) -+ #define DEFAULT_LIBPATH "/usr/lib:/usr/pkg/lib" +--- src/hotspot/os/bsd/os_bsd.cpp.orig 2019-03-27 13:28:54.000000000 -0700 ++++ src/hotspot/os/bsd/os_bsd.cpp 2019-03-28 16:46:31.000797000 -0700 +@@ -380,7 +380,7 @@ + #elif defined(__NetBSD__) + #define DEFAULT_LIBPATH "/usr/lib:/usr/pkg/lib" #else -- #define DEFAULT_LIBPATH "/usr/lib:" PACKAGE_PATH "/lib" +- #define DEFAULT_LIBPATH "/usr/lib:/usr/local/lib" + #define DEFAULT_LIBPATH "/usr/lib:%%LOCALBASE%%/lib" #endif #endif