changeset 2714:b9b6ccc93bdc

PR1756: Bootstrap with IcedTea broken 2014-05-01 Andrew John Hughes <gnu.andrew@member.fsf.org> PR1756: Bootstrap with IcedTea broken * Makefile.am: (ICEDTEA_BOOT_PATCHES): Only apply ant-javac.patch when using bootstrap tools. Only patch JAXWS build when the bootstrap JDK doesn't have the com.sun.* classes it requires. Split the root patch in corba-dependencies.patch into its own file. * NEWS: Updated. * acinclude.m4: (IT_CHECK_FOR_JDK): Make DEFUN_ONCE and fix typo. (IT_CHECK_FOR_CLASS): Depend on IT_CHECK_TOOLS_JAR_EXISTS and adds TOOLS_JAR to classpath. (IT_CHECK_TOOLS_JAR_EXISTS): Find a tools.jar so we can check for classes it contains. * configure.ac: Check for com.sun.mirror.type.TypeMirror and com.sun.net.httpserver.Headers, required by JAXWS. * patches/boot/corba-dependencies.patch: Remove root part of patch. * patches/boot/dependencies.patch: Root part of patch from corba-dependencies. * patches/boot/jaxws-jdk-dependency.patch: Regenerated. * patches/boot/jaxws-langtools-dependency.patch: Rewrite to use sources, not classes.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Thu, 05 Jun 2014 16:40:42 +0100
parents f164e91b0ca7
children 12240198c6be
files ChangeLog Makefile.am NEWS acinclude.m4 configure.ac patches/boot/corba-dependencies.patch patches/boot/dependencies.patch patches/boot/jaxws-jdk-dependency.patch patches/boot/jaxws-langtools-dependency.patch
diffstat 9 files changed, 163 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 05 03:11:26 2014 +0100
+++ b/ChangeLog	Thu Jun 05 16:40:42 2014 +0100
@@ -1,3 +1,31 @@
+2014-05-01  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	PR1756: Bootstrap with IcedTea broken
+	* Makefile.am:
+	(ICEDTEA_BOOT_PATCHES): Only apply ant-javac.patch
+	when using bootstrap tools. Only patch JAXWS build
+	when the bootstrap JDK doesn't have the com.sun.*
+	classes it requires. Split the root patch in
+	corba-dependencies.patch into its own file.
+	* NEWS: Updated.
+	* acinclude.m4:
+	(IT_CHECK_FOR_JDK): Make DEFUN_ONCE and fix typo.
+	(IT_CHECK_FOR_CLASS): Depend on IT_CHECK_TOOLS_JAR_EXISTS
+	and adds TOOLS_JAR to classpath.
+	(IT_CHECK_TOOLS_JAR_EXISTS): Find a tools.jar so
+	we can check for classes it contains.
+	* configure.ac:
+	Check for com.sun.mirror.type.TypeMirror and
+	com.sun.net.httpserver.Headers, required by JAXWS.
+	* patches/boot/corba-dependencies.patch:
+	Remove root part of patch.
+	* patches/boot/dependencies.patch:
+	Root part of patch from corba-dependencies.
+	* patches/boot/jaxws-jdk-dependency.patch:
+	Regenerated.
+	* patches/boot/jaxws-langtools-dependency.patch:
+	Rewrite to use sources, not classes.
+
 2014-04-16  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	* NEWS:
--- a/Makefile.am	Thu Jun 05 03:11:26 2014 +0100
+++ b/Makefile.am	Thu Jun 05 16:40:42 2014 +0100
@@ -307,7 +307,6 @@
 
 ICEDTEA_BOOT_PATCHES = \
 	patches/boot/javafiles.patch \
-	patches/boot/ant-javac.patch \
 	patches/boot/corba-idlj.patch \
 	patches/boot/corba-no-gen.patch \
 	patches/boot/corba-orb.patch \
@@ -328,9 +327,8 @@
 	patches/boot/revert-6941137.patch \
 	patches/boot/ecj-stringswitch.patch \
 	patches/boot/langtools-force-old-jdk.patch \
+	patches/boot/dependencies.patch \
 	patches/boot/corba-dependencies.patch \
-	patches/boot/jaxws-langtools-dependency.patch \
-	patches/boot/jaxws-jdk-dependency.patch \
 	patches/boot/hotspot-jdk-dependency.patch \
 	patches/boot/ecj-multicatch.patch \
 	patches/boot/ecj-trywithresources.patch \
