changeset 2792:f3e2e94ffb13 icedtea-2.5.6pre01

PR2367: 7 no longer builds with 6 - Util is not public in sun.management 2015-07-13 Andrew John Hughes <gnu.andrew@member.fsf.org> PR2367: 7 no longer builds with 6 - Util is not public in sun.management * Makefile.am: (ICEDTEA_BOOTSTRAP_CLASSES): Pre-build sun.management.Util if running on an Oracle JDK with an inaccessible version. (ICEDTEA_BOOT_PATCHES): Add -Xprefer:source patch. * NEWS: Updated. * configure.ac: Check for sun.management.Util class. * patches/boot/prefer_source.patch: Add -Xprefer:source option to javac invocations for sun.security.other, java.util.jar, sun.security.pkcs11, com.sun.crypto.provider and sun.nio.cs so that newer interfaces in OpenJDK 7 are picked up instead of outdated boot JDK ones.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Mon, 13 Jul 2015 23:58:47 +0100
parents a3302a9d4386
children 9e113aaecdb2
files ChangeLog Makefile.am NEWS configure.ac patches/boot/prefer_source.patch
diffstat 5 files changed, 87 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jul 07 16:56:52 2015 +0100
+++ b/ChangeLog	Mon Jul 13 23:58:47 2015 +0100
@@ -1,3 +1,23 @@
+2015-07-13  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	PR2367: 7 no longer builds with 6 - Util is
+	not public in sun.management
+	* Makefile.am:
+	(ICEDTEA_BOOTSTRAP_CLASSES): Pre-build
+	sun.management.Util if running on an
+	Oracle JDK with an inaccessible version.
+	(ICEDTEA_BOOT_PATCHES): Add -Xprefer:source
+	patch.
+	* NEWS: Updated.
+	* configure.ac:
+	Check for sun.management.Util class.
+	* patches/boot/prefer_source.patch:
+	Add -Xprefer:source option to javac invocations
+	for sun.security.other, java.util.jar,
+	sun.security.pkcs11, com.sun.crypto.provider and
+	sun.nio.cs so that newer interfaces in OpenJDK 7
+	are picked up instead of outdated boot JDK ones.
+
 2015-07-07  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	* configure.ac: Set version to 2.5.6pre01.
--- a/Makefile.am	Tue Jul 07 16:56:52 2015 +0100
+++ b/Makefile.am	Mon Jul 13 23:58:47 2015 +0100
@@ -120,6 +120,15 @@
 	$(SHARE)/javax/rmi/ssl/SslRMIServerSocketFactory.java
 endif
 
+#IT2367 - Util is not public in sun.management; cannot be accessed from outside package
+if LACKS_SUN_MANAGEMENT_UTIL
+# Presence of com.sun.mirror API indicates an Oracle JDK with a private sun.management.Util
+if !LACKS_COM_SUN_MIRROR_TYPE_TYPEMIRROR
+ICEDTEA_BOOTSTRAP_CLASSES += \
+	$(SHARE)/sun/management/Util.java
+endif
+endif
+
 # Settings for javac
 
 if NO_BYTECODE7
@@ -319,7 +328,8 @@
 	patches/boot/ecj-trywithresources.patch \
 	patches/boot/ecj-autoboxing.patch \
 	patches/boot/xsltproc.patch \
-	patches/boot/ecj-odd.patch
+	patches/boot/ecj-odd.patch \
+	patches/boot/prefer_source.patch
 
 if !DISABLE_BOOTSTRAP_TOOLS
 ICEDTEA_BOOT_PATCHES += \
--- a/NEWS	Tue Jul 07 16:56:52 2015 +0100
+++ b/NEWS	Mon Jul 13 23:58:47 2015 +0100
@@ -28,6 +28,7 @@
 * Bug fixes
   - PR2328: GCJ uses ppc64el named libarch directory on ppc64le
   - PR2341: Update README & INSTALL files
