changeset 8456:76a7c0bc74fd

6604021: RMIC is defaulting to BOOT jdk version, needs to be rmic.jar Reviewed-by: dholmes, chegar
author erikj
date Wed, 16 Oct 2013 13:50:13 +0200
parents a70aab9b373e
children e078fd8a78f6
files makefiles/GendataBreakIterator.gmk makefiles/GenerateClasses.gmk makefiles/Setup.gmk src/share/classes/sun/tools/tree/Node.java
diffstat 4 files changed, 43 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/makefiles/GendataBreakIterator.gmk	Wed Oct 16 14:39:00 2013 +0800
+++ b/makefiles/GendataBreakIterator.gmk	Wed Oct 16 13:50:13 2013 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, 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
@@ -44,17 +44,17 @@
 BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator
 BREAK_ITERATOR_CLASSES = $(BREAK_ITERATOR_DIR)/classes
 
-# JAVAC_SOURCE_PATH_UGLY_OVERRIDE is set to isolate the compile to just those
+# JAVAC_SOURCE_PATH_OVERRIDE is set to isolate the compile to just those
 # two files in that directory and not get anything implicit from
-# surrounding directories which aren't jdk 6 compatible. 
-# Because we are targeting jdk 6, but the surrounding source code is jdk 7. Ugh.
+# surrounding directories which aren't jdk N-1 compatible.
+# Because we are targeting jdk N-1, but the surrounding source code is jdk N.
 # These two files should be moved out to a build tool! We have to disable
 # sjavac here as well.
 $(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR,\
 		SETUP:=GENERATE_OLDBYTECODE,\
 		SRC:=$(TEXT_SRCDIR),\
 		DISABLE_SJAVAC:=true,\
-		JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=$(TEXT_SRCDIR)/$(TEXT_PKG),\
+    JAVAC_SOURCE_PATH_OVERRIDE := $(TEXT_SRCDIR)/$(TEXT_PKG), \
 		INCLUDES:=$(TEXT_PKG),\
 		INCLUDE_FILES:=$(TEXT_SOURCES),\
 		BIN:=$(BREAK_ITERATOR_CLASSES)))
--- a/makefiles/GenerateClasses.gmk	Wed Oct 16 14:39:00 2013 +0800
+++ b/makefiles/GenerateClasses.gmk	Wed Oct 16 13:50:13 2013 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, 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
@@ -28,12 +28,33 @@
 include $(SPEC)
 include MakeBase.gmk
 include RMICompilation.gmk
+include JavaCompilation.gmk
+include Setup.gmk
 
-# To ensure the latest stub generator files are picked up from corba repo
-# when available, we need to run with latest rmic version available. 
-ifneq ($(COMPILE_TYPE),cross)
-    RMIC := $(FIXPATH) $(JDK_OUTPUTDIR)/bin/rmic
-endif  
+##########################################################################################
+
+RMIC_PKGS := \
+    sun/rmi/rmic \
+    sun/tools/asm \
+    sun/tools/java \
+    sun/tools/javac \
+    sun/tools/tree \
+    sun/tools/util \
+    #
+
+$(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_RMIC, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(JDK_TOPDIR)/src/share/classes, \
+    INCLUDES := $(RMIC_PKGS), \
+    BIN := $(JDK_OUTPUTDIR)/btclasses_rmic, \
+    COPY := .properties, \
+    JAVAC_SOURCE_PATH_OVERRIDE := $(addprefix $(JDK_TOPDIR)/src/share/classes/, $(RMIC_PKGS))))
+
+##########################################################################################
+
+BTRMIC_CP := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar$(PATH_SEP)$(JDK_OUTPUTDIR)/btclasses_rmic$(PATH_SEP)$(BOOTSTRAP_JAVAC_JAR)
+BTRMIC_ARGS := "-Xbootclasspath/p:$(BTRMIC_CP)" -cp $(BTRMIC_CP)
+RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main
 
 CLASSES_DIR := $(JDK_OUTPUTDIR)/classes
 # NOTE: If the smart javac dependency management is reintroduced, these classes risk 
@@ -91,6 +112,8 @@
 
 ##########################################################################################
 
+$(RMI_12) $(RMI_11) $(RMI_IIOP) $(RMI_SRC): $(BUILD_BOOTSTRAP_RMIC)
+
 $(RMIC_GENSRC_DIR)/_the.classes.removed: $(GENCLASSES)
 	$(FIND) $(RMIC_GENSRC_DIR) -name "*.class" $(FIND_DELETE)
 	$(TOUCH) $@
--- a/makefiles/Setup.gmk	Wed Oct 16 14:39:00 2013 +0800
+++ b/makefiles/Setup.gmk	Wed Oct 16 13:50:13 2013 +0200
@@ -29,13 +29,18 @@
 # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" 
 JAVAC_WARNINGS:=-Xlint:-unchecked,-deprecation,-overrides,classfile,dep-ann,divzero,varargs -Werror
 
+# Any java code executed during a JDK build to build other parts of the JDK must be 
+# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
+# purpose must be built with -target PREVIOUS for bootstrapping purposes, which 
+# requires restricting to language level and api of previous JDK.
+#
 # The generate old bytecode javac setup uses the new compiler to compile for the
 # boot jdk to generate tools that need to be run with the boot jdk.
-# Thus we force the target bytecode to 7.
+# Thus we force the target bytecode to the previous JDK version.
 $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\
      JVM:=$(JAVA),\
      JAVAC:=$(NEW_JAVAC),\
-     FLAGS:=-source 7 -target 7 -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS),\
+    FLAGS := $(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS), \
      SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
      SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
 
--- a/src/share/classes/sun/tools/tree/Node.java	Wed Oct 16 14:39:00 2013 +0800
+++ b/src/share/classes/sun/tools/tree/Node.java	Wed Oct 16 13:50:13 2013 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, 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
@@ -108,7 +108,7 @@
             return super.clone();
         } catch (CloneNotSupportedException e) {
             // this shouldn't happen, since we are Cloneable
-            throw new InternalError(e);
+            throw (InternalError) new InternalError().initCause(e);
         }
     }