@@ -340,7 +338,18 @@
 
 if !DISABLE_BOOTSTRAP_TOOLS
 ICEDTEA_BOOT_PATCHES += \
-	patches/boot/bootstrap-tools.patch
+	patches/boot/bootstrap-tools.patch \
+	patches/boot/ant-javac.patch
+endif
+
+if LACKS_COM_SUN_MIRROR_TYPE_TYPEMIRROR
+ICEDTEA_BOOT_PATCHES += \
+	patches/boot/jaxws-langtools-dependency.patch
+endif
+
+if LACKS_COM_SUN_NET_HTTPSERVER_HEADERS
+ICEDTEA_BOOT_PATCHES += \
+	patches/boot/jaxws-jdk-dependency.patch
 endif
 
 if !VM_SUPPORTS_XBOOTCLASSPATH
--- a/NEWS	Thu Jun 05 03:11:26 2014 +0100
+++ b/NEWS	Thu Jun 05 16:40:42 2014 +0100
@@ -272,6 +272,7 @@
   - PR1742: Allow SunEC provider to be built with changes in NSS >= 3.16.1
   - PR1762: Undefined references when building with NSS 3.16.1
   - PR1737: Support prefixed variants of GNU tools used on *BSD systems
+  - PR1756: Bootstrap with IcedTea broken
 * PPC & AIX port
   - Add AIX-specific build instructions to README-ppc.html
   - Added AIX as testing platform for more jtreg tests written in shell-script
--- a/acinclude.m4	Thu Jun 05 03:11:26 2014 +0100
+++ b/acinclude.m4	Thu Jun 05 16:40:42 2014 +0100
@@ -1152,7 +1152,7 @@
   AM_CONDITIONAL([BOOTSTRAPPING], test x"${enable_bootstrap}" = "xyes")
 ])
 
-AC_DEFUN([IT_CHECK_FOR_JDK],
+AC_DEFUN_ONCE([IT_CHECK_FOR_JDK],
 [
   AC_MSG_CHECKING([for a JDK home directory])
   AC_ARG_WITH([jdk-home],
@@ -1199,7 +1199,7 @@
     AC_MSG_RESULT(${SYSTEM_JDK_DIR})
   fi
   if ! test -d "${SYSTEM_JDK_DIR}"; then
-    AC_MSG_ERROR("A JDK JDK home directory could not be found.")
+    AC_MSG_ERROR("A JDK home directory could not be found.")
   fi
   AC_SUBST(SYSTEM_JDK_DIR)
 ])
@@ -1546,6 +1546,7 @@
 dnl e.g. IT_CHECK_FOR_CLASS([JAVA_UTIL_SCANNER],[java.util.Scanner])
 AC_DEFUN([IT_CHECK_FOR_CLASS],[
 AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK])
+AC_REQUIRE([IT_CHECK_TOOLS_JAR_EXISTS])
 AC_CACHE_CHECK([if $2 is missing], it_cv_$1, [
 CLASS=Test.java
 BYTECODE=$(echo $CLASS|sed 's#\.java##')
@@ -1562,8 +1563,12 @@
 }
 ]
 EOF
-if $JAVAC -cp . $JAVACFLAGS -source 5 -target 5 -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then
-  if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then
+TEST_CP=.
+if test "x$TOOLS_JAR" != x; then
+  TEST_CP=${TEST_CP}:${TOOLS_JAR}
+fi
+if $JAVAC -cp ${TEST_CP} $JAVACFLAGS -source 5 -target 5 -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then
+  if $JAVA -classpath ${TEST_CP} $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then
       it_cv_$1=no;
   else
       it_cv_$1=yes;
@@ -2736,3 +2741,36 @@
     AC_SUBST(SUNEC_LIBS)
   fi
 ])