+  - PR2367: 7 no longer builds with 6 - Util is not public in sun.management
   - PR2395: Path to jvm.cfg is wrong in add-systemtap-boot
 * PPC & AIX port
   - S8069590: AIX port of "8050807: Better performing performance data handling"
--- a/configure.ac	Tue Jul 07 16:56:52 2015 +0100
+++ b/configure.ac	Mon Jul 13 23:58:47 2015 +0100
@@ -148,6 +148,10 @@
 dnl Check whether the HTTP server API is present in the bootstrap JDK, required by JAXWS
 IT_CHECK_FOR_CLASS([COM_SUN_NET_HTTPSERVER_HEADERS], [com.sun.net.httpserver.Headers])
 
+dnl Check whether sun.management.Util is present in the bootstrap JDK, as the in-tree
+dnl version must be used
+IT_CHECK_FOR_CLASS([SUN_MANAGEMENT_UTIL], [sun.management.Util])
+
 dnl Check whether the JDK can parse the dates used in the currency file
 IT_PR64174_CHECK
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/prefer_source.patch	Mon Jul 13 23:58:47 2015 +0100
@@ -0,0 +1,51 @@
+--- openjdk-boot.orig/jdk/make/java/jar/Makefile	2015-04-10 15:45:22.924158352 +0100
++++ openjdk-boot/jdk/make/java/jar/Makefile	2015-07-13 21:00:08.802942914 +0100
+@@ -26,6 +26,7 @@
+ BUILDDIR = ../..
+ PACKAGE = java.util.jar
+ PRODUCT = sun
++OTHER_JAVACFLAGS += -Xprefer:source
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ #
+--- openjdk-boot.orig/jdk/make/sun/security/other/Makefile	2015-04-10 15:45:23.332162376 +0100
++++ openjdk-boot/jdk/make/sun/security/other/Makefile	2015-07-13 21:43:46.637311660 +0100
+@@ -26,6 +26,7 @@
+ BUILDDIR = ../../..
+ PACKAGE = sun.security.other
+ PRODUCT = sun
++OTHER_JAVACFLAGS += -Xprefer:source
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ #
+--- openjdk-boot.orig/jdk/make/sun/security/pkcs11/Makefile	2015-04-10 15:45:23.332162376 +0100
++++ openjdk-boot/jdk/make/sun/security/pkcs11/Makefile	2015-07-13 22:10:21.433512900 +0100
+@@ -92,6 +92,7 @@
+ PACKAGE = sun.security.pkcs11
+ LIBRARY = j2pkcs11
+ PRODUCT = sun
++OTHER_JAVACFLAGS += -Xprefer:source
+ 
+ #
+ # The following is for when we need to do postprocessing
+--- openjdk-boot.orig/jdk/make/com/sun/crypto/provider/Makefile	2015-04-10 15:45:22.740156537 +0100
++++ openjdk-boot/jdk/make/com/sun/crypto/provider/Makefile	2015-07-13 22:28:28.630562057 +0100
+@@ -95,6 +95,7 @@
+ BUILDDIR = ../../../..
+ PACKAGE = com.sun.crypto.provider
+ PRODUCT = sun
++OTHER_JAVACFLAGS += -Xprefer:source
+ 
+ #
+ # The following is for when we need to do postprocessing
+--- openjdk-boot.orig/jdk/make/sun/nio/cs/Makefile	2015-04-10 15:45:23.320162258 +0100
++++ openjdk-boot/jdk/make/sun/nio/cs/Makefile	2015-07-13 22:12:44.291022762 +0100
+@@ -36,7 +36,7 @@
+ # This re-directs all the class files to a separate location
+ CLASSDESTDIR = $(TEMPDIR)/classes
+ 
+-OTHER_JAVACFLAGS += -Xlint:serial,-deprecation
++OTHER_JAVACFLAGS += -Xlint:serial,-deprecation -Xprefer:source
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ #