diff options
author | glewis <glewis@FreeBSD.org> | 2019-03-29 09:05:26 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2019-03-29 09:05:26 +0800 |
commit | c067269eed43729d60d5492b41bbb35b50c2b5b5 (patch) | |
tree | c729a02450d314ce741feff0f6f8f9835412f179 /java/openjdk11 | |
parent | 4bb7382bc38e257f9cbe7c1cfc8554dcb0d06d70 (diff) | |
download | freebsd-ports-gnome-c067269eed43729d60d5492b41bbb35b50c2b5b5.tar.gz freebsd-ports-gnome-c067269eed43729d60d5492b41bbb35b50c2b5b5.tar.zst freebsd-ports-gnome-c067269eed43729d60d5492b41bbb35b50c2b5b5.zip |
. Update to 11.0.2.9.4
. Sort LIB_DEPENDS and USE_XORG
. Add a dependency in alsa-lib now that sound is supported on FreeBSD.
. Don't disable dtrace now that it is supported on FreeBSD.
. Less intrusive iconv change.
Diffstat (limited to 'java/openjdk11')
-rw-r--r-- | java/openjdk11/Makefile | 11 | ||||
-rw-r--r-- | java/openjdk11/distinfo | 6 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 | 11 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 | 99 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_autoconf_lib-cups.m4 | 17 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_autoconf_libraries.m4 | 28 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_autoconf_platform.m4 | 11 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_autoconf_spec.gmk.in | 14 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_autoconf_toolchain.m4 | 26 | ||||
-rw-r--r-- | java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk | 77 | ||||
-rw-r--r-- | java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp | 15 | ||||
-rw-r--r-- | java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c | 303 |
12 files changed, 26 insertions, 592 deletions
diff --git a/java/openjdk11/Makefile b/java/openjdk11/Makefile index c9a0e9d9a517..57e01f1dff25 100644 --- a/java/openjdk11/Makefile +++ b/java/openjdk11/Makefile @@ -2,7 +2,6 @@ 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} @@ -19,14 +18,15 @@ 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} @@ -54,14 +54,13 @@ 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} \ diff --git a/java/openjdk11/distinfo b/java/openjdk11/distinfo index 49b3879aa886..8c4db8d15c8e 100644 --- a/java/openjdk11/distinfo +++ b/java/openjdk11/distinfo @@ -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 diff --git a/java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 b/java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 deleted file mode 100644 index 0bddc82eb46e..000000000000 --- a/java/openjdk11/files/patch-make_autoconf_flags-cflags.m4 +++ /dev/null @@ -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_" diff --git a/java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 b/java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 deleted file mode 100644 index 3d0c6d9b186a..000000000000 --- a/java/openjdk11/files/patch-make_autoconf_lib-bundled.m4 +++ /dev/null @@ -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) - ]) - - ################################################################################ diff --git a/java/openjdk11/files/patch-make_autoconf_lib-cups.m4 b/java/openjdk11/files/patch-make_autoconf_lib-cups.m4 deleted file mode 100644 index c5956323ad1b..000000000000 --- a/java/openjdk11/files/patch-make_autoconf_lib-cups.m4 +++ /dev/null @@ -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 ]) diff --git a/java/openjdk11/files/patch-make_autoconf_libraries.m4 b/java/openjdk11/files/patch-make_autoconf_libraries.m4 index 4c3f45ca80d0..11f8769f67c6 100644 --- a/java/openjdk11/files/patch-make_autoconf_libraries.m4 +++ b/java/openjdk11/files/patch-make_autoconf_libraries.m4 @@ -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= diff --git a/java/openjdk11/files/patch-make_autoconf_platform.m4 b/java/openjdk11/files/patch-make_autoconf_platform.m4 deleted file mode 100644 index e68f3c68b116..000000000000 --- a/java/openjdk11/files/patch-make_autoconf_platform.m4 +++ /dev/null @@ -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) - ]) diff --git a/java/openjdk11/files/patch-make_autoconf_spec.gmk.in b/java/openjdk11/files/patch-make_autoconf_spec.gmk.in deleted file mode 100644 index 81bd674041b1..000000000000 --- a/java/openjdk11/files/patch-make_autoconf_spec.gmk.in +++ /dev/null @@ -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@ diff --git a/java/openjdk11/files/patch-make_autoconf_toolchain.m4 b/java/openjdk11/files/patch-make_autoconf_toolchain.m4 deleted file mode 100644 index 398dd48f6153..000000000000 --- a/java/openjdk11/files/patch-make_autoconf_toolchain.m4 +++ /dev/null @@ -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. diff --git a/java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk b/java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk deleted file mode 100644 index ef8b351998aa..000000000000 --- a/java/openjdk11/files/patch-make_lib_Awt2dLibraries.gmk +++ /dev/null @@ -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, \ - )) - diff --git a/java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp b/java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp index 6a7aef32df00..12b5485a527a 100644 --- a/java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp +++ b/java/openjdk11/files/patch-src_hotspot_os_bsd_os__bsd.cpp @@ -1,13 +1,10 @@ ---- 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 diff --git a/java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c b/java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c deleted file mode 100644 index e3dc961a17e9..000000000000 --- a/java/openjdk11/files/patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c +++ /dev/null @@ -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 <sys/sysctl.h> - - #ifdef __FreeBSD__ --#include <sys/user.h> // For kinfo_proc -+#include <sys/param.h> // For MAXPATHLEN -+#include <sys/user.h> // 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 - } - |