+
+AC_DEFUN_ONCE([IT_CHECK_TOOLS_JAR_EXISTS],
+[
+  AC_MSG_CHECKING([for a tools.jar])
+  AC_ARG_WITH([tools-jar],
+	      [AS_HELP_STRING([--with-tools-jar[[=PATH]]],
+                              [location of tools JAR file (default is lib/tools.jar in the JDK being used)])],
+              [
+                if test "x${withval}" = xyes
+                then
+                  TOOLS_JAR=
+                elif test "x${withval}" = xno
+                then
+	          TOOLS_JAR=
+	        else
+                  TOOLS_JAR=${withval}
+                fi
+              ],
+              [
+	        TOOLS_JAR=
+              ])
+  if test -z "${TOOLS_JAR}"; then
+    AC_MSG_RESULT([not specified])
+    TOOLS_JAR=${SYSTEM_JDK_DIR}/lib/tools.jar;
+    AC_MSG_NOTICE([Using ${TOOLS_JAR} for tools.jar])
+  else
+    AC_MSG_RESULT(${TOOLS_JAR})
+  fi
+  if ! test -e "${TOOLS_JAR}"; then
+    AC_MSG_WARN("A tools.jar file could not be found.")
+  fi
+  AC_SUBST(TOOLS_JAR)
+])  
--- a/configure.ac	Thu Jun 05 03:11:26 2014 +0100
+++ b/configure.ac	Thu Jun 05 16:40:42 2014 +0100
@@ -144,6 +144,12 @@
   [null,null,null,true]
 )
 
+dnl Check whether the obsolete Mirror API is present in the bootstrap JDK, required by JAXWS
+IT_CHECK_FOR_CLASS([COM_SUN_MIRROR_TYPE_TYPEMIRROR], [com.sun.mirror.type.TypeMirror])
+
+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])
+
 IT_CHECK_ENABLE_WARNINGS
 IT_DIAMOND_CHECK
 IT_BYTECODE7_CHECK
--- a/patches/boot/corba-dependencies.patch	Thu Jun 05 03:11:26 2014 +0100
+++ b/patches/boot/corba-dependencies.patch	Thu Jun 05 16:40:42 2014 +0100
@@ -12,14 +12,3 @@
  	fi
  	@$(java-vm-cleanup)
  
-diff --git a/make/Defs-internal.gmk b/make/Defs-internal.gmk
---- openjdk-boot.orig/make/Defs-internal.gmk
-+++ openjdk-boot/make/Defs-internal.gmk
-@@ -305,6 +305,7 @@
- 
- # Common make arguments (supplied to all component builds)
- COMMON_BUILD_ARGUMENTS = \
-+    LANGTOOLS_TOPDIR=$(ABS_LANGTOOLS_TOPDIR) \
-     JDK_TOPDIR=$(ABS_JDK_TOPDIR) \
-     JDK_MAKE_SHARED_DIR=$(ABS_JDK_TOPDIR)/make/common/shared \
-     EXTERNALSANITYCONTROL=true \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/dependencies.patch	Thu Jun 05 16:40:42 2014 +0100
@@ -0,0 +1,11 @@
+diff --git a/make/Defs-internal.gmk b/make/Defs-internal.gmk
+--- openjdk-boot.orig/make/Defs-internal.gmk
++++ openjdk-boot/make/Defs-internal.gmk
+@@ -305,6 +305,7 @@
+ 
+ # Common make arguments (supplied to all component builds)
+ COMMON_BUILD_ARGUMENTS = \
++    LANGTOOLS_TOPDIR=$(ABS_LANGTOOLS_TOPDIR) \
+     JDK_TOPDIR=$(ABS_JDK_TOPDIR) \
+     JDK_MAKE_SHARED_DIR=$(ABS_JDK_TOPDIR)/make/common/shared \
+     EXTERNALSANITYCONTROL=true \
--- a/patches/boot/jaxws-jdk-dependency.patch	Thu Jun 05 03:11:26 2014 +0100
+++ b/patches/boot/jaxws-jdk-dependency.patch	Thu Jun 05 16:40:42 2014 +0100
@@ -1,42 +1,41 @@
 diff -Nru openjdk-boot.orig/jaxws/build.properties openjdk-boot/jaxws/build.properties
---- openjdk-boot.orig/jaxws/build.properties	2012-06-11 14:30:27.904723311 +0100
-+++ openjdk-boot/jaxws/build.properties	2012-06-11 14:38:13.847981281 +0100
-@@ -62,6 +62,10 @@
- # JAXP built files
- jaxp.classes.dir=${output.dir}/../jaxp/build/classes
+--- openjdk-boot.orig/jaxws/build.properties	2014-04-30 21:13:09.461731412 +0100
++++ openjdk-boot/jaxws/build.properties	2014-04-30 21:15:05.711492067 +0100
+@@ -64,6 +64,9 @@
+ # Langtools sources
+ langtools.sources=${langtools.topdir}/src/share/classes
  
 +# JDK sources
-+
 +jdk.sources=${jdk.topdir}/src/share/classes:${jdk.topdir}/src/solaris/classes:${jdk.gensrcdir}
 +
  # Distributed results
  dist.dir=${output.dir}/dist
  dist.lib.dir=${dist.dir}/lib
