changeset 4439:7c5bc5a807ee

7024120: Verify reduced JRE contents for java 7 Summary: stripped all symbols from libs and executables to reduce JRE size. Restored missing classes needed to pass JCK in headless mode Reviewed-by: bobv, ohair
author dholmes
date Fri, 27 May 2011 19:04:48 -0400
parents 23bdcede4e39
children f4895b3fe1be
files make/common/Defs-embedded.gmk make/common/Release-embedded.gmk
diffstat 2 files changed, 30 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/Defs-embedded.gmk	Wed May 25 13:32:36 2011 -0700
+++ b/make/common/Defs-embedded.gmk	Fri May 27 19:04:48 2011 -0400
@@ -49,5 +49,16 @@
 JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image
 JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image
 
+# Override on linux to further reduce binary/lib sizes in product build
+ifeq ($(PLATFORM), linux)
+  ifeq ($(VARIANT), OPT)
+    ifneq ($(NO_STRIP), true)
+      ifneq ($(DEBUG_BINARIES), true)
+        POST_STRIP_PROCESS = $(STRIP) --strip-unneeded
+      endif
+    endif
+  endif
+endif
+
 endif # JAVASE_EMBEDDED
 
--- a/make/common/Release-embedded.gmk	Wed May 25 13:32:36 2011 -0700
+++ b/make/common/Release-embedded.gmk	Fri May 27 19:04:48 2011 -0400
@@ -53,25 +53,30 @@
 	$(RM) $(HEADLESS_CLASSLIST)
 	$(RM) $(NOT_HEADLESS_RT_JAR_LIST)
 	$(CP) $(NOT_RT_JAR_LIST) $(NOT_HEADLESS_RT_JAR_LIST)
+# List all the packages to be excluded
 	$(ECHO) "sun/awt/motif/" >> $@
 	$(ECHO) "sun/awt/X11/" >> $@
 	$(ECHO) "sun/applet/" >> $@
 	$(ECHO) "sun/java2d/opengl/" >> $@
 	$(ECHO) "com/sun/java/swing/plaf/" >> $@
-	$(ECHO) "sun/awt/motif/MFontConfiguration" >$(HEADLESS_CLASSLIST)
-	$(ECHO) "sun/applet/AppContextCreator" >>$(HEADLESS_CLASSLIST)
-	$(ECHO) "sun/applet/AppletAudioClip" >>$(HEADLESS_CLASSLIST)
-	$(ECHO) "sun/java2d/opengl/GLXSurfaceData" >>$(HEADLESS_CLASSLIST)
-	$(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData" >>$(HEADLESS_CLASSLIST)
-	$(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager" >>$(HEADLESS_CLASSLIST)
-	$(ECHO) "sun/java2d/opengl/OGLSurfaceData" >>$(HEADLESS_CLASSLIST)
+# List all the individual classes to be included
+	$(ECHO) "sun/awt/motif/MFontConfiguration.class" >$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/applet/AppContextCreator.class" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/applet/AppletAudioClip.class" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/GLXSurfaceData.class" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData.class" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager.class" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/OGLSurfaceData.class" >>$(HEADLESS_CLASSLIST)
+
 
 $(TOTAL_HEADLESS_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_HEADLESS_RT_JAR_LIST)
 	$(prep-target)
 	$(RM) $@.temp
 	$(CD) $(CLASSBINDIR) ; \
 		$(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
-		-o  $@.temp $(HEADLESS_CLASSLIST) $(NOT_HEADLESS_RT_JAR_LIST)  .
+		-o  $@.temp - $(NOT_HEADLESS_RT_JAR_LIST)  .
+# Add on the explicitly included class files from the otherwise excluded packages
+	$(CAT) $(HEADLESS_CLASSLIST) >> $@.temp
 	$(MV) $@.temp $@
 	@$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
 
@@ -124,13 +129,9 @@
  $(LIBARCH)/libjavaplugin_nscp.so \
  $(LIBARCH)/libjavaplugin_oji.so
 
-
-ifeq ($(PLATFORM), linux)
-  STRIP_OPTS = --strip-unneeded
-else
-  STRIP_OPTS = -x
-endif
-
+# JRE docs that don't get included in reduced jre image top directory
+NOT_REDUCEDJRE_DOC = \
+ Welcome.html
 
 reduced-image-jre::
 	@$(ECHO) Starting to Produce Reduced JRE
@@ -142,12 +143,6 @@
 	$(CD) $(JRE_IMAGE_DIR); \
 	    $(TAR) cf - . | ($(CD) $(JRE_REDUCED_IMAGE_DIR); $(TAR) xf - ); 
 
-	@# strip the main .so files
-	$(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/client/libjvm.so
-ifndef BUILD_CLIENT_ONLY
-	$(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/server/libjvm.so
-endif
-
 	@#
 	@# Remove all of the files that are not needed for the
 	@# reduced JRE
@@ -158,6 +153,9 @@
 	for l in $(NOT_REDUCEDJRE_LIB) ; do \
 	    $(RM) $(JRE_REDUCED_IMAGE_DIR)/lib/$$l ; \
 	done
+	for l in $(NOT_REDUCEDJRE_DOC) ; do \
+	    $(RM) $(JRE_REDUCED_IMAGE_DIR)/$$l ; \
+	done
 
 	@# Remove misc. other files
 	$(RM) -r $(JRE_REDUCED_IMAGE_DIR)/man