-@@ -92,6 +96,8 @@
-   output.dir=${output.dir}${line.separator}\
+@@ -94,6 +97,7 @@
    build.dir=${build.dir}${line.separator}\
    dist.dir=${dist.dir}${line.separator}\
-+  jdk.topdir=${jdk.topdir}${line.separator}\
-+  jdk.gensrcdir=${jdk.gensrcdir}${line.separator}\
+   langtools.sources=${langtools.sources}${line.separator}\
++  jdk.sources=${jdk.sources}${line.separator}\
  ${line.separator}
  
  #------------------------------------------------------------
 diff -Nru openjdk-boot.orig/jaxws/build.xml openjdk-boot/jaxws/build.xml
---- openjdk-boot.orig/jaxws/build.xml	2012-06-11 14:30:27.904723311 +0100
-+++ openjdk-boot/jaxws/build.xml	2012-06-11 14:36:04.005990816 +0100
-@@ -138,6 +138,7 @@
-         <javac 
- 	     includeAntRuntime="false" 
- 	     classpath="${jaxp.classes.dir}:${build.classes.dir}:${langtools.jar}"
-+	     sourcepath="${jdk.sources}"
+--- openjdk-boot.orig/jaxws/build.xml	2014-04-30 21:13:09.461731412 +0100
++++ openjdk-boot/jaxws/build.xml	2014-04-30 21:15:49.100149136 +0100
+@@ -144,7 +144,7 @@
+         <javac
+ 	     includeAntRuntime="false"
+ 	     classpath="${jaxp.classes.dir}:${build.classes.dir}:${tools.jar}"
+-	     sourcepath="${langtools.sources}"
++	     sourcepath="${langtools.sources}:${jdk.sources}"
  	     fork="true"
               destdir="${build.classes.dir}"
               memoryInitialSize="${javac.memoryInitialSize}"
 diff -Nru openjdk-boot.orig/jaxws/make/Makefile openjdk-boot/jaxws/make/Makefile
---- openjdk-boot.orig/jaxws/make/Makefile	2012-06-11 14:30:27.904723311 +0100
-+++ openjdk-boot/jaxws/make/Makefile	2012-06-11 14:36:04.005990816 +0100
-@@ -123,6 +123,14 @@
-   endif
+--- openjdk-boot.orig/jaxws/make/Makefile	2014-04-30 21:13:09.461731412 +0100
++++ openjdk-boot/jaxws/make/Makefile	2014-04-30 21:15:29.343849955 +0100
+@@ -127,6 +127,14 @@
+   ANT_OPTIONS += -Dlangtools.topdir=$(LANGTOOLS_TOPDIR)
  endif
  
 +ifdef JDK_TOPDIR
@@ -50,8 +49,9 @@
  # Default target and expected 'do everything' target
  default: all
  
---- openjdk-boot.orig/make/jaxws-rules.gmk.orig	2013-05-07 13:46:03.172779265 +0100
-+++ openjdk-boot/make/jaxws-rules.gmk	2013-05-07 13:46:15.332968843 +0100
+diff -Nru openjdk-boot.orig/make/jaxws-rules.gmk openjdk-boot/make/jaxws-rules.gmk
+--- openjdk-boot.orig/make/jaxws-rules.gmk	2014-04-23 22:32:57.000000000 +0100
++++ openjdk-boot/make/jaxws-rules.gmk	2014-04-30 21:14:26.178893360 +0100
 @@ -31,7 +31,8 @@
     $(COMMON_BUILD_ARGUMENTS) \
     ALT_OUTPUTDIR=$(JAXWS_OUTPUTDIR) \
--- a/patches/boot/jaxws-langtools-dependency.patch	Thu Jun 05 03:11:26 2014 +0100
+++ b/patches/boot/jaxws-langtools-dependency.patch	Thu Jun 05 16:40:42 2014 +0100
@@ -1,48 +1,46 @@
-diff -Nru openjdk-boot.orig/jaxws/build.properties openjdk-boot/jaxws/build.properties
---- openjdk-boot.orig/jaxws/build.properties	2014-04-29 21:54:42.000000000 +0100
-+++ openjdk-boot/jaxws/build.properties	2014-06-04 05:58:57.680029474 +0100
-@@ -28,7 +28,8 @@
- # other tools, and product versions of all the tools.
- # Override this path as needed, either on the command line or in 
- # one of the standard user build.properties files (see build.xml)
--javac.jar=${bootstrap.dir}/lib/javac.jar
-+javac.jar=${langtools.dist}/bootstrap/lib/javac.jar
-+langtools.jar=${langtools.dist}/lib/classes.jar
+diff -r 8114c2755c90 build.properties
+--- openjdk-boot/jaxws/build.properties	Wed Apr 30 15:40:30 2014 +0100
++++ openjdk-boot/jaxws/build.properties	Wed Apr 30 21:06:30 2014 +0100
+@@ -61,6 +61,9 @@
+ # JAXP built files
+ jaxp.classes.dir=${output.dir}/../jaxp/build/classes
  
- # The tools.jar is needed in the classpath to compile these sources
- jdk.home=${java.home}/..
-@@ -77,8 +78,9 @@
-   os.name=${os.name}${line.separator}\
-   os.arch=${os.arch}${line.separator}\
-   os.version=${os.version}${line.separator}\
--  bootstrap.dir=${bootstrap.dir}${line.separator}\
-+  bootstrap.dir=${langtools.dist}/bootstrap${line.separator}\
-   javac.jar=${javac.jar}${line.separator}\
-+  langtools.jar=${langtools.jar}${line.separator}\
-   javac.memoryInitialSize=${javac.memoryInitialSize}${line.separator}\
-   javac.memoryMaximumSize=${javac.memoryMaximumSize}${line.separator}\
-   javac.source=${javac.source}${line.separator}\
-diff -Nru openjdk-boot.orig/jaxws/build.xml openjdk-boot/jaxws/build.xml
---- openjdk-boot.orig/jaxws/build.xml	2014-06-04 05:57:06.998462083 +0100
-+++ openjdk-boot/jaxws/build.xml	2014-06-04 05:58:57.684029530 +0100
-@@ -143,7 +143,7 @@
- 	-->
++# Langtools sources
++langtools.sources=${langtools.topdir}/src/share/classes
++
+ # Distributed results
+ dist.dir=${output.dir}/dist
+ dist.lib.dir=${dist.dir}/lib
+@@ -90,6 +93,7 @@
+   output.dir=${output.dir}${line.separator}\
+   build.dir=${build.dir}${line.separator}\
+   dist.dir=${dist.dir}${line.separator}\
++  langtools.sources=${langtools.sources}${line.separator}\
+ ${line.separator}
+ 
+ #------------------------------------------------------------
+diff -r 8114c2755c90 build.xml
+--- openjdk-boot/jaxws/build.xml	Wed Apr 30 15:40:30 2014 +0100
++++ openjdk-boot/jaxws/build.xml	Wed Apr 30 21:06:30 2014 +0100
+@@ -144,6 +144,7 @@
          <javac
  	     includeAntRuntime="false"
--	     classpath="${jaxp.classes.dir}:${build.classes.dir}:${tools.jar}"
-+	     classpath="${jaxp.classes.dir}:${build.classes.dir}:${langtools.jar}"
+ 	     classpath="${jaxp.classes.dir}:${build.classes.dir}:${tools.jar}"
++	     sourcepath="${langtools.sources}"
  	     fork="true"
               destdir="${build.classes.dir}"
               memoryInitialSize="${javac.memoryInitialSize}"
-diff -Nru openjdk-boot.orig/jaxws/make/Makefile openjdk-boot/jaxws/make/Makefile
---- openjdk-boot.orig/jaxws/make/Makefile	2014-04-29 21:54:42.000000000 +0100
-+++ openjdk-boot/jaxws/make/Makefile	2014-06-04 05:59:33.928542955 +0100
-@@ -103,7 +103,7 @@
-     ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
-     ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR) -Djava.home=$(ALT_BOOTDIR)
+diff -r 8114c2755c90 make/Makefile
+--- openjdk-boot/jaxws/make/Makefile	Wed Apr 30 15:40:30 2014 +0100
++++ openjdk-boot/jaxws/make/Makefile	Wed Apr 30 21:06:30 2014 +0100
+@@ -123,6 +123,10 @@
    endif
--  ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
-+  ANT_OPTIONS += -Dlangtools.dist=$(ALT_LANGTOOLS_DIST)
- else
-   ifdef ALT_JDK_IMPORT_PATH
-     ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
+ endif
+ 
++ifdef LANGTOOLS_TOPDIR
++  ANT_OPTIONS += -Dlangtools.topdir=$(LANGTOOLS_TOPDIR)
++endif
++
+ # Default target and expected 'do everything' target
+ default: all
+