changeset 2381:1d110524d034

Remove 'icedtea-' prefix from patches. 2011-05-03 Andrew John Hughes <ahughes@redhat.com> * patches/boot/icedtea-jaxp-dependency.patch, * patches/boot/icedtea-jopt.patch, * patches/boot/icedtea-pr39408.patch, * patches/boot/icedtea-pr40188.patch, * patches/boot/icedtea-pr40616.patch, * patches/debian/icedtea-uname.patch, * patches/hotspot/default/icedtea-gcc-suffix.patch, * patches/hotspot/default/icedtea-headers.patch, * patches/hotspot/default/icedtea-memory-limits.patch, * patches/hotspot/default/icedtea-params-cast-size_t.patch, * patches/hotspot/default/icedtea-parisc-opt.patch, * patches/hotspot/default/icedtea-sparc-ptracefix.patch, * patches/hotspot/default/icedtea-sparc-trapsfix.patch, * patches/hotspot/default/icedtea-text-relocations.patch, * patches/hotspot/default/icedtea-use-idx_t.patch, * patches/icedtea-6592792.patch, * patches/icedtea-6733959.patch, * patches/icedtea-6755943.patch, * patches/icedtea-alpha-fixes.patch, * patches/icedtea-alt-jar.patch, * patches/icedtea-clean-crypto.patch, * patches/icedtea-demos.patch, * patches/icedtea-disable-intree-ec.patch, * patches/icedtea-gcc-suffix.patch, * patches/icedtea-headers.patch, * patches/icedtea-hotspot-gcc-pr36917.patch, * patches/icedtea-javafiles.patch, * patches/icedtea-jpegclasses.patch, * patches/icedtea-jvmtiEnv.patch, * patches/icedtea-lc_ctype.patch, * patches/icedtea-libraries.patch, * patches/icedtea-linker-libs-order.patch, * patches/icedtea-nss-config.patch, * patches/icedtea-nss-not-enabled-config.patch, * patches/icedtea-override-redirect-metacity.patch, * patches/icedtea-pr261.patch, * patches/icedtea-print-lsb-release.patch, * patches/icedtea-pulse-soundproperties.patch, * patches/icedtea-rhino.patch, * patches/icedtea-rmi_amd64.patch, * patches/icedtea-samejvm-safe.patch, * patches/icedtea-security-updates.patch, * patches/icedtea-signed-types.patch, * patches/icedtea-sources.patch, * patches/icedtea-sparc-trapsfix.patch, * patches/icedtea-sunsrc.patch, * patches/icedtea-systemtap.patch, * patches/icedtea-testenv.patch, * patches/icedtea-tests-jdk.patch, * patches/icedtea-text-relocations.patch, * patches/icedtea-update-bootclasspath.patch, * patches/security/icedtea-6592792.patch, * patches/security/icedtea-6733959.patch, * patches/security/icedtea-6755943.patch: Remove 'icedtea-' prefix. * Makefile.am: (ICEDTEA_PATCHES): Remove 'icedtea-' prefix. * patches/6592792.patch, * patches/6733959.patch, * patches/6755943.patch, * patches/alpha-fixes.patch, * patches/alt-jar.patch, * patches/boot/jaxp-dependency.patch, * patches/boot/jopt.patch, * patches/boot/pr39408.patch, * patches/boot/pr40188.patch, * patches/boot/pr40616.patch, * patches/clean-crypto.patch, * patches/debian/uname.patch, * patches/demos.patch, * patches/disable-intree-ec.patch, * patches/gcc-suffix.patch, * patches/headers.patch, * patches/hotspot-gcc-pr36917.patch, * patches/hotspot/default/gcc-suffix.patch, * patches/hotspot/default/headers.patch, * patches/hotspot/default/memory-limits.patch, * patches/hotspot/default/params-cast-size_t.patch, * patches/hotspot/default/parisc-opt.patch, * patches/hotspot/default/sparc-ptracefix.patch, * patches/hotspot/default/sparc-trapsfix.patch, * patches/hotspot/default/text-relocations.patch, * patches/hotspot/default/use-idx_t.patch, * patches/javafiles.patch, * patches/jpegclasses.patch, * patches/jvmtiEnv.patch, * patches/lc_ctype.patch, * patches/libraries.patch, * patches/linker-libs-order.patch, * patches/nss-config.patch, * patches/nss-not-enabled-config.patch, * patches/override-redirect-metacity.patch, * patches/pr261.patch, * patches/print-lsb-release.patch, * patches/pulse-soundproperties.patch, * patches/rhino.patch, * patches/rmi_amd64.patch, * patches/samejvm-safe.patch, * patches/security-updates.patch, * patches/security/6592792.patch, * patches/security/6733959.patch, * patches/security/6755943.patch, * patches/signed-types.patch, * patches/sources.patch, * patches/sparc-trapsfix.patch, * patches/sunsrc.patch, * patches/systemtap.patch, * patches/testenv.patch, * patches/tests-jdk.patch, * patches/text-relocations.patch, * patches/update-bootclasspath.patch: Relocated versions of above.
author Andrew John Hughes <ahughes@redhat.com>
date Tue, 03 May 2011 22:38:46 +0100
parents 0bf704349e89
children 8fa7f2649c4c
files ChangeLog Makefile.am patches/6592792.patch patches/6733959.patch patches/6755943.patch patches/alpha-fixes.patch patches/alt-jar.patch patches/boot/icedtea-jaxp-dependency.patch patches/boot/icedtea-jopt.patch patches/boot/icedtea-pr39408.patch patches/boot/icedtea-pr40188.patch patches/boot/icedtea-pr40616.patch patches/boot/jaxp-dependency.patch patches/boot/jopt.patch patches/boot/pr39408.patch patches/boot/pr40188.patch patches/boot/pr40616.patch patches/clean-crypto.patch patches/debian/icedtea-uname.patch patches/debian/uname.patch patches/demos.patch patches/disable-intree-ec.patch patches/gcc-suffix.patch patches/headers.patch patches/hotspot-gcc-pr36917.patch patches/hotspot/default/gcc-suffix.patch patches/hotspot/default/headers.patch patches/hotspot/default/icedtea-gcc-suffix.patch patches/hotspot/default/icedtea-headers.patch patches/hotspot/default/icedtea-memory-limits.patch patches/hotspot/default/icedtea-params-cast-size_t.patch patches/hotspot/default/icedtea-parisc-opt.patch patches/hotspot/default/icedtea-sparc-ptracefix.patch patches/hotspot/default/icedtea-sparc-trapsfix.patch patches/hotspot/default/icedtea-text-relocations.patch patches/hotspot/default/icedtea-use-idx_t.patch patches/hotspot/default/memory-limits.patch patches/hotspot/default/params-cast-size_t.patch patches/hotspot/default/parisc-opt.patch patches/hotspot/default/sparc-ptracefix.patch patches/hotspot/default/sparc-trapsfix.patch patches/hotspot/default/text-relocations.patch patches/hotspot/default/use-idx_t.patch patches/icedtea-6592792.patch patches/icedtea-6733959.patch patches/icedtea-6755943.patch patches/icedtea-alpha-fixes.patch patches/icedtea-alt-jar.patch patches/icedtea-clean-crypto.patch patches/icedtea-demos.patch patches/icedtea-disable-intree-ec.patch patches/icedtea-gcc-suffix.patch patches/icedtea-headers.patch patches/icedtea-hotspot-gcc-pr36917.patch patches/icedtea-javafiles.patch patches/icedtea-jpegclasses.patch patches/icedtea-jvmtiEnv.patch patches/icedtea-lc_ctype.patch patches/icedtea-libraries.patch patches/icedtea-linker-libs-order.patch patches/icedtea-nss-config.patch patches/icedtea-nss-not-enabled-config.patch patches/icedtea-override-redirect-metacity.patch patches/icedtea-pr261.patch patches/icedtea-print-lsb-release.patch patches/icedtea-pulse-soundproperties.patch patches/icedtea-rhino.patch patches/icedtea-rmi_amd64.patch patches/icedtea-samejvm-safe.patch patches/icedtea-security-updates.patch patches/icedtea-signed-types.patch patches/icedtea-sources.patch patches/icedtea-sparc-trapsfix.patch patches/icedtea-sunsrc.patch patches/icedtea-systemtap.patch patches/icedtea-testenv.patch patches/icedtea-tests-jdk.patch patches/icedtea-text-relocations.patch patches/icedtea-update-bootclasspath.patch patches/javafiles.patch patches/jpegclasses.patch patches/jvmtiEnv.patch patches/lc_ctype.patch patches/libraries.patch patches/linker-libs-order.patch patches/nss-config.patch patches/nss-not-enabled-config.patch patches/override-redirect-metacity.patch patches/pr261.patch patches/print-lsb-release.patch patches/pulse-soundproperties.patch patches/rhino.patch patches/rmi_amd64.patch patches/samejvm-safe.patch patches/security-updates.patch patches/security/6592792.patch patches/security/6733959.patch patches/security/6755943.patch patches/security/icedtea-6592792.patch patches/security/icedtea-6733959.patch patches/security/icedtea-6755943.patch patches/signed-types.patch patches/sources.patch patches/sparc-trapsfix.patch patches/sunsrc.patch patches/systemtap.patch patches/testenv.patch patches/tests-jdk.patch patches/text-relocations.patch patches/update-bootclasspath.patch
diffstat 110 files changed, 6564 insertions(+), 6449 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 03 14:44:49 2011 +0100
+++ b/ChangeLog	Tue May 03 22:38:46 2011 +0100
@@ -1,3 +1,118 @@
+2011-05-03  Andrew John Hughes  <ahughes@redhat.com>
+
+	* patches/boot/icedtea-jaxp-dependency.patch,
+	* patches/boot/icedtea-jopt.patch,
+	* patches/boot/icedtea-pr39408.patch,
+	* patches/boot/icedtea-pr40188.patch,
+	* patches/boot/icedtea-pr40616.patch,
+	* patches/debian/icedtea-uname.patch,
+	* patches/hotspot/default/icedtea-gcc-suffix.patch,
+	* patches/hotspot/default/icedtea-headers.patch,
+	* patches/hotspot/default/icedtea-memory-limits.patch,
+	* patches/hotspot/default/icedtea-params-cast-size_t.patch,
+	* patches/hotspot/default/icedtea-parisc-opt.patch,
+	* patches/hotspot/default/icedtea-sparc-ptracefix.patch,
+	* patches/hotspot/default/icedtea-sparc-trapsfix.patch,
+	* patches/hotspot/default/icedtea-text-relocations.patch,
+	* patches/hotspot/default/icedtea-use-idx_t.patch,
+	* patches/icedtea-6592792.patch,
+	* patches/icedtea-6733959.patch,
+	* patches/icedtea-6755943.patch,
+	* patches/icedtea-alpha-fixes.patch,
+	* patches/icedtea-alt-jar.patch,
+	* patches/icedtea-clean-crypto.patch,
+	* patches/icedtea-demos.patch,
+	* patches/icedtea-disable-intree-ec.patch,
+	* patches/icedtea-gcc-suffix.patch,
+	* patches/icedtea-headers.patch,
+	* patches/icedtea-hotspot-gcc-pr36917.patch,
+	* patches/icedtea-javafiles.patch,
+	* patches/icedtea-jpegclasses.patch,
+	* patches/icedtea-jvmtiEnv.patch,
+	* patches/icedtea-lc_ctype.patch,
+	* patches/icedtea-libraries.patch,
+	* patches/icedtea-linker-libs-order.patch,
+	* patches/icedtea-nss-config.patch,
+	* patches/icedtea-nss-not-enabled-config.patch,
+	* patches/icedtea-override-redirect-metacity.patch,
+	* patches/icedtea-pr261.patch,
+	* patches/icedtea-print-lsb-release.patch,
+	* patches/icedtea-pulse-soundproperties.patch,
+	* patches/icedtea-rhino.patch,
+	* patches/icedtea-rmi_amd64.patch,
+	* patches/icedtea-samejvm-safe.patch,
+	* patches/icedtea-security-updates.patch,
+	* patches/icedtea-signed-types.patch,
+	* patches/icedtea-sources.patch,
+	* patches/icedtea-sparc-trapsfix.patch,
+	* patches/icedtea-sunsrc.patch,
+	* patches/icedtea-systemtap.patch,
+	* patches/icedtea-testenv.patch,
+	* patches/icedtea-tests-jdk.patch,
+	* patches/icedtea-text-relocations.patch,
+	* patches/icedtea-update-bootclasspath.patch,
+	* patches/security/icedtea-6592792.patch,
+	* patches/security/icedtea-6733959.patch,
+	* patches/security/icedtea-6755943.patch:
+	Remove 'icedtea-' prefix.
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Remove 'icedtea-' prefix.
+	* patches/6592792.patch,
+	* patches/6733959.patch,
+	* patches/6755943.patch,
+	* patches/alpha-fixes.patch,
+	* patches/alt-jar.patch,
+	* patches/boot/jaxp-dependency.patch,
+	* patches/boot/jopt.patch,
+	* patches/boot/pr39408.patch,
+	* patches/boot/pr40188.patch,
+	* patches/boot/pr40616.patch,
+	* patches/clean-crypto.patch,
+	* patches/debian/uname.patch,
+	* patches/demos.patch,
+	* patches/disable-intree-ec.patch,
+	* patches/gcc-suffix.patch,
+	* patches/headers.patch,
+	* patches/hotspot-gcc-pr36917.patch,
+	* patches/hotspot/default/gcc-suffix.patch,
+	* patches/hotspot/default/headers.patch,
+	* patches/hotspot/default/memory-limits.patch,
+	* patches/hotspot/default/params-cast-size_t.patch,
+	* patches/hotspot/default/parisc-opt.patch,
+	* patches/hotspot/default/sparc-ptracefix.patch,
+	* patches/hotspot/default/sparc-trapsfix.patch,
+	* patches/hotspot/default/text-relocations.patch,
+	* patches/hotspot/default/use-idx_t.patch,
+	* patches/javafiles.patch,
+	* patches/jpegclasses.patch,
+	* patches/jvmtiEnv.patch,
+	* patches/lc_ctype.patch,
+	* patches/libraries.patch,
+	* patches/linker-libs-order.patch,
+	* patches/nss-config.patch,
+	* patches/nss-not-enabled-config.patch,
+	* patches/override-redirect-metacity.patch,
+	* patches/pr261.patch,
+	* patches/print-lsb-release.patch,
+	* patches/pulse-soundproperties.patch,
+	* patches/rhino.patch,
+	* patches/rmi_amd64.patch,
+	* patches/samejvm-safe.patch,
+	* patches/security-updates.patch,
+	* patches/security/6592792.patch,
+	* patches/security/6733959.patch,
+	* patches/security/6755943.patch,
+	* patches/signed-types.patch,
+	* patches/sources.patch,
+	* patches/sparc-trapsfix.patch,
+	* patches/sunsrc.patch,
+	* patches/systemtap.patch,
+	* patches/testenv.patch,
+	* patches/tests-jdk.patch,
+	* patches/text-relocations.patch,
+	* patches/update-bootclasspath.patch:
+	Relocated versions of above.
+
 2011-05-03  Andrew John Hughes  <ahughes@redhat.com>
 
 	* Makefile.am:
--- a/Makefile.am	Tue May 03 14:44:49 2011 +0100
+++ b/Makefile.am	Tue May 03 22:38:46 2011 +0100
@@ -234,55 +234,55 @@
 # Patch list
 
 ICEDTEA_PATCHES = \
-	patches/hotspot/$(HSBUILD)/icedtea-text-relocations.patch \
-	patches/icedtea-rmi_amd64.patch \
-	patches/icedtea-demos.patch \
-	patches/icedtea-headers.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-headers.patch \
-	patches/icedtea-gcc-suffix.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-gcc-suffix.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-memory-limits.patch \
-	patches/icedtea-sunsrc.patch \
-	patches/icedtea-libraries.patch \
-	patches/icedtea-print-lsb-release.patch \
-	patches/icedtea-jpegclasses.patch \
-	patches/debian/icedtea-uname.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-sparc-ptracefix.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-sparc-trapsfix.patch \
-	patches/icedtea-override-redirect-metacity.patch \
-	patches/icedtea-security-updates.patch \
-	patches/icedtea-hotspot-gcc-pr36917.patch \
-	patches/icedtea-alpha-fixes.patch \
-	patches/icedtea-alt-jar.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-use-idx_t.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-params-cast-size_t.patch \
-	patches/icedtea-clean-crypto.patch \
+	patches/hotspot/$(HSBUILD)/text-relocations.patch \
+	patches/rmi_amd64.patch \
+	patches/demos.patch \
+	patches/headers.patch \
+	patches/hotspot/$(HSBUILD)/headers.patch \
+	patches/gcc-suffix.patch \
+	patches/hotspot/$(HSBUILD)/gcc-suffix.patch \
+	patches/hotspot/$(HSBUILD)/memory-limits.patch \
+	patches/sunsrc.patch \
+	patches/libraries.patch \
+	patches/print-lsb-release.patch \
+	patches/jpegclasses.patch \
+	patches/debian/uname.patch \
+	patches/hotspot/$(HSBUILD)/sparc-ptracefix.patch \
+	patches/hotspot/$(HSBUILD)/sparc-trapsfix.patch \
+	patches/override-redirect-metacity.patch \
+	patches/security-updates.patch \
+	patches/hotspot-gcc-pr36917.patch \
+	patches/alpha-fixes.patch \
+	patches/alt-jar.patch \
+	patches/hotspot/$(HSBUILD)/use-idx_t.patch \
+	patches/hotspot/$(HSBUILD)/params-cast-size_t.patch \
+	patches/clean-crypto.patch \
 	$(GCC_PATCH) \
 	patches/cacao/arch.patch \
-	patches/icedtea-signed-types.patch \
-	patches/icedtea-lc_ctype.patch \
-	patches/icedtea-tests-jdk.patch \
-	patches/icedtea-linker-libs-order.patch \
-	patches/icedtea-testenv.patch \
-	patches/icedtea-samejvm-safe.patch \
-	patches/icedtea-pr261.patch \
-	patches/hotspot/$(HSBUILD)/icedtea-parisc-opt.patch \
-        patches/security/icedtea-6592792.patch \
-        patches/security/icedtea-6733959.patch \
-        patches/security/icedtea-6755943.patch \
-	patches/icedtea-jvmtiEnv.patch \
-	patches/icedtea-disable-intree-ec.patch \
-	patches/icedtea-sources.patch \
+	patches/signed-types.patch \
+	patches/lc_ctype.patch \
+	patches/tests-jdk.patch \
+	patches/linker-libs-order.patch \
+	patches/testenv.patch \
+	patches/samejvm-safe.patch \
+	patches/pr261.patch \
+	patches/hotspot/$(HSBUILD)/parisc-opt.patch \
+        patches/security/6592792.patch \
+        patches/security/6733959.patch \
+        patches/security/6755943.patch \
+	patches/jvmtiEnv.patch \
+	patches/disable-intree-ec.patch \
+	patches/sources.patch \
 	patches/parisc.patch \
 	patches/sh4-support.patch \
 	patches/jtreg-httpTest.patch \
-	patches/icedtea-update-bootclasspath.patch
+	patches/update-bootclasspath.patch
 
 # Conditional patches
 
 if WITH_RHINO
 ICEDTEA_PATCHES += \
-	patches/icedtea-rhino.patch
+	patches/rhino.patch
 endif
 
 if BUILD_CACAO
@@ -302,24 +302,24 @@
 
 if ENABLE_PULSE_JAVA
 ICEDTEA_PATCHES += \
-	patches/icedtea-pulse-soundproperties.patch
+	patches/pulse-soundproperties.patch
 endif
 
 if !USE_CVMI
 ICEDTEA_PATCHES += \
-	patches/icedtea-javafiles.patch
+	patches/javafiles.patch
 endif
 
 if ENABLE_SYSTEMTAP
-ICEDTEA_PATCHES += patches/icedtea-systemtap.patch \
+ICEDTEA_PATCHES += patches/systemtap.patch \
 	patches/systemtap-gcc-4.5.patch \
 	patches/systemtap-alloc-size-workaround.patch
 endif
 
 if ENABLE_NSS
-ICEDTEA_PATCHES += patches/icedtea-nss-config.patch
+ICEDTEA_PATCHES += patches/nss-config.patch
 else
-ICEDTEA_PATCHES += patches/icedtea-nss-not-enabled-config.patch
+ICEDTEA_PATCHES += patches/nss-not-enabled-config.patch
 endif
 
 ICEDTEA_PATCHES += $(DISTRIBUTION_PATCHES)
@@ -344,8 +344,8 @@
 	patches/boot/tobin.patch \
 	patches/boot/test_gamma.patch \
 	patches/boot/tools.jar.patch \
-	patches/boot/icedtea-jopt.patch \
-	patches/boot/icedtea-jaxp-dependency.patch \
+	patches/boot/jopt.patch \
+	patches/boot/jaxp-dependency.patch \
 	patches/boot/genstubs-nofork.patch \
 	patches/boot/getannotation-cast.patch \
 	patches/boot/break-processbuilder-dependency.patch \
@@ -362,15 +362,15 @@
 	patches/boot/ecj-autoboxing.patch
 
 if CP39408_JAVAH
-ICEDTEA_BOOT_PATCHES += patches/boot/icedtea-pr39408.patch
+ICEDTEA_BOOT_PATCHES += patches/boot/pr39408.patch
 endif
 
 if CP40188_JAVAH
-ICEDTEA_BOOT_PATCHES += patches/boot/icedtea-pr40188.patch
+ICEDTEA_BOOT_PATCHES += patches/boot/pr40188.patch
 endif
 
 if CP40616
-ICEDTEA_BOOT_PATCHES += patches/boot/icedtea-pr40616.patch
+ICEDTEA_BOOT_PATCHES += patches/boot/pr40616.patch
 endif
 
 # Patches for when java.util.Scanner is missing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/6592792.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,297 @@
+diff -Nru openjdk.orig/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java openjdk/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java
+--- openjdk.orig/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java	2008-12-02 15:25:05.000000000 +0000
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java	2008-12-02 15:29:09.000000000 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2005-2008 Sun Microsystems, Inc.  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
+@@ -128,12 +128,7 @@
+         throws JAXBException
+     {
+         try {
+-            Class spiClass;
+-            if (classLoader == null) {
+-                spiClass = Class.forName(className);
+-            } else {
+-                spiClass = classLoader.loadClass(className);
+-            }
++            Class spiClass = safeLoadClass(className,classLoader);
+ 
+             /*
+              * javax.xml.bind.context.factory points to a class which has a
+@@ -205,11 +200,7 @@
+         ClassLoader cl = Thread.currentThread().getContextClassLoader();
+         Class spi;
+         try {
+-            logger.fine("Trying to load "+className);
+-            if (cl != null)
+-                spi = cl.loadClass(className);
+-            else
+-                spi = Class.forName(className);
++            spi = safeLoadClass(className,cl);
+         } catch (ClassNotFoundException e) {
+             throw new JAXBException(e);
+         }
+@@ -483,4 +474,31 @@
+      * For this reason, we have to hard-code the class name into the API.
+      */
+     private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory";
++
++    /**
++     * Loads the class, provided that the calling thread has an access to the class being loaded.
++     */
++    private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
++        logger.fine("Trying to load "+className);
++        try {
++            // make sure that the current thread has an access to the package of the given name.
++            SecurityManager s = System.getSecurityManager();
++            if (s != null) {
++                int i = className.lastIndexOf('.');
++                if (i != -1) {
++                    s.checkPackageAccess(className.substring(0,i));
++                }
++            }
++
++            if (classLoader == null)
++                return Class.forName(className);
++            else
++                return classLoader.loadClass(className);
++        } catch (SecurityException se) {
++            // anyone can access the platform default factory class without permission
++            if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className))
++                return Class.forName(className);
++            throw se;
++        }
++    }
+ }
+diff -Nru openjdk.orig/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java openjdk/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java
+--- openjdk.orig/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java	2008-12-02 15:25:04.000000000 +0000
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java	2008-12-02 15:29:09.000000000 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2005-2008 Sun Microsystems, Inc.  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
+@@ -47,12 +47,7 @@
+                                       ClassLoader classLoader)
+     {
+         try {
+-            Class spiClass;
+-            if (classLoader == null) {
+-                spiClass = Class.forName(className);
+-            } else {
+-                spiClass = classLoader.loadClass(className);
+-            }
++            Class spiClass = safeLoadClass(className, classLoader);
+             return spiClass.newInstance();
+         } catch (ClassNotFoundException x) {
+             throw new WebServiceException(
+@@ -152,4 +147,33 @@
+ 
+         return newInstance(fallbackClassName, classLoader);
+     }
++
++
++    private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.ws.spi.ProviderImpl";
++
++    /**
++     * Loads the class, provided that the calling thread has an access to the class being loaded.
++     */
++    private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
++        try {
++            // make sure that the current thread has an access to the package of the given name.
++            SecurityManager s = System.getSecurityManager();
++            if (s != null) {
++                int i = className.lastIndexOf('.');
++                if (i != -1) {
++                    s.checkPackageAccess(className.substring(0,i));
++                }
++            }
++
++            if (classLoader == null)
++                return Class.forName(className);
++            else
++                return classLoader.loadClass(className);
++        } catch (SecurityException se) {
++            // anyone can access the platform default factory class without permission
++            if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className))
++                return Class.forName(className);
++            throw se;
++        }
++    }
+ }
+diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security openjdk/jdk/src/share/lib/security/java.security
+--- openjdk.orig/jdk/src/share/lib/security/java.security	2008-11-20 08:44:48.000000000 +0000
++++ openjdk/jdk/src/share/lib/security/java.security	2008-12-02 15:29:09.000000000 +0000
+@@ -127,7 +127,7 @@
+ # passed to checkPackageAccess unless the
+ # corresponding RuntimePermission ("accessClassInPackage."+package) has
+ # been granted.
+-package.access=sun.
++package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
+ 
+ #
+ # List of comma-separated packages that start with or equal this string
+diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security-solaris openjdk/jdk/src/share/lib/security/java.security-solaris
+--- openjdk.orig/jdk/src/share/lib/security/java.security-solaris	2008-11-20 08:44:48.000000000 +0000
++++ openjdk/jdk/src/share/lib/security/java.security-solaris	2008-12-02 15:29:09.000000000 +0000
+@@ -128,7 +128,7 @@
+ # passed to checkPackageAccess unless the
+ # corresponding RuntimePermission ("accessClassInPackage."+package) has
+ # been granted.
+-package.access=sun.
++package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
+ 
+ #
+ # List of comma-separated packages that start with or equal this string
+diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security-windows openjdk/jdk/src/share/lib/security/java.security-windows
+--- openjdk.orig/jdk/src/share/lib/security/java.security-windows	2008-11-20 08:44:48.000000000 +0000
++++ openjdk/jdk/src/share/lib/security/java.security-windows	2008-12-02 15:29:09.000000000 +0000
+@@ -128,7 +128,7 @@
+ # passed to checkPackageAccess unless the
+ # corresponding RuntimePermission ("accessClassInPackage."+package) has
+ # been granted.
+-package.access=sun.
++package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
+ 
+ #
+ # List of comma-separated packages that start with or equal this string
+diff -Nru openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh
+--- openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh	2008-12-02 15:29:09.000000000 +0000
+@@ -0,0 +1,61 @@
++#!/bin/sh
++
++if [ "${TESTSRC}" = "" ]
++then TESTSRC=.
++fi
++
++if [ "${TESTJAVA}" = "" ]
++then
++  PARENT=`dirname \`which java\``
++  TESTJAVA=`dirname ${PARENT}`
++  echo "TESTJAVA not set, selecting " ${TESTJAVA}
++  echo "If this is incorrect, try setting the variable manually."
++fi
++
++if [ "${TESTCLASSES}" = "" ]
++then
++  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
++  exit 1
++fi
++
++BIT_FLAG=""
++
++# set platform-dependent variables
++OS=`uname -s`
++case "$OS" in
++  SunOS | Linux )
++    NULL=/dev/null
++    PS=":"
++    FS="/"
++    ## for solaris, linux it's HOME
++    FILE_LOCATION=$HOME
++    if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
++    then
++        BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT`
++    fi
++    ;;
++  Windows_* )
++    NULL=NUL
++    PS=";"
++    FS="\\"
++    ;;
++  * )
++    echo "Unrecognized system!"
++    exit 1;
++    ;;
++esac
++
++JEMMYPATH=${CPAPPEND}
++CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
++
++THIS_DIR=`pwd`
++
++${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -version
++
++${TESTJAVA}${FS}bin${FS}javac ${BIT_FLAG} -d . -cp ${TESTJAVA}${FS}jre${FS}lib${FS}rt.jar ${TESTSRC}${FS}Test.java
++
++${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -cp . Test
++
++STATUS=$?
++
++exit $STATUS
+diff -Nru openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java
+--- openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	2008-12-02 15:29:09.000000000 +0000
+@@ -0,0 +1,65 @@
++/*
++ *  @test
++ *  @bug 6592792
++ *  @summary Add com.sun.xml.internal to the "package.access" property in $JAVA_HOME/lib/security/java.security
++ *  @run shell Test6592792.sh
++ */
++
++import java.lang.*;
++import java.lang.reflect.*;
++import com.sun.xml.internal.ws.server.*;
++import com.sun.xml.internal.ws.server.SingletonResolver;
++import com.sun.xml.internal.ws.api.server.*;
++
++public class Test {
++
++  public static void main(String[] args) throws Exception{
++      // Enable the security manager
++      SecurityManager sm = new SecurityManager();
++      System.setSecurityManager(sm);
++      new Test();
++  }
++
++  Object invokeMethod(Object target,Method m,Object args[]) throws Exception {
++      SingletonResolver r = new SingletonResolver(target);
++      Invoker invoker = r.createInvoker();
++      return invoker.invoke(null, m, args);
++  }
++
++  public Test() throws Exception{
++      try {
++          Class c=Class.forName("java.lang.Class");
++
++          Class ctab[]=new Class[1];
++          ctab[0]=Class.forName("java.lang.String");
++          Method forName=c.getMethod("forName",ctab);
++
++          Class gtab[]=new Class[2];
++          gtab[0]=Class.forName("java.lang.String");
++          gtab[1]=Class[].class;
++          Method getMethod=c.getMethod("getMethod",gtab);
++
++          Method newInstance=c.getMethod("newInstance",(Class[])null);
++
++          Object otab[]=new Object[1];
++          otab[0]="sun.misc.Unsafe";
++
++          Object o=invokeMethod(null,forName,otab);
++          c = (Class)o;		// sun.misc.Unsafe class
++          // Test FAILED: Should n't have got the reference.   
++          throw new RuntimeException("Test Failed: Got reference to: "+o);
++
++
++          //o=invokeMethod(c,getMethod, new Object[]{"getUnsafe", (Class[])null});
++          //System.out.println("Got reference to: "+o);
++          //throw new RuntimeException("Got reference to: "+o);
++          //o=invokeMethod(c,(Method)o,null);
++          //System.out.println("Got reference to: "+o);
++          //throw new RuntimeException("Got reference to: "+o);
++   
++      } catch(java.security.AccessControlException e) {
++          System.out.println("Test passed");
++          //e.printStackTrace();
++      } 
++   }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/6733959.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,225 @@
+diff -Nru openjdk.orig/jdk/src/share/bin/java.c openjdk/jdk/src/share/bin/java.c
+--- openjdk.orig/jdk/src/share/bin/java.c	2008-12-02 16:28:05.000000000 +0000
++++ openjdk/jdk/src/share/bin/java.c	2008-12-02 17:08:57.000000000 +0000
+@@ -885,8 +885,14 @@
+      * "Valid" returns (other than unrecoverable errors) follow.  Set
+      * main_class as a side-effect of this routine.
+      */
+-    if (info.main_class != NULL)
++    if (info.main_class != NULL) {
++      if (strlen(info.main_class) <= MAXNAMELEN) {
+         *main_class = JLI_StringDup(info.main_class);
++      } else {
++        JLI_ReportErrorMessage("Error: main-class: attribute exceeds system limits\n", JNI_TRUE);
++	exit(1);
++      }
++    }
+ 
+     /*
+      * If no version selection information is found either on the command
+diff -Nru openjdk.orig/jdk/test/tools/launcher/MultipleJRE.sh openjdk/jdk/test/tools/launcher/MultipleJRE.sh
+--- openjdk.orig/jdk/test/tools/launcher/MultipleJRE.sh	2008-12-03 12:35:03.000000000 +0000
++++ openjdk/jdk/test/tools/launcher/MultipleJRE.sh	2008-12-02 17:07:57.000000000 +0000
+@@ -49,10 +49,23 @@
+   exit 1
+ fi
+ 
++JAVAEXE="$TESTJAVA/bin/java"
+ JAVA="$TESTJAVA/bin/java -classpath $TESTCLASSES"
+ JAR="$TESTJAVA/bin/jar"
+ OS=`uname -s`;
+ 
++# Tests whether we are on windows (true) or not.
++IsWindows() {
++    case "$OS" in
++        Windows* | CYGWIN* )
++            printf "true"
++        ;;
++        * )
++            printf "false"
++        ;;
++    esac
++}
++
+ #
+ # Shell routine to test for the proper rejection of syntactically incorrect
+ # version specifications.
+@@ -262,6 +275,29 @@
+ 	fi
+ }
+ 
++# Tests very long Main-Class attribute in the jar.
++TestLongMainClass() {
++    JVER=$1
++    if [ "$JVER" = "mklink" ]; then
++        JVER=XX
++        JDKXX=jdk/j2re$JVER
++        rm -rf jdk
++        mkdir jdk
++        ln -s $TESTJAVA $JDKXX
++        JAVA_VERSION_PATH="`pwd`/jdk"
++        export JAVA_VERSION_PATH
++    fi
++    $JAVAEXE -cp $TESTCLASSES ZipMeUp UglyBetty.jar 4097 
++    message="`$JAVAEXE -version:$JVER -jar UglyBetty.jar 2>&1`"
++    echo $message | grep "Error: main-class: attribute exceeds system limits" > /dev/null 2>&1
++    if [ $? -ne 0 ]; then
++        printf "Long manifest test did not get expected error"
++        exit 1
++    fi
++    unset JAVA_VERSION_PATH
++    rm -rf jdk
++}
++
+ #
+ # Main test sequence starts here
+ #
+@@ -280,14 +316,12 @@
+ LaunchVM "" "${RELEASE}"
+ CreateJar "" "0"
+ LaunchVM "" "${RELEASE}"
+-case "$OS" in
+-	Windows* | CYGWIN* )
+-		MAXIMUM_PATH=255;
+-	;;
+-	*)
+-		MAXIMUM_PATH=1024;
+-	;;
+-esac
++if [ `IsWindows` = "true" ]; then
++    MAXIMUM_PATH=115;  # 115 = 255 - 140
++else
++    MAXIMUM_PATH=884;  # 884 = 1024 - 140
++fi
++
+ 
+ PATH_LENGTH=`printf "%s" "$UGLYCLASS" | wc -c`
+ if [ ${PATH_LENGTH} -lt ${MAXIMUM_PATH} ]; then
+@@ -357,15 +391,28 @@
+ TestSyntax "1.2+.3"				# Embedded modifier
+ TestSyntax "1.2.4+&1.2*&1++"			# Long and invalid
+ 
++# On windows we see if there is another jre installed, usually
++# there is, then we test using that, otherwise links are created
++# to get through to SelectVersion.
++if [ `IsWindows` = "false" ]; then
++   TestLongMainClass "mklink"
++else
++    $JAVAEXE -version:1.0+
++    if [ $? -eq 0 ]; then
++        TestLongMainClass "1.0+"
++    else
++        printf  "Warning: TestLongMainClass skipped as there is no"
++       printf  "viable MJRE installed.\n"
++    fi
++fi
++
+ #
+ # Because scribbling in the registry can be rather destructive, only a
+ # subset of the tests are run on Windows.
+ #
+-case "$OS" in
+-	Windows* | CYGWIN* )
+-		exit 0;
+-	;;
+-esac
++if [ `IsWindows` = "true" ]; then
++   exit 0;
++fi
+ 
+ #
+ # Additional version specifiers containing spaces.  (Sigh, unable to
+diff -Nru openjdk.orig/jdk/test/tools/launcher/ZipMeUp.java openjdk/jdk/test/tools/launcher/ZipMeUp.java
+--- openjdk.orig/jdk/test/tools/launcher/ZipMeUp.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/tools/launcher/ZipMeUp.java	2008-12-02 17:07:57.000000000 +0000
+@@ -0,0 +1,90 @@
++/*
++ * Copyright 2008 Sun Microsystems, Inc.  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
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/**
++ * A simple class to create our erring Jar with a very long Main-Class
++ * attribute in the manifest.
++ */
++import java.io.ByteArrayOutputStream;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.io.PrintStream;
++import java.util.zip.CRC32;
++import java.util.zip.CheckedOutputStream;
++import java.util.zip.ZipEntry;
++import java.util.zip.ZipOutputStream;
++public class ZipMeUp {
++    
++    static final CRC32 crc = new CRC32();
++    
++    private static String SOME_KLASS = ".Some";
++    
++    static byte[] getManifestAsBytes(int nchars) throws IOException {
++        crc.reset();
++        ByteArrayOutputStream baos = new ByteArrayOutputStream();
++        CheckedOutputStream cos = new CheckedOutputStream(baos, crc);
++        PrintStream ps = new PrintStream(cos);
++        ps.println("Manifest-Version: 1.0");
++        ps.print("Main-Class: ");
++        for (int i = 0 ; i < nchars - SOME_KLASS.length(); i++) {
++            ps.print(i%10);
++        }
++        ps.println(SOME_KLASS);
++        cos.flush();
++        cos.close();
++        ps.close();
++        return baos.toByteArray();
++    }
++    /**
++     * The arguments are: filename_to_create length
++     * @param args
++     * @throws java.lang.Exception
++     */
++    public static void main(String...args) throws Exception  {
++        FileOutputStream fos = new FileOutputStream(args[0]);
++        ZipOutputStream zos = new ZipOutputStream(fos);
++        byte[] manifest = getManifestAsBytes(Integer.parseInt(args[1]));
++        ZipEntry ze = new ZipEntry("META-INF/MANIFEST.MF");
++        ze.setMethod(ZipEntry.STORED);
++        ze.setSize(manifest.length);
++        ze.setCompressedSize(manifest.length);
++        ze.setCrc(crc.getValue());
++        ze.setTime(System.currentTimeMillis());
++        zos.putNextEntry(ze);
++        zos.write(manifest);
++        zos.flush();
++        
++        // add a zero length class
++        ze = new ZipEntry(SOME_KLASS + ".class");
++        ze.setMethod(ZipEntry.STORED);
++        ze.setSize(0);
++        ze.setCompressedSize(0);
++        ze.setCrc(0);
++        ze.setTime(System.currentTimeMillis());
++        zos.putNextEntry(ze);
++        zos.flush();
++        zos.closeEntry();
++        zos.close();
++        System.exit(0);
++    }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/6755943.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,373 @@
+diff -Nru openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java
+--- openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java	2008-12-02 15:42:47.000000000 +0000
+@@ -0,0 +1,369 @@
++/*
++ * Copyright 2008 Sun Microsystems, Inc.  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
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * @test
++ * @bug 6755943
++ * @summary Checks any memory overruns in archive length.
++ * @run main/timeout=1200 MemoryAllocatorTest
++ */
++import java.io.BufferedReader;
++import java.io.DataOutputStream;
++import java.io.File;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.io.InputStreamReader;
++import java.io.OutputStream;
++import java.io.RandomAccessFile;
++import java.nio.MappedByteBuffer;
++import java.nio.channels.FileChannel;
++import java.util.ArrayList;
++import java.util.List;
++import java.util.Map;
++
++public class MemoryAllocatorTest {
++
++    /*
++     * The smallest possible pack file with 1 empty resource
++     */
++    static int[] magic = {
++        0xCA, 0xFE, 0xD0, 0x0D
++    };
++    static int[] version_info = {
++        0x07, // minor
++        0x96  // major
++    };
++    static int[] option = {
++        0x10
++    };
++    static int[] size_hi = {
++        0x00
++    };
++    static int[] size_lo_ulong = {
++        0xFF, 0xFC, 0xFC, 0xFC, 0xFC // ULONG_MAX 0xFFFFFFFF
++    };
++    static int[] size_lo_correct = {
++        0x17
++    };
++    static int[] data = {
++        0x00, 0xEC, 0xDA, 0xDE, 0xF8, 0x45, 0x01, 0x02,
++        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++        0x00, 0x00, 0x00, 0x01, 0x31, 0x01, 0x00
++    };
++    // End of pack file data
++
++    static final String JAVA_HOME = System.getProperty("java.home");
++
++    static final boolean debug = Boolean.getBoolean("MemoryAllocatorTest.Debug");
++    static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows");
++    static final boolean LINUX = System.getProperty("os.name").startsWith("Linux");
++    static final boolean SIXTYFOUR_BIT = System.getProperty("sun.arch.data.model", "32").equals("64");
++    static final private int EXPECTED_EXIT_CODE = (WINDOWS) ? -1 : 255;
++
++    static int testExitValue = 0;
++    
++    static byte[] bytes(int[] a) {
++        byte[] b = new byte[a.length];
++        for (int i = 0; i < b.length; i++) {
++            b[i] = (byte) a[i];
++        }
++        return b;
++    }
++    
++    static void createPackFile(boolean good, File packFile) throws IOException {
++        FileOutputStream fos = new FileOutputStream(packFile);
++        fos.write(bytes(magic));
++        fos.write(bytes(version_info));
++        fos.write(bytes(option));
++        fos.write(bytes(size_hi));
++        if (good) {
++            fos.write(bytes(size_lo_correct));
++        } else {
++            fos.write(bytes(size_lo_ulong));
++        }
++        fos.write(bytes(data));
++    }
++
++    /*
++     * This method modifies the LSB of the size_lo for various wicked
++     * values between MAXINT-0x3F and MAXINT.
++     */
++    static int modifyPackFile(File packFile) throws IOException {
++        RandomAccessFile raf = new RandomAccessFile(packFile, "rws");
++        long len = packFile.length();
++        FileChannel fc = raf.getChannel();
++        MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_WRITE, 0, len);
++        int pos = magic.length + version_info.length + option.length +
++                size_hi.length;
++        byte value = bb.get(pos);
++        value--;
++        bb.position(pos);
++        bb.put(value);
++        bb.force();
++        fc.truncate(len);
++        fc.close();
++        return value & 0xFF;
++    }
++
++    static String getUnpack200Cmd() throws Exception {
++        File binDir = new File(JAVA_HOME, "bin");
++        File unpack200File = WINDOWS
++                ? new File(binDir, "unpack200.exe")
++                : new File(binDir, "unpack200");
++
++        String cmd = unpack200File.getAbsolutePath();
++        if (!unpack200File.canExecute()) {
++            throw new Exception("please check" +
++                    cmd + " exists and is executable");
++        }
++        return cmd;
++    }
++
++    static TestResult runUnpacker(File packFile) throws Exception {
++        if (!packFile.exists()) {
++            throw new Exception("please check" + packFile + " exists");
++        }
++        ArrayList<String> alist = new ArrayList<String>();
++        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(),
++                packFile.getName(), "testout.jar");
++        Map<String, String> env = pb.environment();
++        pb.directory(new File("."));
++        int retval = 0;
++        try {
++            pb.redirectErrorStream(true);
++            Process p = pb.start();
++            BufferedReader rd = new BufferedReader(
++                    new InputStreamReader(p.getInputStream()), 8192);
++            String in = rd.readLine();
++            while (in != null) {
++                alist.add(in);
++                System.out.println(in);
++                in = rd.readLine();
++            }
++            retval = p.waitFor();
++            p.destroy();
++        } catch (Exception ex) {
++            ex.printStackTrace();
++            throw new RuntimeException(ex.getMessage());
++        }
++        return new TestResult("", retval, alist);
++    }
++
++    /*
++     * The debug version builds of unpack200 call abort(3) which might set
++     * an unexpected return value, therefore this test is to determine
++     * if we are using a product or non-product build and check the
++     * return value appropriately.
++     */
++    static boolean isNonProductVersion() throws Exception {
++        ArrayList<String> alist = new ArrayList<String>();
++        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(), "--version");
++        Map<String, String> env = pb.environment();
++        pb.directory(new File("."));
++        int retval = 0;
++        try {
++            pb.redirectErrorStream(true);
++            Process p = pb.start();
++            BufferedReader rd = new BufferedReader(
++                    new InputStreamReader(p.getInputStream()), 8192);
++            String in = rd.readLine();
++            while (in != null) {
++                alist.add(in);
++                System.out.println(in);
++                in = rd.readLine();
++            }
++            retval = p.waitFor();
++            p.destroy();
++        } catch (Exception ex) {
++            ex.printStackTrace();
++            throw new RuntimeException(ex.getMessage());
++        }
++        for (String x : alist) {
++            if (x.contains("non-product")) {
++                return true;
++            }
++        }
++        return false;
++    }
++
++    /**
++     * @param args the command line arguments
++     * @throws java.lang.Exception 
++     */
++    public static void main(String[] args) throws Exception {
++
++        File packFile = new File("tiny.pack");
++        boolean isNPVersion = isNonProductVersion();
++
++        // Create a good pack file and test if everything is ok
++        createPackFile(true, packFile);
++        TestResult tr = runUnpacker(packFile);
++        tr.setDescription("a good pack file");
++        tr.checkPositive();
++        tr.isOK();
++        System.out.println(tr);
++
++        /*
++         * jprt systems on windows and linux seem to have abundant memory
++         * therefore can take a very long time to run, and even if it does
++         * the error message is not accurate for us to discern if the test
++         * passes successfully.
++         */
++        if (SIXTYFOUR_BIT && (LINUX || WINDOWS)) {
++            System.out.println("Warning: Windows/Linux 64bit tests passes vacuously");
++            return;
++        }
++        
++        /*
++         * debug builds call abort, the exit code under these conditions
++         * are not really relevant.
++         */
++        if (isNPVersion) {
++            System.out.println("Warning: non-product build: exit values not checked");
++        }
++    
++        // create a bad pack file
++        createPackFile(false, packFile);
++        tr = runUnpacker(packFile);
++        tr.setDescription("a wicked pack file");
++        tr.contains("Native allocation failed");
++        if(!isNPVersion) {
++            tr.checkValue(EXPECTED_EXIT_CODE);
++        }
++        System.out.println(tr);
++        int value = modifyPackFile(packFile);
++        tr.setDescription("value=" + value);
++
++        // continue creating bad pack files by modifying the specimen pack file.
++        while (value >= 0xc0) {
++            tr = runUnpacker(packFile);
++            tr.contains("Native allocation failed");
++            if (!isNPVersion) {
++                tr.checkValue(EXPECTED_EXIT_CODE);
++            }
++            tr.setDescription("wicked value=0x" +
++                    Integer.toHexString(value & 0xFF));
++            System.out.println(tr);
++            value = modifyPackFile(packFile);
++        }
++        if (testExitValue != 0) {
++            throw new Exception("Pack200 archive length tests(" +
++                    testExitValue + ") failed ");
++        } else {
++            System.out.println("All tests pass");
++        }
++    }
++
++    /*
++     * A class to encapsulate the test results and stuff, with some ease
++     * of use methods to check the test results.
++     */
++    static class TestResult {
++
++        StringBuilder status;
++        int exitValue;
++        List<String> testOutput;
++        String description;
++
++        public TestResult(String str, int rv, List<String> oList) {
++            status = new StringBuilder(str);
++            exitValue = rv;
++            testOutput = oList;
++        }
++
++        void setDescription(String description) {
++            this.description = description;
++        }
++
++        void checkValue(int value) {
++            if (exitValue != value) {
++                status =
++                        status.append("  Error: test expected exit value " +
++                        value + "got " + exitValue);
++                testExitValue++;
++            }
++        }
++
++        void checkNegative() {
++            if (exitValue == 0) {
++                status = status.append(
++                        "  Error: test did not expect 0 exit value");
++
++                testExitValue++;
++            }
++        }
++
++        void checkPositive() {
++            if (exitValue != 0) {
++                status = status.append(
++                        "  Error: test did not return 0 exit value");
++                testExitValue++;
++            }
++        }
++
++        boolean isOK() {
++            return exitValue == 0;
++        }
++
++        boolean isZeroOutput() {
++            if (!testOutput.isEmpty()) {
++                status = status.append("  Error: No message from cmd please");
++                testExitValue++;
++                return false;
++            }
++            return true;
++        }
++
++        boolean isNotZeroOutput() {
++            if (testOutput.isEmpty()) {
++                status = status.append("  Error: Missing message");
++                testExitValue++;
++                return false;
++            }
++            return true;
++        }
++
++        public String toString() {
++            if (debug) {
++                for (String x : testOutput) {
++                    status = status.append(x + "\n");
++                }
++            }
++            if (description != null) {
++                status.insert(0, description);
++            }
++            return status.append("\nexitValue = " + exitValue).toString();
++        }
++
++        boolean contains(String str) {
++            for (String x : testOutput) {
++                if (x.contains(str)) {
++                    return true;
++                }
++            }
++            status = status.append("   Error: string <" + str + "> not found ");
++            testExitValue++;
++            return false;
++        }
++    }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/alpha-fixes.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,33 @@
+diff -Nru openjdk.orig/hotspot/agent/src/os/linux/Makefile openjdk/hotspot/agent/src/os/linux/Makefile
+--- openjdk.orig/hotspot/agent/src/os/linux/Makefile	2010-09-01 09:57:06.000000000 +0100
++++ openjdk/hotspot/agent/src/os/linux/Makefile	2010-09-01 10:27:09.592191147 +0100
+@@ -40,7 +40,7 @@
+ 
+ LIBS     = -lthread_db
+ 
+-CFLAGS   = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES)
++CFLAGS   = -c -fPIC -g -D_GNU_SOURCE -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) $(INCLUDES)
+ 
+ LIBSA = $(ARCH)/libsaproc.so
+ 
+@@ -73,7 +73,7 @@
+ 	$(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS)
+ 
+ test.o: test.c
+-	$(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c
++	$(GCC) -c -o test.o -g -D_GNU_SOURCE -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) $(INCLUDES) test.c
+ 
+ test: test.o
+ 	$(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS)
+diff -Nru openjdk.orig/hotspot/src/share/vm/oops/generateOopMap.cpp openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp
+--- openjdk.orig/hotspot/src/share/vm/oops/generateOopMap.cpp	2010-08-27 19:15:27.000000000 +0100
++++ openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp	2010-09-01 10:28:08.943025196 +0100
+@@ -2104,7 +2104,7 @@
+ void GenerateOopMap::report_error(const char *format, ...) {
+   va_list ap;
+   va_start(ap, format);
+-  error_work(format, ap);
++  report_error(format, ap);
+ }
+ 
+ void GenerateOopMap::verify_error(const char *format, ...) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/alt-jar.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,15 @@
+--- openjdk.orig/jdk/make/common/shared/Defs-java.gmk	2008-05-30 03:50:36.000000000 -0400
++++ openjdk/jdk/make/common/shared/Defs-java.gmk	2008-08-06 11:18:26.000000000 -0400
+@@ -187,7 +181,11 @@
+ 
+ BOOT_JAVA_CMD      = $(BOOTDIR)/bin/java $(JAVA_TOOLS_FLAGS)
+ BOOT_JAVAC_CMD     = $(BOOTDIR)/bin/javac $(JAVAC_JVM_FLAGS) $(BOOT_JAVACFLAGS)
+-BOOT_JAR_CMD       = $(BOOTDIR)/bin/jar
++ifdef ALT_JAR_CMD
++  BOOT_JAR_CMD       = $(ALT_JAR_CMD)
++else
++  BOOT_JAR_CMD       = $(BOOTDIR)/bin/jar
++endif
+ BOOT_JARSIGNER_CMD = $(BOOTDIR)/bin/jarsigner
+ 
+ # Various tools we need to run (FIXUP: Are these the right ones?)
--- a/patches/boot/icedtea-jaxp-dependency.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-diff -Nru openjdk-boot.orig/jaxws/build.properties openjdk-boot/jaxws/build.properties
---- openjdk-boot.orig/jaxws/build.properties	2010-07-29 21:54:11.000000000 +0100
-+++ openjdk-boot/jaxws/build.properties	2010-09-01 21:25:29.587888259 +0100
-@@ -62,6 +62,9 @@
- build.dir=${output.dir}/build
- build.classes.dir=${build.dir}/classes
- 
-+# JAXP built files
-+jaxp.classes.dir=${output.dir}/../jaxp/build/classes
-+
- # Distributed results
- dist.dir=${output.dir}/dist
- dist.lib.dir=${dist.dir}/lib
-diff -Nru openjdk-boot.orig/jaxws/build.xml openjdk-boot/jaxws/build.xml
---- openjdk-boot.orig/jaxws/build.xml	2010-09-01 21:00:02.000000000 +0100
-+++ openjdk-boot/jaxws/build.xml	2010-09-01 21:25:29.595887577 +0100
-@@ -124,7 +124,7 @@
-         <mkdir dir="${build.classes.dir}"/>
-         <javac 
- 	     includeAntRuntime="false" 
--	     classpath="${build.classes.dir}:${tools.jar}"
-+	     classpath="${jaxp.classes.dir}:${build.classes.dir}:${tools.jar}"
- 	     fork="true"
-              destdir="${build.classes.dir}"
-              memoryInitialSize="${javac.memoryInitialSize}"
--- a/patches/boot/icedtea-jopt.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-diff -Nru openjdk-boot.orig/corba/make/common/shared/Defs-java.gmk openjdk-boot/corba/make/common/shared/Defs-java.gmk
---- openjdk-boot.orig/corba/make/common/shared/Defs-java.gmk	2008-10-22 18:45:43.000000000 +0100
-+++ openjdk-boot/corba/make/common/shared/Defs-java.gmk	2008-10-22 18:49:29.000000000 +0100
-@@ -75,7 +75,9 @@
- JAVAC_JVM_FLAGS    += $(JAVA_TOOLS_FLAGS:%=-J%)
- 
- # The jar -J options are special, must be added at the end of the command line
-+ifneq (,$(JAR_KNOWS_J_OPTIONS))
- JAR_JFLAGS       = $(JAVA_TOOLS_FLAGS:%=-J%)
-+endif
- 
- # JAVA_TOOLS_DIR is the default location to find Java tools to run, if
- #    langtools is not available.
-diff -Nru openjdk-boot.orig/jdk/make/common/shared/Defs-java.gmk openjdk-boot/jdk/make/common/shared/Defs-java.gmk
---- openjdk-boot.orig/jdk/make/common/shared/Defs-java.gmk	2008-10-22 19:14:30.000000000 +0100
-+++ openjdk-boot/jdk/make/common/shared/Defs-java.gmk	2008-10-22 19:15:00.000000000 +0100
-@@ -82,7 +82,9 @@
- JAVAC_JVM_FLAGS    += $(JAVA_TOOLS_FLAGS:%=-J%)
- 
- # The jar -J options are special, must be added at the end of the command line
-+ifneq (,$(JAR_KNOWS_J_OPTIONS))
- JAR_JFLAGS       = $(JAVA_TOOLS_FLAGS:%=-J%)
-+endif
- 
- # JAVA_TOOLS_DIR is the default location to find Java tools to run, if
- #    langtools is not available.
--- a/patches/boot/icedtea-pr39408.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c openjdk/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
---- openjdk-boot.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-03-18 16:25:52.000000000 +0000
-+++ openjdk-boot/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-03-18 16:27:03.000000000 +0000
-@@ -36,6 +36,14 @@
- #include "nio.h"
- #include "nio_util.h"
- 
-+#undef sun_nio_ch_FileDispatcher_NO_LOCK
-+#define sun_nio_ch_FileDispatcher_NO_LOCK -1L
-+#undef sun_nio_ch_FileDispatcher_LOCKED
-+#define sun_nio_ch_FileDispatcher_LOCKED 0L
-+#undef sun_nio_ch_FileDispatcher_RET_EX_LOCK
-+#define sun_nio_ch_FileDispatcher_RET_EX_LOCK 1L
-+#undef sun_nio_ch_FileDispatcher_INTERRUPTED
-+#define sun_nio_ch_FileDispatcher_INTERRUPTED 2L
- 
- static int preCloseFD = -1;     /* File descriptor to which we dup other fd's
-                                    before closing them for real */
--- a/patches/boot/icedtea-pr40188.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-diff -Nru openjdk-boot.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c openjdk-boot/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
---- openjdk-boot.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-03-30 17:23:08.000000000 +0100
-+++ openjdk-boot/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-05-18 19:58:36.000000000 +0100
-@@ -192,9 +192,9 @@
-     lockResult = fcntl(fd, cmd, &fl);
-     if (lockResult < 0) {
-         if ((cmd == F_SETLK64) && (errno == EAGAIN))
--            return sun_nio_ch_FileDispatcherImpl_NO_LOCK;
-+            return sun_nio_ch_FileDispatcher_NO_LOCK;
-         if (errno == EINTR)
--            return sun_nio_ch_FileDispatcherImpl_INTERRUPTED;
-+            return sun_nio_ch_FileDispatcher_INTERRUPTED;
-         JNU_ThrowIOExceptionWithLastError(env, "Lock failed");
-     }
-     return 0;
--- a/patches/boot/icedtea-pr40616.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
---- openjdk-boot.orig/jdk/make/tools/src/build/tools/charsetmapping/EUC_TW.java	2010-05-05 18:45:07.000000000 +0100
-+++ openjdk-boot/jdk/make/tools/src/build/tools/charsetmapping/EUC_TW.java	2010-05-05 21:26:31.000000000 +0100
-@@ -83,8 +83,8 @@
-     static void genClass(String args[]) throws Exception
-     {
-         InputStream is = new FileInputStream(new File(args[0], "euc_tw.map"));
--        PrintStream ps = new PrintStream(new File(args[1], "EUC_TWMapping.java"),
--                                         "ISO-8859-1");
-+        FileOutputStream fos = new FileOutputStream(new File(args[1], "EUC_TWMapping.java"));
-+        PrintStream ps = new PrintStream(fos, false, "ISO-8859-1");
-         String copyright = getCopyright(new File(args[3]));
- 
- 
-diff -r c1cee45daf4d make/tools/src/build/tools/charsetmapping/HKSCS.java
---- openjdk-boot.orig/jdk/make/tools/src/build/tools/charsetmapping/HKSCS.java	Wed Apr 28 22:15:05 2010 +0100
-+++ openjdk-boot/jdk/make/tools/src/build/tools/charsetmapping/HKSCS.java	Thu May 06 14:17:11 2010 +0100
-@@ -43,29 +43,28 @@
-         Pattern.compile("(?:0x)?+(\\p{XDigit}++)\\s++(?:0x|U\\+)?+(\\p{XDigit}++)?\\s*+(?:0x|U\\+)?(\\p{XDigit}++)?\\s*+.*");
- 
-     static void genClass(String args[]) throws Exception {
--
-+        FileOutputStream fos = new FileOutputStream(new File(args[1], "HKSCSMapping.java"));
-         // hkscs2008
-         genClass0(new FileInputStream(new File(args[0], "HKSCS2008.map")),
-                   new FileInputStream(new File(args[0], "HKSCS2008.c2b")),
--                  new PrintStream(new File(args[1], "HKSCSMapping.java"),
--                                  "ISO-8859-1"),
-+                  new PrintStream(fos, false, "ISO-8859-1"),
-                   "HKSCSMapping",
-                   getCopyright(new File(args[3])));
- 
- 
-         // xp2001
-+        fos = new FileOutputStream(new File(args[1], "HKSCS_XPMapping.java"));
-         genClass0(new FileInputStream(new File(args[0], "HKSCS_XP.map")),
-                   null,
--                  new PrintStream(new File(args[1], "HKSCS_XPMapping.java"),
--                                  "ISO-8859-1"),
-+                  new PrintStream(fos, false, "ISO-8859-1"),
-                   "HKSCS_XPMapping",
-                   getCopyright(new File(args[3])));
- 
-         // hkscs2001
-+        fos = new FileOutputStream(new File(args[1], "HKSCS2001Mapping.java"));
-         genClass0(new FileInputStream(new File(args[0], "HKSCS2001.map")),
-                   new FileInputStream(new File(args[0], "HKSCS2001.c2b")),
--                  new PrintStream(new File(args[1], "HKSCS2001Mapping.java"),
--                                  "ISO-8859-1"),
-+                  new PrintStream(fos, false, "ISO-8859-1"),
-                   "HKSCS2001Mapping",
-                   getCopyright(new File(args[3])));
-     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/jaxp-dependency.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,25 @@
+diff -Nru openjdk-boot.orig/jaxws/build.properties openjdk-boot/jaxws/build.properties
+--- openjdk-boot.orig/jaxws/build.properties	2010-07-29 21:54:11.000000000 +0100
++++ openjdk-boot/jaxws/build.properties	2010-09-01 21:25:29.587888259 +0100
+@@ -62,6 +62,9 @@
+ build.dir=${output.dir}/build
+ build.classes.dir=${build.dir}/classes
+ 
++# JAXP built files
++jaxp.classes.dir=${output.dir}/../jaxp/build/classes
++
+ # Distributed results
+ dist.dir=${output.dir}/dist
+ dist.lib.dir=${dist.dir}/lib
+diff -Nru openjdk-boot.orig/jaxws/build.xml openjdk-boot/jaxws/build.xml
+--- openjdk-boot.orig/jaxws/build.xml	2010-09-01 21:00:02.000000000 +0100
++++ openjdk-boot/jaxws/build.xml	2010-09-01 21:25:29.595887577 +0100
+@@ -124,7 +124,7 @@
+         <mkdir dir="${build.classes.dir}"/>
+         <javac 
+ 	     includeAntRuntime="false" 
+-	     classpath="${build.classes.dir}:${tools.jar}"
++	     classpath="${jaxp.classes.dir}:${build.classes.dir}:${tools.jar}"
+ 	     fork="true"
+              destdir="${build.classes.dir}"
+              memoryInitialSize="${javac.memoryInitialSize}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/jopt.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,26 @@
+diff -Nru openjdk-boot.orig/corba/make/common/shared/Defs-java.gmk openjdk-boot/corba/make/common/shared/Defs-java.gmk
+--- openjdk-boot.orig/corba/make/common/shared/Defs-java.gmk	2008-10-22 18:45:43.000000000 +0100
++++ openjdk-boot/corba/make/common/shared/Defs-java.gmk	2008-10-22 18:49:29.000000000 +0100
+@@ -75,7 +75,9 @@
+ JAVAC_JVM_FLAGS    += $(JAVA_TOOLS_FLAGS:%=-J%)
+ 
+ # The jar -J options are special, must be added at the end of the command line
++ifneq (,$(JAR_KNOWS_J_OPTIONS))
+ JAR_JFLAGS       = $(JAVA_TOOLS_FLAGS:%=-J%)
++endif
+ 
+ # JAVA_TOOLS_DIR is the default location to find Java tools to run, if
+ #    langtools is not available.
+diff -Nru openjdk-boot.orig/jdk/make/common/shared/Defs-java.gmk openjdk-boot/jdk/make/common/shared/Defs-java.gmk
+--- openjdk-boot.orig/jdk/make/common/shared/Defs-java.gmk	2008-10-22 19:14:30.000000000 +0100
++++ openjdk-boot/jdk/make/common/shared/Defs-java.gmk	2008-10-22 19:15:00.000000000 +0100
+@@ -82,7 +82,9 @@
+ JAVAC_JVM_FLAGS    += $(JAVA_TOOLS_FLAGS:%=-J%)
+ 
+ # The jar -J options are special, must be added at the end of the command line
++ifneq (,$(JAR_KNOWS_J_OPTIONS))
+ JAR_JFLAGS       = $(JAVA_TOOLS_FLAGS:%=-J%)
++endif
+ 
+ # JAVA_TOOLS_DIR is the default location to find Java tools to run, if
+ #    langtools is not available.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/pr39408.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,18 @@
+diff -Nru openjdk.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c openjdk/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
+--- openjdk-boot.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-03-18 16:25:52.000000000 +0000
++++ openjdk-boot/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-03-18 16:27:03.000000000 +0000
+@@ -36,6 +36,14 @@
+ #include "nio.h"
+ #include "nio_util.h"
+ 
++#undef sun_nio_ch_FileDispatcher_NO_LOCK
++#define sun_nio_ch_FileDispatcher_NO_LOCK -1L
++#undef sun_nio_ch_FileDispatcher_LOCKED
++#define sun_nio_ch_FileDispatcher_LOCKED 0L
++#undef sun_nio_ch_FileDispatcher_RET_EX_LOCK
++#define sun_nio_ch_FileDispatcher_RET_EX_LOCK 1L
++#undef sun_nio_ch_FileDispatcher_INTERRUPTED
++#define sun_nio_ch_FileDispatcher_INTERRUPTED 2L
+ 
+ static int preCloseFD = -1;     /* File descriptor to which we dup other fd's
+                                    before closing them for real */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/pr40188.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,15 @@
+diff -Nru openjdk-boot.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c openjdk-boot/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
+--- openjdk-boot.orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-03-30 17:23:08.000000000 +0100
++++ openjdk-boot/jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	2009-05-18 19:58:36.000000000 +0100
+@@ -192,9 +192,9 @@
+     lockResult = fcntl(fd, cmd, &fl);
+     if (lockResult < 0) {
+         if ((cmd == F_SETLK64) && (errno == EAGAIN))
+-            return sun_nio_ch_FileDispatcherImpl_NO_LOCK;
++            return sun_nio_ch_FileDispatcher_NO_LOCK;
+         if (errno == EINTR)
+-            return sun_nio_ch_FileDispatcherImpl_INTERRUPTED;
++            return sun_nio_ch_FileDispatcher_INTERRUPTED;
+         JNU_ThrowIOExceptionWithLastError(env, "Lock failed");
+     }
+     return 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/pr40616.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,52 @@
+--- openjdk-boot.orig/jdk/make/tools/src/build/tools/charsetmapping/EUC_TW.java	2010-05-05 18:45:07.000000000 +0100
++++ openjdk-boot/jdk/make/tools/src/build/tools/charsetmapping/EUC_TW.java	2010-05-05 21:26:31.000000000 +0100
+@@ -83,8 +83,8 @@
+     static void genClass(String args[]) throws Exception
+     {
+         InputStream is = new FileInputStream(new File(args[0], "euc_tw.map"));
+-        PrintStream ps = new PrintStream(new File(args[1], "EUC_TWMapping.java"),
+-                                         "ISO-8859-1");
++        FileOutputStream fos = new FileOutputStream(new File(args[1], "EUC_TWMapping.java"));
++        PrintStream ps = new PrintStream(fos, false, "ISO-8859-1");
+         String copyright = getCopyright(new File(args[3]));
+ 
+ 
+diff -r c1cee45daf4d make/tools/src/build/tools/charsetmapping/HKSCS.java
+--- openjdk-boot.orig/jdk/make/tools/src/build/tools/charsetmapping/HKSCS.java	Wed Apr 28 22:15:05 2010 +0100
++++ openjdk-boot/jdk/make/tools/src/build/tools/charsetmapping/HKSCS.java	Thu May 06 14:17:11 2010 +0100
+@@ -43,29 +43,28 @@
+         Pattern.compile("(?:0x)?+(\\p{XDigit}++)\\s++(?:0x|U\\+)?+(\\p{XDigit}++)?\\s*+(?:0x|U\\+)?(\\p{XDigit}++)?\\s*+.*");
+ 
+     static void genClass(String args[]) throws Exception {
+-
++        FileOutputStream fos = new FileOutputStream(new File(args[1], "HKSCSMapping.java"));
+         // hkscs2008
+         genClass0(new FileInputStream(new File(args[0], "HKSCS2008.map")),
+                   new FileInputStream(new File(args[0], "HKSCS2008.c2b")),
+-                  new PrintStream(new File(args[1], "HKSCSMapping.java"),
+-                                  "ISO-8859-1"),
++                  new PrintStream(fos, false, "ISO-8859-1"),
+                   "HKSCSMapping",
+                   getCopyright(new File(args[3])));
+ 
+ 
+         // xp2001
++        fos = new FileOutputStream(new File(args[1], "HKSCS_XPMapping.java"));
+         genClass0(new FileInputStream(new File(args[0], "HKSCS_XP.map")),
+                   null,
+-                  new PrintStream(new File(args[1], "HKSCS_XPMapping.java"),
+-                                  "ISO-8859-1"),
++                  new PrintStream(fos, false, "ISO-8859-1"),
+                   "HKSCS_XPMapping",
+                   getCopyright(new File(args[3])));
+ 
+         // hkscs2001
++        fos = new FileOutputStream(new File(args[1], "HKSCS2001Mapping.java"));
+         genClass0(new FileInputStream(new File(args[0], "HKSCS2001.map")),
+                   new FileInputStream(new File(args[0], "HKSCS2001.c2b")),
+-                  new PrintStream(new File(args[1], "HKSCS2001Mapping.java"),
+-                                  "ISO-8859-1"),
++                  new PrintStream(fos, false, "ISO-8859-1"),
+                   "HKSCS2001Mapping",
+                   getCopyright(new File(args[3])));
+     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/clean-crypto.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,1078 @@
+diff -Nru openjdk.orig/jdk/make/javax/crypto/Makefile openjdk/jdk/make/javax/crypto/Makefile
+--- openjdk.orig/jdk/make/javax/crypto/Makefile	2010-07-29 21:55:27.000000000 +0100
++++ openjdk/jdk/make/javax/crypto/Makefile	2010-09-01 10:37:32.926684780 +0100
+@@ -157,7 +157,8 @@
+ #
+ 
+ ifdef OPENJDK
+-all: build-jar install-jar build-policy install-limited
++# We don't need any policy files.
++all: build-jar install-jar
+ else  # OPENJDK
+ ifeq ($(strip $(FILES_java)),)
+ all:
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java openjdk/jdk/src/share/classes/javax/crypto/Cipher.java
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java	2010-07-29 21:55:43.000000000 +0100
++++ openjdk/jdk/src/share/classes/javax/crypto/Cipher.java	2010-09-01 10:37:32.926684780 +0100
+@@ -144,12 +144,6 @@
+     // The transformation
+     private String transformation;
+ 
+-    // Crypto permission representing the maximum allowable cryptographic
+-    // strength that this Cipher object can be used for. (The cryptographic
+-    // strength is a function of the keysize and algorithm parameters encoded
+-    // in the crypto permission.)
+-    private CryptoPermission cryptoPerm;
+-
+     // The exemption mechanism that needs to be enforced
+     private ExemptionMechanism exmech;
+ 
+@@ -190,16 +184,9 @@
+     protected Cipher(CipherSpi cipherSpi,
+                      Provider provider,
+                      String transformation) {
+-        // See bug 4341369 & 4334690 for more info.
+-        // If the caller is trusted, then okey.
+-        // Otherwise throw a NullPointerException.
+-        if (!JceSecurityManager.INSTANCE.isCallerTrusted()) {
+-            throw new NullPointerException();
+-        }
+         this.spi = cipherSpi;
+         this.provider = provider;
+         this.transformation = transformation;
+-        this.cryptoPerm = CryptoAllPermission.INSTANCE;
+         this.lock = null;
+     }
+ 
+@@ -212,7 +199,6 @@
+     Cipher(CipherSpi cipherSpi, String transformation) {
+         this.spi = cipherSpi;
+         this.transformation = transformation;
+-        this.cryptoPerm = CryptoAllPermission.INSTANCE;
+         this.lock = null;
+     }
+ 
+@@ -442,9 +428,6 @@
+         Exception failure = null;
+         while (t.hasNext()) {
+             Service s = (Service)t.next();
+-            if (JceSecurity.canUseProvider(s.getProvider()) == false) {
+-                continue;
+-            }
+             Transform tr = getTransform(s, transforms);
+             if (tr == null) {
+                 // should never happen
+@@ -570,7 +553,6 @@
+         }
+         Exception failure = null;
+         List transforms = getTransforms(transformation);
+-        boolean providerChecked = false;
+         String paddingError = null;
+         for (Iterator t = transforms.iterator(); t.hasNext();) {
+             Transform tr = (Transform)t.next();
+@@ -578,19 +560,6 @@
+             if (s == null) {
+                 continue;
+             }
+-            if (providerChecked == false) {
+-                // for compatibility, first do the lookup and then verify
+-                // the provider. this makes the difference between a NSAE
+-                // and a SecurityException if the
+-                // provider does not support the algorithm.
+-                Exception ve = JceSecurity.getVerificationResult(provider);
+-                if (ve != null) {
+-                    String msg = "JCE cannot authenticate the provider "
+-                        + provider.getName();
+-                    throw new SecurityException(msg, ve);
+-                }
+-                providerChecked = true;
+-            }
+             if (tr.supportsMode(s) == S_NO) {
+                 continue;
+             }
+@@ -603,7 +572,6 @@
+                 tr.setModePadding(spi);
+                 Cipher cipher = new Cipher(spi, transformation);
+                 cipher.provider = s.getProvider();
+-                cipher.initCryptoPermission();
+                 return cipher;
+             } catch (Exception e) {
+                 failure = e;
+@@ -622,22 +590,6 @@
+                 ("No such algorithm: " + transformation, failure);
+     }
+ 
+-    // If the requested crypto service is export-controlled,
+-    // determine the maximum allowable keysize.
+-    private void initCryptoPermission() throws NoSuchAlgorithmException {
+-        if (JceSecurity.isRestricted() == false) {
+-            cryptoPerm = CryptoAllPermission.INSTANCE;
+-            exmech = null;
+-            return;
+-        }
+-        cryptoPerm = getConfiguredPermission(transformation);
+-        // Instantiate the exemption mechanism (if required)
+-        String exmechName = cryptoPerm.getExemptionMechanism();
+-        if (exmechName != null) {
+-            exmech = ExemptionMechanism.getInstance(exmechName);
+-        }
+-    }
+-
+     // max number of debug warnings to print from chooseFirstProvider()
+     private static int warnCount = 10;
+ 
+@@ -679,9 +631,6 @@
+                     s = (Service)serviceIterator.next();
+                     thisSpi = null;
+                 }
+-                if (JceSecurity.canUseProvider(s.getProvider()) == false) {
+-                    continue;
+-                }
+                 Transform tr = getTransform(s, transforms);
+                 if (tr == null) {
+                     // should never happen
+@@ -699,7 +648,6 @@
+                         thisSpi = (CipherSpi)obj;
+                     }
+                     tr.setModePadding(thisSpi);
+-                    initCryptoPermission();
+                     spi = thisSpi;
+                     provider = s.getProvider();
+                     // not needed any more
+@@ -731,19 +679,15 @@
+             InvalidAlgorithmParameterException {
+         switch (type) {
+         case I_KEY:
+-            checkCryptoPerm(thisSpi, key);
+             thisSpi.engineInit(opmode, key, random);
+             break;
+         case I_PARAMSPEC:
+-            checkCryptoPerm(thisSpi, key, paramSpec);
+             thisSpi.engineInit(opmode, key, paramSpec, random);
+             break;
+         case I_PARAMS:
+-            checkCryptoPerm(thisSpi, key, params);
+             thisSpi.engineInit(opmode, key, params, random);
+             break;
+         case I_CERT:
+-            checkCryptoPerm(thisSpi, key);
+             thisSpi.engineInit(opmode, key, random);
+             break;
+         default:
+@@ -777,9 +721,6 @@
+                 if (s.supportsParameter(key) == false) {
+                     continue;
+                 }
+-                if (JceSecurity.canUseProvider(s.getProvider()) == false) {
+-                    continue;
+-                }
+                 Transform tr = getTransform(s, transforms);
+                 if (tr == null) {
+                     // should never happen
+@@ -793,7 +734,6 @@
+                         thisSpi = (CipherSpi)s.newInstance(null);
+                     }
+                     tr.setModePadding(thisSpi);
+-                    initCryptoPermission();
+                     implInit(thisSpi, initType, opmode, key, paramSpec,
+                                                         params, random);
+                     provider = s.getProvider();
+@@ -939,107 +879,6 @@
+         return exmech;
+     }
+ 
+-    //
+-    // Crypto permission check code below
+-    //
+-    private void checkCryptoPerm(CipherSpi checkSpi, Key key)
+-            throws InvalidKeyException {
+-        if (cryptoPerm == CryptoAllPermission.INSTANCE) {
+-            return;
+-        }
+-        // Check if key size and default parameters are within legal limits
+-        AlgorithmParameterSpec params;
+-        try {
+-            params = getAlgorithmParameterSpec(checkSpi.engineGetParameters());
+-        } catch (InvalidParameterSpecException ipse) {
+-            throw new InvalidKeyException
+-                ("Unsupported default algorithm parameters");
+-        }
+-        if (!passCryptoPermCheck(checkSpi, key, params)) {
+-            throw new InvalidKeyException(
+-                "Illegal key size or default parameters");
+-        }
+-    }
+-
+-    private void checkCryptoPerm(CipherSpi checkSpi, Key key,
+-            AlgorithmParameterSpec params) throws InvalidKeyException,
+-            InvalidAlgorithmParameterException {
+-        if (cryptoPerm == CryptoAllPermission.INSTANCE) {
+-            return;
+-        }
+-        // Determine keysize and check if it is within legal limits
+-        if (!passCryptoPermCheck(checkSpi, key, null)) {
+-            throw new InvalidKeyException("Illegal key size");
+-        }
+-        if ((params != null) && (!passCryptoPermCheck(checkSpi, key, params))) {
+-            throw new InvalidAlgorithmParameterException("Illegal parameters");
+-        }
+-    }
+-
+-    private void checkCryptoPerm(CipherSpi checkSpi, Key key,
+-            AlgorithmParameters params)
+-            throws InvalidKeyException, InvalidAlgorithmParameterException {
+-        if (cryptoPerm == CryptoAllPermission.INSTANCE) {
+-            return;
+-        }
+-        // Convert the specified parameters into specs and then delegate.
+-        AlgorithmParameterSpec pSpec;
+-        try {
+-            pSpec = getAlgorithmParameterSpec(params);
+-        } catch (InvalidParameterSpecException ipse) {
+-            throw new InvalidAlgorithmParameterException
+-                ("Failed to retrieve algorithm parameter specification");
+-        }
+-        checkCryptoPerm(checkSpi, key, pSpec);
+-    }
+-
+-    private boolean passCryptoPermCheck(CipherSpi checkSpi, Key key,
+-                                        AlgorithmParameterSpec params)
+-            throws InvalidKeyException {
+-        String em = cryptoPerm.getExemptionMechanism();
+-        int keySize = checkSpi.engineGetKeySize(key);
+-        // Use the "algorithm" component of the cipher
+-        // transformation so that the perm check would
+-        // work when the key has the "aliased" algo.
+-        String algComponent;
+-        int index = transformation.indexOf('/');
+-        if (index != -1) {
+-            algComponent = transformation.substring(0, index);
+-        } else {
+-            algComponent = transformation;
+-        }
+-        CryptoPermission checkPerm =
+-            new CryptoPermission(algComponent, keySize, params, em);
+-
+-        if (!cryptoPerm.implies(checkPerm)) {
+-            if (debug != null) {
+-                debug.println("Crypto Permission check failed");
+-                debug.println("granted: " + cryptoPerm);
+-                debug.println("requesting: " + checkPerm);
+-            }
+-            return false;
+-        }
+-        if (exmech == null) {
+-            return true;
+-        }
+-        try {
+-            if (!exmech.isCryptoAllowed(key)) {
+-                if (debug != null) {
+-                    debug.println(exmech.getName() + " isn't enforced");
+-                }
+-                return false;
+-            }
+-        } catch (ExemptionMechanismException eme) {
+-            if (debug != null) {
+-                debug.println("Cannot determine whether "+
+-                              exmech.getName() + " has been enforced");
+-                eme.printStackTrace();
+-            }
+-            return false;
+-        }
+-        return true;
+-    }
+-
+     // check if opmode is one of the defined constants
+     // throw InvalidParameterExeption if not
+     private static void checkOpmode(int opmode) {
+@@ -1144,7 +983,6 @@
+         checkOpmode(opmode);
+ 
+         if (spi != null) {
+-            checkCryptoPerm(spi, key);
+             spi.engineInit(opmode, key, random);
+         } else {
+             try {
+@@ -1270,7 +1108,6 @@
+         checkOpmode(opmode);
+ 
+         if (spi != null) {
+-            checkCryptoPerm(spi, key, params);
+             spi.engineInit(opmode, key, params, random);
+         } else {
+             chooseProvider(I_PARAMSPEC, opmode, key, params, null, random);
+@@ -1391,7 +1228,6 @@
+         checkOpmode(opmode);
+ 
+         if (spi != null) {
+-            checkCryptoPerm(spi, key, params);
+             spi.engineInit(opmode, key, params, random);
+         } else {
+             chooseProvider(I_PARAMS, opmode, key, null, params, random);
+@@ -1555,7 +1391,6 @@
+             (certificate==null? null:certificate.getPublicKey());
+ 
+         if (spi != null) {
+-            checkCryptoPerm(spi, publicKey);
+             spi.engineInit(opmode, publicKey, random);
+         } else {
+             try {
+@@ -2361,12 +2196,15 @@
+         return null;
+     }
+ 
++    // Used by getMaxAllowedKeyLength and getMaxAllowedParameterSpec
++    // always returns CryptoAllPermission. Old stuff from bad old days.
+     private static CryptoPermission getConfiguredPermission(
+             String transformation) throws NullPointerException,
+             NoSuchAlgorithmException {
+         if (transformation == null) throw new NullPointerException();
+-        String[] parts = tokenizeTransformation(transformation);
+-        return JceSecurityManager.INSTANCE.getCryptoPermission(parts[0]);
++	// Called to make sure it is a valid transformation.
++        tokenizeTransformation(transformation);
++        return CryptoAllPermission.INSTANCE;
+     }
+ 
+     /**
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JarVerifier.java openjdk/jdk/src/share/classes/javax/crypto/JarVerifier.java
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/JarVerifier.java	2010-07-29 21:55:43.000000000 +0100
++++ openjdk/jdk/src/share/classes/javax/crypto/JarVerifier.java	1970-01-01 01:00:00.000000000 +0100
+@@ -1,157 +0,0 @@
+-/*
+- * Copyright (c) 2007, 2009, 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
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-package javax.crypto;
+-
+-import java.io.*;
+-import java.net.*;
+-import java.security.*;
+-import java.util.jar.*;
+-
+-/**
+- * This class verifies JAR files (and any supporting JAR files), and
+- * determines whether they may be used in this implementation.
+- *
+- * The JCE in OpenJDK has an open cryptographic interface, meaning it
+- * does not restrict which providers can be used.  Compliance with
+- * United States export controls and with local law governing the
+- * import/export of products incorporating the JCE in the OpenJDK is
+- * the responsibility of the licensee.
+- *
+- * @since 1.7
+- */
+-final class JarVerifier {
+-
+-    // The URL for the JAR file we want to verify.
+-    private URL jarURL;
+-    private boolean savePerms;
+-    private CryptoPermissions appPerms = null;
+-
+-    /**
+-     * Creates a JarVerifier object to verify the given URL.
+-     *
+-     * @param jarURL the JAR file to be verified.
+-     * @param savePerms if true, save the permissions allowed by the
+-     *          exemption mechanism
+-     */
+-    JarVerifier(URL jarURL, boolean savePerms) {
+-        this.jarURL = jarURL;
+-        this.savePerms = savePerms;
+-    }
+-
+-    /**
+-     * Verify the JAR file is signed by an entity which has a certificate
+-     * issued by a trusted CA.
+-     *
+-     * In OpenJDK, we just need to examine the "cryptoperms" file to see
+-     * if any permissions were bundled together with this jar file.
+-     */
+-    void verify() throws JarException, IOException {
+-
+-        // Short-circuit.  If we weren't asked to save any, we're done.
+-        if (!savePerms) {
+-            return;
+-        }
+-
+-        // If the protocol of jarURL isn't "jar", we should
+-        // construct a JAR URL so we can open a JarURLConnection
+-        // for verifying this provider.
+-        final URL url = jarURL.getProtocol().equalsIgnoreCase("jar")?
+-                        jarURL : new URL("jar:" + jarURL.toString() + "!/");
+-
+-        JarFile jf = null;
+-        try {
+-
+-            // Get a link to the Jarfile to search.
+-            try {
+-                jf = (JarFile)
+-                    AccessController.doPrivileged(
+-                        new PrivilegedExceptionAction() {
+-                            public Object run() throws Exception {
+-                                JarURLConnection conn =
+-                                    (JarURLConnection) url.openConnection();
+-                                // You could do some caching here as
+-                                // an optimization.
+-                                conn.setUseCaches(false);
+-                                return conn.getJarFile();
+-                            }
+-                        });
+-            } catch (java.security.PrivilegedActionException pae) {
+-                SecurityException se = new SecurityException(
+-                    "Cannot load " + url.toString());
+-                se.initCause(pae);
+-                throw se;
+-            }
+-
+-            if (jf != null) {
+-                JarEntry je = jf.getJarEntry("cryptoPerms");
+-                if (je == null) {
+-                    throw new JarException(
+-                        "Can not find cryptoPerms");
+-                }
+-                try {
+-                    appPerms = new CryptoPermissions();
+-                    appPerms.load(jf.getInputStream(je));
+-                } catch (Exception ex) {
+-                    JarException jex =
+-                        new JarException("Cannot load/parse" +
+-                            jarURL.toString());
+-                    jex.initCause(ex);
+-                    throw jex;
+-                }
+-            }
+-        } finally {
+-            // Only call close() when caching is not enabled.
+-            // Otherwise, exceptions will be thrown for all
+-            // subsequent accesses of this cached jar.
+-            if (jf != null) {
+-                jf.close();
+-            }
+-        }
+-    }
+-
+-    /**
+-     * Verify that the provided certs include the
+-     * framework signing certificate.
+-     *
+-     * @param certs the list of certs to be checked.
+-     * @throws Exception if the list of certs did not contain
+-     *          the framework signing certificate
+-     */
+-    static void verifyPolicySigned(java.security.cert.Certificate[] certs)
+-            throws Exception {
+-    }
+-
+-    /**
+-     * Returns the permissions which are bundled with the JAR file,
+-     * aka the "cryptoperms" file.
+-     *
+-     * NOTE: if this JarVerifier instance is constructed with "savePerms"
+-     * equal to false, then this method would always return null.
+-     */
+-    CryptoPermissions getPermissions() {
+-        return appPerms;
+-    }
+-}
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java	2010-07-29 21:55:43.000000000 +0100
++++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java	2010-09-01 10:37:32.934684089 +0100
+@@ -27,8 +27,6 @@
+ 
+ import java.util.*;
+ import java.util.jar.*;
+-import java.io.*;
+-import java.net.URL;
+ import java.security.*;
+ 
+ import java.security.Provider.Service;
+@@ -47,72 +45,25 @@
+ 
+ final class JceSecurity {
+ 
++    // Used in KeyGenerator, Cipher and KeyAgreement.
+     static final SecureRandom RANDOM = new SecureRandom();
+ 
+-    // The defaultPolicy and exemptPolicy will be set up
+-    // in the static initializer.
+-    private static CryptoPermissions defaultPolicy = null;
+-    private static CryptoPermissions exemptPolicy = null;
+-
+-    // Map<Provider,?> of the providers we already have verified
+-    // value == PROVIDER_VERIFIED is successfully verified
+-    // value is failure cause Exception in error case
+-    private final static Map verificationResults = new IdentityHashMap();
+-
+-    // Map<Provider,?> of the providers currently being verified
+-    private final static Map verifyingProviders = new IdentityHashMap();
+-
+-    // Set the default value. May be changed in the static initializer.
+-    private static boolean isRestricted = true;
+-
+     /*
+      * Don't let anyone instantiate this.
+      */
+     private JceSecurity() {
+     }
+ 
+-    static {
+-        try {
+-            AccessController.doPrivileged(new PrivilegedExceptionAction() {
+-                public Object run() throws Exception {
+-                    setupJurisdictionPolicies();
+-                    return null;
+-                }
+-            });
+-
+-            isRestricted = defaultPolicy.implies(
+-                CryptoAllPermission.INSTANCE) ? false : true;
+-        } catch (Exception e) {
+-            SecurityException se =
+-                new SecurityException(
+-                    "Can not initialize cryptographic mechanism");
+-            se.initCause(e);
+-            throw se;
+-        }
+-    }
+-
+     static Instance getInstance(String type, Class clazz, String algorithm,
+             String provider) throws NoSuchAlgorithmException,
+             NoSuchProviderException {
+         Service s = GetInstance.getService(type, algorithm, provider);
+-        Exception ve = getVerificationResult(s.getProvider());
+-        if (ve != null) {
+-            String msg = "JCE cannot authenticate the provider " + provider;
+-            throw (NoSuchProviderException)
+-                                new NoSuchProviderException(msg).initCause(ve);
+-        }
+         return GetInstance.getInstance(s, clazz);
+     }
+ 
+     static Instance getInstance(String type, Class clazz, String algorithm,
+             Provider provider) throws NoSuchAlgorithmException {
+         Service s = GetInstance.getService(type, algorithm, provider);
+-        Exception ve = JceSecurity.getVerificationResult(provider);
+-        if (ve != null) {
+-            String msg = "JCE cannot authenticate the provider "
+-                + provider.getName();
+-            throw new SecurityException(msg, ve);
+-        }
+         return GetInstance.getInstance(s, clazz);
+     }
+ 
+@@ -122,10 +73,6 @@
+         NoSuchAlgorithmException failure = null;
+         for (Iterator t = services.iterator(); t.hasNext(); ) {
+             Service s = (Service)t.next();
+-            if (canUseProvider(s.getProvider()) == false) {
+-                // allow only signed providers
+-                continue;
+-            }
+             try {
+                 Instance instance = GetInstance.getInstance(s, clazz);
+                 return instance;
+@@ -137,198 +84,10 @@
+                 + " not available", failure);
+     }
+ 
+-    /**
+-     * Verify if the JAR at URL codeBase is a signed exempt application
+-     * JAR file and returns the permissions bundled with the JAR.
+-     *
+-     * @throws Exception on error
+-     */
+-    static CryptoPermissions verifyExemptJar(URL codeBase) throws Exception {
+-        JarVerifier jv = new JarVerifier(codeBase, true);
+-        jv.verify();
+-        return jv.getPermissions();
+-    }
+-
+-    /**
+-     * Verify if the JAR at URL codeBase is a signed provider JAR file.
+-     *
+-     * @throws Exception on error
+-     */
+-    static void verifyProviderJar(URL codeBase) throws Exception {
+-        // Verify the provider JAR file and all
+-        // supporting JAR files if there are any.
+-        JarVerifier jv = new JarVerifier(codeBase, false);
+-        jv.verify();
+-    }
+-
+-    private final static Object PROVIDER_VERIFIED = Boolean.TRUE;
+-
+-    /*
+-     * Verify that the provider JAR files are signed properly, which
+-     * means the signer's certificate can be traced back to a
+-     * JCE trusted CA.
+-     * Return null if ok, failure Exception if verification failed.
+-     */
+-    static synchronized Exception getVerificationResult(Provider p) {
+-        Object o = verificationResults.get(p);
+-        if (o == PROVIDER_VERIFIED) {
+-            return null;
+-        } else if (o != null) {
+-            return (Exception)o;
+-        }
+-        if (verifyingProviders.get(p) != null) {
+-            // this method is static synchronized, must be recursion
+-            // return failure now but do not save the result
+-            return new NoSuchProviderException("Recursion during verification");
+-        }
+-        try {
+-            verifyingProviders.put(p, Boolean.FALSE);
+-            URL providerURL = getCodeBase(p.getClass());
+-            verifyProviderJar(providerURL);
+-            // Verified ok, cache result
+-            verificationResults.put(p, PROVIDER_VERIFIED);
+-            return null;
+-        } catch (Exception e) {
+-            verificationResults.put(p, e);
+-            return e;
+-        } finally {
+-            verifyingProviders.remove(p);
+-        }
+-    }
+-
+-    // return whether this provider is properly signed and can be used by JCE
++    // Used to return whether this provider is properly signed and
++    // can be used by JCE. These days just returns true. Still used
++    // in SecretKeyFactory, KeyGenerator, Mac and KeyAgreement.
+     static boolean canUseProvider(Provider p) {
+-        return getVerificationResult(p) == null;
+-    }
+-
+-    // dummy object to represent null
+-    private static final URL NULL_URL;
+-
+-    static {
+-        try {
+-            NULL_URL = new URL("http://null.sun.com/");
+-        } catch (Exception e) {
+-            throw new RuntimeException(e);
+-        }
+-    }
+-
+-    // reference to a Map we use as a cache for codebases
+-    private static final Map codeBaseCacheRef = new WeakHashMap();
+-
+-    /*
+-     * Retuns the CodeBase for the given class.
+-     */
+-    static URL getCodeBase(final Class clazz) {
+-        URL url = (URL)codeBaseCacheRef.get(clazz);
+-        if (url == null) {
+-            url = (URL)AccessController.doPrivileged(new PrivilegedAction() {
+-                public Object run() {
+-                    ProtectionDomain pd = clazz.getProtectionDomain();
+-                    if (pd != null) {
+-                        CodeSource cs = pd.getCodeSource();
+-                        if (cs != null) {
+-                            return cs.getLocation();
+-                        }
+-                    }
+-                    return NULL_URL;
+-                }
+-            });
+-            codeBaseCacheRef.put(clazz, url);
+-        }
+-        return (url == NULL_URL) ? null : url;
+-    }
+-
+-    private static void setupJurisdictionPolicies() throws Exception {
+-        String javaHomeDir = System.getProperty("java.home");
+-        String sep = File.separator;
+-        String pathToPolicyJar = javaHomeDir + sep + "lib" + sep +
+-            "security" + sep;
+-
+-        File exportJar = new File(pathToPolicyJar, "US_export_policy.jar");
+-        File importJar = new File(pathToPolicyJar, "local_policy.jar");
+-        URL jceCipherURL = ClassLoader.getSystemResource
+-                ("javax/crypto/Cipher.class");
+-
+-        if ((jceCipherURL == null) ||
+-                !exportJar.exists() || !importJar.exists()) {
+-            throw new SecurityException
+-                                ("Cannot locate policy or framework files!");
+-        }
+-
+-        // Read jurisdiction policies.
+-        CryptoPermissions defaultExport = new CryptoPermissions();
+-        CryptoPermissions exemptExport = new CryptoPermissions();
+-        loadPolicies(exportJar, defaultExport, exemptExport);
+-
+-        CryptoPermissions defaultImport = new CryptoPermissions();
+-        CryptoPermissions exemptImport = new CryptoPermissions();
+-        loadPolicies(importJar, defaultImport, exemptImport);
+-
+-        // Merge the export and import policies for default applications.
+-        if (defaultExport.isEmpty() || defaultImport.isEmpty()) {
+-            throw new SecurityException("Missing mandatory jurisdiction " +
+-                                        "policy files");
+-        }
+-        defaultPolicy = defaultExport.getMinimum(defaultImport);
+-
+-        // Merge the export and import policies for exempt applications.
+-        if (exemptExport.isEmpty())  {
+-            exemptPolicy = exemptImport.isEmpty() ? null : exemptImport;
+-        } else {
+-            exemptPolicy = exemptExport.getMinimum(exemptImport);
+-        }
+-    }
+-
+-    /**
+-     * Load the policies from the specified file. Also checks that the
+-     * policies are correctly signed.
+-     */
+-    private static void loadPolicies(File jarPathName,
+-                                     CryptoPermissions defaultPolicy,
+-                                     CryptoPermissions exemptPolicy)
+-        throws Exception {
+-
+-        JarFile jf = new JarFile(jarPathName);
+-
+-        Enumeration entries = jf.entries();
+-        while (entries.hasMoreElements()) {
+-            JarEntry je = (JarEntry)entries.nextElement();
+-            InputStream is = null;
+-            try {
+-                if (je.getName().startsWith("default_")) {
+-                    is = jf.getInputStream(je);
+-                    defaultPolicy.load(is);
+-                } else if (je.getName().startsWith("exempt_")) {
+-                    is = jf.getInputStream(je);
+-                    exemptPolicy.load(is);
+-                } else {
+-                    continue;
+-                }
+-            } finally {
+-                if (is != null) {
+-                    is.close();
+-                }
+-            }
+-
+-            // Enforce the signer restraint, i.e. signer of JCE framework
+-            // jar should also be the signer of the two jurisdiction policy
+-            // jar files.
+-            JarVerifier.verifyPolicySigned(je.getCertificates());
+-        }
+-        // Close and nullify the JarFile reference to help GC.
+-        jf.close();
+-        jf = null;
+-    }
+-
+-    static CryptoPermissions getDefaultPolicy() {
+-        return defaultPolicy;
+-    }
+-
+-    static CryptoPermissions getExemptPolicy() {
+-        return exemptPolicy;
+-    }
+-
+-    static boolean isRestricted() {
+-        return isRestricted;
++        return true;
+     }
+ }
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurityManager.java openjdk/jdk/src/share/classes/javax/crypto/JceSecurityManager.java
+--- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurityManager.java	2010-07-29 21:55:43.000000000 +0100
++++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurityManager.java	1970-01-01 01:00:00.000000000 +0100
+@@ -1,252 +0,0 @@
+-/*
+- * Copyright (c) 1999, 2007, 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
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-package javax.crypto;
+-
+-import java.security.*;
+-import java.net.*;
+-import java.util.*;
+-import java.util.jar.*;
+-
+-/**
+- * The JCE security manager.
+- *
+- * <p>The JCE security manager is responsible for determining the maximum
+- * allowable cryptographic strength for a given applet/application, for a given
+- * algorithm, by consulting the configured jurisdiction policy files and
+- * the cryptographic permissions bundled with the applet/application.
+- *
+- * <p>Note that this security manager is never installed, only instantiated.
+- *
+- * @author Jan Luehe
+- *
+- * @since 1.4
+- */
+-
+-final class JceSecurityManager extends SecurityManager {
+-
+-    private static final CryptoPermissions defaultPolicy;
+-    private static final CryptoPermissions exemptPolicy;
+-    private static final CryptoAllPermission allPerm;
+-    private static final Vector TrustedCallersCache = new Vector(2);
+-    private static final Map exemptCache = new HashMap();
+-
+-    // singleton instance
+-    static final JceSecurityManager INSTANCE;
+-
+-    static {
+-        defaultPolicy = JceSecurity.getDefaultPolicy();
+-        exemptPolicy = JceSecurity.getExemptPolicy();
+-        allPerm = CryptoAllPermission.INSTANCE;
+-        INSTANCE = (JceSecurityManager)
+-              AccessController.doPrivileged(new PrivilegedAction() {
+-                  public Object run() {
+-                      return new JceSecurityManager();
+-                  }
+-              });
+-    }
+-
+-    private JceSecurityManager() {
+-        // empty
+-    }
+-
+-    /**
+-     * Returns the maximum allowable crypto strength for the given
+-     * applet/application, for the given algorithm.
+-     */
+-    CryptoPermission getCryptoPermission(String alg) {
+-        // Need to convert to uppercase since the crypto perm
+-        // lookup is case sensitive.
+-        alg = alg.toUpperCase(Locale.ENGLISH);
+-
+-        // If CryptoAllPermission is granted by default, we return that.
+-        // Otherwise, this will be the permission we return if anything goes
+-        // wrong.
+-        CryptoPermission defaultPerm = getDefaultPermission(alg);
+-        if (defaultPerm == CryptoAllPermission.INSTANCE) {
+-            return defaultPerm;
+-        }
+-
+-        // Determine the codebase of the caller of the JCE API.
+-        // This is the codebase of the first class which is not in
+-        // javax.crypto.* packages.
+-        // NOTE: javax.crypto.* package maybe subject to package
+-        // insertion, so need to check its classloader as well.
+-        Class[] context = getClassContext();
+-        URL callerCodeBase = null;
+-        int i;
+-        for (i=0; i<context.length; i++) {
+-            Class cls = context[i];
+-            callerCodeBase = JceSecurity.getCodeBase(cls);
+-            if (callerCodeBase != null) {
+-                break;
+-            } else {
+-                if (cls.getName().startsWith("javax.crypto.")) {
+-                    // skip jce classes since they aren't the callers
+-                    continue;
+-                }
+-                // use default permission when the caller is system classes
+-                return defaultPerm;
+-            }
+-        }
+-
+-        if (i == context.length) {
+-            return defaultPerm;
+-        }
+-
+-        CryptoPermissions appPerms;
+-        synchronized (this.getClass()) {
+-            if (exemptCache.containsKey(callerCodeBase)) {
+-                appPerms = (CryptoPermissions)exemptCache.get(callerCodeBase);
+-            } else {
+-                appPerms = getAppPermissions(callerCodeBase);
+-                exemptCache.put(callerCodeBase, appPerms);
+-            }
+-        }
+-
+-        if (appPerms == null) {
+-            return defaultPerm;
+-        }
+-
+-        // If the app was granted the special CryptoAllPermission, return that.
+-        if (appPerms.implies(allPerm)) {
+-            return allPerm;
+-        }
+-
+-        // Check if the crypto permissions granted to the app contain a
+-        // crypto permission for the requested algorithm that does not require
+-        // any exemption mechanism to be enforced.
+-        // Return that permission, if present.
+-        PermissionCollection appPc = appPerms.getPermissionCollection(alg);
+-        if (appPc == null) {
+-            return defaultPerm;
+-        }
+-        Enumeration enum_ = appPc.elements();
+-        while (enum_.hasMoreElements()) {
+-            CryptoPermission cp = (CryptoPermission)enum_.nextElement();
+-            if (cp.getExemptionMechanism() == null) {
+-                return cp;
+-            }
+-        }
+-
+-        // Check if the jurisdiction file for exempt applications contains
+-        // any entries for the requested algorithm.
+-        // If not, return the default permission.
+-        PermissionCollection exemptPc =
+-            exemptPolicy.getPermissionCollection(alg);
+-        if (exemptPc == null) {
+-            return defaultPerm;
+-        }
+-
+-        // In the jurisdiction file for exempt applications, go through the
+-        // list of CryptoPermission entries for the requested algorithm, and
+-        // stop at the first entry:
+-        //  - that is implied by the collection of crypto permissions granted
+-        //    to the app, and
+-        //  - whose exemption mechanism is available from one of the
+-        //    registered CSPs
+-        enum_ = exemptPc.elements();
+-        while (enum_.hasMoreElements()) {
+-            CryptoPermission cp = (CryptoPermission)enum_.nextElement();
+-            try {
+-                ExemptionMechanism.getInstance(cp.getExemptionMechanism());
+-                if (cp.getAlgorithm().equals(
+-                                      CryptoPermission.ALG_NAME_WILDCARD)) {
+-                    CryptoPermission newCp;
+-                    if (cp.getCheckParam()) {
+-                        newCp = new CryptoPermission(
+-                                alg, cp.getMaxKeySize(),
+-                                cp.getAlgorithmParameterSpec(),
+-                                cp.getExemptionMechanism());
+-                    } else {
+-                        newCp = new CryptoPermission(
+-                                alg, cp.getMaxKeySize(),
+-                                cp.getExemptionMechanism());
+-                    }
+-                    if (appPerms.implies(newCp)) {
+-                        return newCp;
+-                    }
+-                }
+-
+-                if (appPerms.implies(cp)) {
+-                    return cp;
+-                }
+-            } catch (Exception e) {
+-                continue;
+-            }
+-        }
+-        return defaultPerm;
+-    }
+-
+-    private static CryptoPermissions getAppPermissions(URL callerCodeBase) {
+-        // Check if app is exempt, and retrieve the permissions bundled with it
+-        try {
+-            return JceSecurity.verifyExemptJar(callerCodeBase);
+-        } catch (Exception e) {
+-            // Jar verification fails
+-            return null;
+-        }
+-
+-    }
+-
+-    /**
+-     * Returns the default permission for the given algorithm.
+-     */
+-    private CryptoPermission getDefaultPermission(String alg) {
+-        Enumeration enum_ =
+-            defaultPolicy.getPermissionCollection(alg).elements();
+-        return (CryptoPermission)enum_.nextElement();
+-    }
+-
+-    // See  bug 4341369 & 4334690 for more info.
+-    boolean isCallerTrusted() {
+-        // Get the caller and its codebase.
+-        Class[] context = getClassContext();
+-        URL callerCodeBase = null;
+-        int i;
+-        for (i=0; i<context.length; i++) {
+-            callerCodeBase = JceSecurity.getCodeBase(context[i]);
+-            if (callerCodeBase != null) {
+-                break;
+-            }
+-        }
+-        // The caller is in the JCE framework.
+-        if (i == context.length) {
+-            return true;
+-        }
+-        //The caller has been verified.
+-        if (TrustedCallersCache.contains(context[i])) {
+-            return true;
+-        }
+-        // Check whether the caller is a trusted provider.
+-        try {
+-            JceSecurity.verifyProviderJar(callerCodeBase);
+-        } catch (Exception e2) {
+-            return false;
+-        }
+-        TrustedCallersCache.addElement(context[i]);
+-        return true;
+-    }
+-}
+diff -Nru openjdk.orig/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java openjdk/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java
+--- openjdk.orig/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2010-07-29 21:56:21.000000000 +0100
++++ openjdk/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2010-09-01 10:37:32.934684089 +0100
+@@ -44,18 +44,9 @@
+         }
+     }
+ 
+-    private static boolean isUnlimitedPolicy() throws IOException {
++    private static boolean isUnlimitedPolicy() {
+         if (instance == null) {
+-            String jreDir = System.getProperty("java.home");
+-            String localPolicyPath = jreDir + File.separator + "lib" +
+-                File.separator + "security" + File.separator +
+-                "local_policy.jar";
+-            JarFile localPolicy = new JarFile(localPolicyPath);
+-            if (localPolicy.getEntry("exempt_local.policy") == null) {
+-                return true;
+-            } else {
+-                return false;
+-            }
++            return true;
+         } else {
+             return instance.isUnlimited;
+         }
--- a/patches/debian/icedtea-uname.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-diff -Nru openjdk.orig/corba/make/common/shared/Platform.gmk openjdk/corba/make/common/shared/Platform.gmk
---- openjdk.orig/corba/make/common/shared/Platform.gmk	2011-03-14 22:08:07.000000000 +0000
-+++ openjdk/corba/make/common/shared/Platform.gmk	2011-04-21 10:35:01.629157957 +0100
-@@ -153,6 +153,9 @@
-   OS_VERSION := $(shell uname -r)
-   # Arch and OS name/version
-   mach := $(shell uname -m)
-+  ifneq (,$(wildcard /usr/bin/dpkg-architecture))
-+    mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
-+  endif
-   archExpr = case "$(mach)" in \
-                 i[3-9]86) \
-                     echo i586 \
-diff -Nru openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
---- openjdk.orig/jdk/make/common/shared/Platform.gmk	2011-04-20 04:40:20.000000000 +0100
-+++ openjdk/jdk/make/common/shared/Platform.gmk	2011-04-21 10:35:35.653711575 +0100
-@@ -160,6 +160,9 @@
-   else
-     mach := $(shell uname -m)
-   endif
-+  ifneq (,$(wildcard /usr/bin/dpkg-architecture))
-+    mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
-+  endif
-   archExpr = case "$(mach)" in \
-                 i[3-9]86) \
-                     echo i586 \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/debian/uname.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,26 @@
+diff -Nru openjdk.orig/corba/make/common/shared/Platform.gmk openjdk/corba/make/common/shared/Platform.gmk
+--- openjdk.orig/corba/make/common/shared/Platform.gmk	2011-03-14 22:08:07.000000000 +0000
++++ openjdk/corba/make/common/shared/Platform.gmk	2011-04-21 10:35:01.629157957 +0100
+@@ -153,6 +153,9 @@
+   OS_VERSION := $(shell uname -r)
+   # Arch and OS name/version
+   mach := $(shell uname -m)
++  ifneq (,$(wildcard /usr/bin/dpkg-architecture))
++    mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
++  endif
+   archExpr = case "$(mach)" in \
+                 i[3-9]86) \
+                     echo i586 \
+diff -Nru openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
+--- openjdk.orig/jdk/make/common/shared/Platform.gmk	2011-04-20 04:40:20.000000000 +0100
++++ openjdk/jdk/make/common/shared/Platform.gmk	2011-04-21 10:35:35.653711575 +0100
+@@ -160,6 +160,9 @@
+   else
+     mach := $(shell uname -m)
+   endif
++  ifneq (,$(wildcard /usr/bin/dpkg-architecture))
++    mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
++  endif
+   archExpr = case "$(mach)" in \
+                 i[3-9]86) \
+                     echo i586 \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/demos.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,317 @@
+--- openjdkb18/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2007-08-16 03:33:19.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2007-08-23 16:12:59.000000000 -0400
+@@ -43,7 +43,7 @@
+ 
+ # Source lists
+ LIBNAME=gctest
+-SOURCES=gctest.c ../agent_util/agent_util.c
++SOURCES=gctest.c ../../agent_util/src/agent_util.c
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -89,7 +89,7 @@
+     # Object files needed to create library
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+-    LIBRARY=lib$(LIBNAME).so
++    LIBRARY=../lib/lib$(LIBNAME).so
+     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+@@ -122,7 +122,7 @@
+ 
+ # Common -I options
+ CFLAGS += -I.
+-CFLAGS += -I../agent_util
++CFLAGS += -I../../agent_util/src
+ CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
+ 
+ # Default rule
+--- openjdkb18/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2007-08-16 03:33:20.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2007-08-24 15:15:40.000000000 -0400
+@@ -41,13 +41,15 @@
+ #
+ ########################################################################
+ 
++JAVA_CRW_DEMO=../../java_crw_demo/src/libjava_crw_demo.so
++
+ # Source lists
+ LIBNAME=heapTracker
+-SOURCES=heapTracker.c ../agent_util/agent_util.c
++SOURCES=heapTracker.c ../../agent_util/src/agent_util.c
+ JAVA_SOURCES=HeapTracker.java
+ 
+ # Name of jar file that needs to be created
+-JARFILE=heapTracker.jar
++JARFILE=../heapTracker.jar
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -93,10 +95,10 @@
+     # Object files needed to create library
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+-    LIBRARY=lib$(LIBNAME).so
++    LIBRARY=../lib/lib$(LIBNAME).so
+     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
+     # Libraries we are dependent on
+-    LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
++    LIBRARIES=-L../../java_crw_demo/src/ -ljava_crw_demo -lc
+     # Building a shared library
+     LINK_SHARED=$(LINK.c) -shared -o $@
+ endif
+@@ -128,15 +130,18 @@
+ 
+ # Common -I options
+ CFLAGS += -I.
+-CFLAGS += -I../agent_util
+-CFLAGS += -I../java_crw_demo
++CFLAGS += -I../../agent_util/src
++CFLAGS += -I../../java_crw_demo/src
+ CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
+ 
+ # Default rule (build both native library and jar file)
+ all: $(LIBRARY) $(JARFILE)
+ 
++$(JAVA_CRW_DEMO):
++	make JDK=$(JDK) OSNAME=$(OSNAME) -C ../../java_crw_demo/src -f sample.makefile.txt
++
+ # Build native library
+-$(LIBRARY): $(OBJECTS)
++$(LIBRARY): $(OBJECTS) $(JAVA_CRW_DEMO)
+ 	$(LINK_SHARED) $(OBJECTS) $(LIBRARIES)
+ 
+ # Build jar file
+--- openjdkb18/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2007-08-16 03:33:20.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2007-08-23 16:13:00.000000000 -0400
+@@ -43,7 +43,7 @@
+ 
+ # Source lists
+ LIBNAME=heapViewer
+-SOURCES=heapViewer.c ../agent_util/agent_util.c
++SOURCES=heapViewer.c ../../agent_util/src/agent_util.c
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -89,7 +89,7 @@
+     # Object files needed to create library
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+-    LIBRARY=lib$(LIBNAME).so
++    LIBRARY=../lib/lib$(LIBNAME).so
+     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+@@ -123,6 +123,7 @@
+ # Common -I options
+ CFLAGS += -I.
+ CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
++CFLAGS += -I../../agent_util/src
+ 
+ # Default rule
+ all: $(LIBRARY)
+--- openjdkb18/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2007-08-23 16:12:58.000000000 -0400
+@@ -73,7 +73,7 @@
+ JAVA_SOURCES=Tracker.java
+ 
+ # Name of jar file that needs to be created
+-#JARFILE=hprof.jar
++JARFILE=../hprof.jar
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -110,7 +110,7 @@
+ # Linux GNU C Compiler
+ ifeq ($(OSNAME), linux)
+     # GNU Compiler options needed to build it
+-    COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer
++    COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer -DSKIP_NPT
+     # Options that help find errors
+     COMMON_FLAGS+= -W -Wall  -Wno-unused -Wno-parentheses
+     # To allow access to dladdr()
+@@ -166,7 +166,7 @@
+ 
+ # Common -I options
+ CFLAGS += -I.
+-CFLAGS += -I../java_crw_demo
++CFLAGS += -I../../java_crw_demo/src
+ CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
+ 
+ # Default rule (build both native library and jar file)
+--- openjdkb18/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2007-08-24 15:16:17.000000000 -0400
+@@ -41,13 +41,15 @@
+ #
+ ########################################################################
+ 
++JAVA_CRW_DEMO=../../java_crw_demo/src/libjava_crw_demo.so
++
+ # Source lists
+ LIBNAME=minst
+-SOURCES=minst.c ../agent_util/agent_util.c
++SOURCES=minst.c ../../agent_util/src/agent_util.c
+ JAVA_SOURCES=Minst.java
+ 
+ # Name of jar file that needs to be created
+-JARFILE=minst.jar
++JARFILE=../minst.jar
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -93,10 +95,10 @@
+     # Object files needed to create library
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+-    LIBRARY=lib$(LIBNAME).so
++    LIBRARY=../lib/lib$(LIBNAME).so
+     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
+     # Libraries we are dependent on
+-    LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
++    LIBRARIES=-L../../java_crw_demo/src/ -ljava_crw_demo -lc
+     # Building a shared library
+     LINK_SHARED=$(LINK.c) -shared -o $@
+ endif
+@@ -128,15 +130,18 @@
+ 
+ # Common -I options
+ CFLAGS += -I.
+-CFLAGS += -I../agent_util
+-CFLAGS += -I../java_crw_demo
++CFLAGS += -I../../agent_util/src
++CFLAGS += -I../../java_crw_demo/src
+ CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
+ 
+ # Default rule (build both native library and jar file)
+ all: $(LIBRARY) $(JARFILE)
+ 
++$(JAVA_CRW_DEMO):	
++	make JDK=$(JDK) OSNAME=$(OSNAME) -C ../../java_crw_demo/src -f sample.makefile.txt
++
+ # Build native library
+-$(LIBRARY): $(OBJECTS)
++$(LIBRARY): $(OBJECTS) $(JAVA_CRW_DEMO)
+ 	$(LINK_SHARED) $(OBJECTS) $(LIBRARIES)
+ 
+ # Build jar file
+--- openjdkb18/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2007-08-24 15:16:01.000000000 -0400
+@@ -41,13 +41,15 @@
+ #
+ ########################################################################
+ 
++JAVA_CRW_DEMO=../../java_crw_demo/src/libjava_crw_demo.so
++
+ # Source lists
+ LIBNAME=mtrace
+-SOURCES=mtrace.c ../agent_util/agent_util.c
++SOURCES=mtrace.c ../../agent_util/src/agent_util.c
+ JAVA_SOURCES=Mtrace.java
+ 
+ # Name of jar file that needs to be created
+-JARFILE=mtrace.jar
++JARFILE=../mtrace.jar
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -93,10 +95,11 @@
+     # Object files needed to create library
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+-    LIBRARY=lib$(LIBNAME).so
++    LIBRARY=../lib/lib$(LIBNAME).so
+     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
+     # Libraries we are dependent on
+-    LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
++    LIBRARIES=-L../../java_crw_demo/src -ljava_crw_demo -lc
++
+     # Building a shared library
+     LINK_SHARED=$(LINK.c) -shared -o $@
+ endif
+@@ -128,15 +131,18 @@
+ 
+ # Common -I options
+ CFLAGS += -I.
+-CFLAGS += -I../agent_util
+-CFLAGS += -I../java_crw_demo
++CFLAGS += -I../../agent_util/src
++CFLAGS += -I../../java_crw_demo/src
+ CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
+ 
+ # Default rule (build both native library and jar file)
+ all: $(LIBRARY) $(JARFILE)
+ 
++$(JAVA_CRW_DEMO):
++	make JDK=$(JDK) OSNAME=$(OSNAME) -C ../../java_crw_demo/src -f sample.makefile.txt
++
+ # Build native library
+-$(LIBRARY): $(OBJECTS)
++$(LIBRARY): $(OBJECTS) $(JAVA_CRW_DEMO)
+ 	$(LINK_SHARED) $(OBJECTS) $(LIBRARIES)
+ 
+ # Build jar file
+--- openjdkb18/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2007-08-23 16:12:58.000000000 -0400
+@@ -43,7 +43,7 @@
+ 
+ # Source lists
+ LIBNAME=versionCheck
+-SOURCES=versionCheck.c ../agent_util/agent_util.c
++SOURCES=versionCheck.c ../../agent_util/src/agent_util.c
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -89,7 +89,7 @@
+     # Object files needed to create library
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+-    LIBRARY=lib$(LIBNAME).so
++    LIBRARY=../lib/lib$(LIBNAME).so
+     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+@@ -122,7 +122,7 @@
+ 
+ # Common -I options
+ CFLAGS += -I.
+-CFLAGS += -I../agent_util
++CFLAGS += -I../../agent_util/src
+ CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
+ 
+ # Default rule
+--- openjdkb18/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
++++ openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2007-08-23 16:13:06.000000000 -0400
+@@ -43,7 +43,7 @@
+ 
+ # Source lists
+ LIBNAME=waiters
+-SOURCES=waiters.cpp Agent.cpp Thread.cpp Monitor.cpp ../agent_util/agent_util.c
++SOURCES=waiters.cpp Agent.cpp Thread.cpp Monitor.cpp
+ 
+ # Solaris Sun C Compiler Version 5.5
+ ifeq ($(OSNAME), solaris)
+@@ -89,9 +89,10 @@
+     endif
+     # Object files needed to create library
+     OBJECTS=$(SOURCES:%.cpp=%.o)
++    OBJECTS+=../../agent_util/src/agent_util.o
+     # Library name and options needed to build it
+-    LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LIBRARY=../lib/lib$(LIBNAME).so
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=
+     # Building a shared library
+@@ -123,9 +124,10 @@
+ 
+ # Common -I options
+ CXXFLAGS += -I.
+-CXXFLAGS += -I../agent_util
++CXXFLAGS += -I../../agent_util/src
+ CXXFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
+ 
++CFLAGS = $(CXXFLAGS)
+ # Default rule
+ all: $(LIBRARY)
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/disable-intree-ec.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,23 @@
+diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security openjdk/jdk/src/share/lib/security/java.security
+--- openjdk.orig/jdk/src/share/lib/security/java.security	2009-09-10 19:04:25.000000000 +0100
++++ openjdk/jdk/src/share/lib/security/java.security	2009-09-11 14:53:07.000000000 +0100
+@@ -45,13 +45,12 @@
+ #
+ security.provider.1=sun.security.provider.Sun
+ security.provider.2=sun.security.rsa.SunRsaSign
+-security.provider.3=sun.security.ec.SunEC
+-security.provider.4=com.sun.net.ssl.internal.ssl.Provider
+-security.provider.5=com.sun.crypto.provider.SunJCE
+-security.provider.6=sun.security.jgss.SunProvider
+-security.provider.7=com.sun.security.sasl.Provider
+-security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
+-security.provider.9=sun.security.smartcardio.SunPCSC
++security.provider.3=com.sun.net.ssl.internal.ssl.Provider
++security.provider.4=com.sun.crypto.provider.SunJCE
++security.provider.5=sun.security.jgss.SunProvider
++security.provider.6=com.sun.security.sasl.Provider
++security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
++security.provider.8=sun.security.smartcardio.SunPCSC
+ 
+ #
+ # Select the source of seed data for SecureRandom. By default an
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gcc-suffix.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,26 @@
+diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2011-03-29 14:22:49.000000000 +0100
++++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2011-03-29 23:34:00.169408541 +0100
+@@ -54,8 +54,8 @@
+ ifeq ($(PLATFORM), linux)
+ 
+   # Settings specific to Linux
+-  CC             = $(COMPILER_PATH)gcc
+-  CPP            = $(COMPILER_PATH)gcc -E
++  CC             = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
++  CPP            = $(COMPILER_PATH)gcc$(GCC_SUFFIX) -E
+   # statically link libstdc++ before C++ ABI is stablized on Linux
+   ifneq ($(STATIC_CXX),false)
+     STATIC_CXX     = true
+@@ -64,9 +64,9 @@
+     # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
+     # We need to use gcc to statically link the C++ runtime. gcc and g++ use
+     # the same subprocess to compile C++ files, so it is OK to build using gcc.
+-    CXX            = $(COMPILER_PATH)gcc
++    CXX            = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
+   else
+-    CXX            = $(COMPILER_PATH)g++
++    CXX            = $(COMPILER_PATH)g++$(GCC_SUFFIX)
+   endif
+   # Option used to create a shared library
+   SHARED_LIBRARY_FLAG = -shared -mimpure-text
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/headers.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,39 @@
+diff -Nru openjdk.orig/jdk/make/sun/font/Makefile openjdk/jdk/make/sun/font/Makefile
+--- openjdk.orig/jdk/make/sun/font/Makefile	2010-02-12 08:15:45.000000000 +0000
++++ openjdk/jdk/make/sun/font/Makefile	2010-02-19 18:26:43.000000000 +0000
+@@ -129,7 +129,7 @@
+   ifeq ($(USING_SYSTEM_FT_LIB), false)
+     FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX).6
+   endif
+-  OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype
++  OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) $(FT2_LIB)
+ endif 
+ 
+ library:: $(FREETYPE_LIB)
+@@ -159,11 +159,13 @@
+ #
+ CFLAGS       += -DHEADLESS
+ CXXFLAGS     += -DHEADLESS
++FREETYPE_HEADERS=$(shell $(ECHO) \"$(FREETYPE2_HEADERS)\" | grep -o .I.*[a\-z])
+ 
+ ifndef OPENJDK
+   CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
+ else
+-  CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
++  CPPFLAGS += $(FREETYPE_HEADERS) $(FREETYPE_HEADERS)/freetype2 \
++	-I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
+ endif
+ 
+ ifeq ($(PLATFORM), windows)
+diff -Nru openjdk.orig/jdk/make/tools/freetypecheck/Makefile openjdk/jdk/make/tools/freetypecheck/Makefile
+--- openjdk.orig/jdk/make/tools/freetypecheck/Makefile	2009-12-04 23:26:49.000000000 +0000
++++ openjdk/jdk/make/tools/freetypecheck/Makefile	2010-02-19 18:08:00.000000000 +0000
+@@ -50,7 +50,7 @@
+   ifeq ($(PLATFORM), solaris)
+     FT_LD_OPTIONS += -R $(FREETYPE_LIB_PATH) -lfreetype
+   else #linux
+-      FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) -lfreetype
++      FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) $(FT2_LIB)
+   endif
+ endif
+ FT_OPTIONS += -I$(FREETYPE_HEADERS_PATH)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot-gcc-pr36917.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,9 @@
+--- openjdk/hotspot/make/linux/makefiles/i486.make~	2008-07-10 22:04:18.000000000 +0200
++++ openjdk/hotspot/make/linux/makefiles/i486.make	2008-07-24 12:23:11.344839305 +0200
+@@ -34,3 +34,6 @@
+ CFLAGS += -DVM_LITTLE_ENDIAN
+ 
+ OPT_CFLAGS/compactingPermGenGen.o = -O1
++
++# GCC PR tree-optimization/36917
++OPT_CFLAGS/ciTypeFlow.o += $(OPT_CFLAGS) -fno-ivopts
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/gcc-suffix.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,35 @@
+diff -Nru openjdk.orig/hotspot/agent/src/os/linux/Makefile openjdk/hotspot/agent/src/os/linux/Makefile
+--- openjdk.orig/hotspot/agent/src/os/linux/Makefile	2010-07-29 21:54:38.000000000 +0100
++++ openjdk/hotspot/agent/src/os/linux/Makefile	2011-04-21 00:04:10.990086029 +0100
+@@ -23,7 +23,7 @@
+ #
+ 
+ ARCH := $(shell if ([ `uname -m` = "ia64" ])  ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
+-GCC      = gcc
++GCC      = gcc$(GCC_SUFFIX)
+ 
+ JAVAH    = ${JAVA_HOME}/bin/javah
+ 
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
+--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2011-04-20 12:06:06.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/gcc.make	2011-04-21 01:00:54.300899166 +0100
+@@ -28,13 +28,13 @@
+ # When cross-compiling the ALT_COMPILER_PATH points
+ # to the cross-compilation toolset
+ ifdef CROSS_COMPILE_ARCH
+-CPP = $(ALT_COMPILER_PATH)/g++
+-CC  = $(ALT_COMPILER_PATH)/gcc
+-HOSTCPP = g++
+-HOSTCC  = gcc
++CPP = $(ALT_COMPILER_PATH)/g++$(GCC_SUFFIX)
++CC  = $(ALT_COMPILER_PATH)/gcc$(GCC_SUFFIX)
++HOSTCPP = g++$(GCC_SUFFIX)
++HOSTCC  = gcc$(GCC_SUFFIX)
+ else
+-CPP = g++
+-CC  = gcc
++CPP = g++$(GCC_SUFFIX)
++CC  = gcc$(GCC_SUFFIX)
+ HOSTCPP = $(CPP)
+ HOSTCC  = $(CC)
+ endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/headers.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,13 @@
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/jvmti.make openjdk/hotspot/make/linux/makefiles/jvmti.make
+--- openjdk.orig/hotspot/make/linux/makefiles/jvmti.make	2008-05-23 20:51:14.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/jvmti.make	2008-05-23 20:54:13.000000000 +0100
+@@ -59,7 +59,7 @@
+ 
+ JvmtiGeneratedFiles = $(JvmtiGeneratedNames:%=$(JvmtiOutDir)/%)
+ 
+-XSLT = $(QUIETLY) $(REMOTE) $(RUN.JAVA) -classpath $(JvmtiOutDir) jvmtiGen
++XSLT = $(QUIETLY) $(REMOTE) $(RUN.JAVA) $(ENDORSED) -classpath $(JvmtiOutDir) jvmtiGen
+ 
+ .PHONY: all jvmtidocs clean cleanall
+ 
+
--- a/patches/hotspot/default/icedtea-gcc-suffix.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-diff -Nru openjdk.orig/hotspot/agent/src/os/linux/Makefile openjdk/hotspot/agent/src/os/linux/Makefile
---- openjdk.orig/hotspot/agent/src/os/linux/Makefile	2010-07-29 21:54:38.000000000 +0100
-+++ openjdk/hotspot/agent/src/os/linux/Makefile	2011-04-21 00:04:10.990086029 +0100
-@@ -23,7 +23,7 @@
- #
- 
- ARCH := $(shell if ([ `uname -m` = "ia64" ])  ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
--GCC      = gcc
-+GCC      = gcc$(GCC_SUFFIX)
- 
- JAVAH    = ${JAVA_HOME}/bin/javah
- 
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
---- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2011-04-20 12:06:06.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/gcc.make	2011-04-21 01:00:54.300899166 +0100
-@@ -28,13 +28,13 @@
- # When cross-compiling the ALT_COMPILER_PATH points
- # to the cross-compilation toolset
- ifdef CROSS_COMPILE_ARCH
--CPP = $(ALT_COMPILER_PATH)/g++
--CC  = $(ALT_COMPILER_PATH)/gcc
--HOSTCPP = g++
--HOSTCC  = gcc
-+CPP = $(ALT_COMPILER_PATH)/g++$(GCC_SUFFIX)
-+CC  = $(ALT_COMPILER_PATH)/gcc$(GCC_SUFFIX)
-+HOSTCPP = g++$(GCC_SUFFIX)
-+HOSTCC  = gcc$(GCC_SUFFIX)
- else
--CPP = g++
--CC  = gcc
-+CPP = g++$(GCC_SUFFIX)
-+CC  = gcc$(GCC_SUFFIX)
- HOSTCPP = $(CPP)
- HOSTCC  = $(CC)
- endif
--- a/patches/hotspot/default/icedtea-headers.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/jvmti.make openjdk/hotspot/make/linux/makefiles/jvmti.make
---- openjdk.orig/hotspot/make/linux/makefiles/jvmti.make	2008-05-23 20:51:14.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/jvmti.make	2008-05-23 20:54:13.000000000 +0100
-@@ -59,7 +59,7 @@
- 
- JvmtiGeneratedFiles = $(JvmtiGeneratedNames:%=$(JvmtiOutDir)/%)
- 
--XSLT = $(QUIETLY) $(REMOTE) $(RUN.JAVA) -classpath $(JvmtiOutDir) jvmtiGen
-+XSLT = $(QUIETLY) $(REMOTE) $(RUN.JAVA) $(ENDORSED) -classpath $(JvmtiOutDir) jvmtiGen
- 
- .PHONY: all jvmtidocs clean cleanall
- 
-
--- a/patches/hotspot/default/icedtea-memory-limits.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp openjdk/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
---- openjdk.orig/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	2010-01-15 17:37:38.000000000 +0000
-+++ openjdk/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	2010-02-22 12:46:31.000000000 +0000
-@@ -95,7 +95,7 @@
- 
- // Heap related flags
- define_pd_global(uintx,PermSize,    ScaleForWordSize(16*M));
--define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M));
-+define_pd_global(uintx,MaxPermSize, ScaleForWordSize(128*M));
- 
- // Ergonomics related flags
- define_pd_global(bool, NeverActAsServerClassMachine, false);
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp
---- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp	2010-02-19 17:14:39.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/globals.hpp	2010-02-22 12:46:54.000000000 +0000
-@@ -2919,7 +2919,7 @@
-   product(uintx, InitialHeapSize, 0,                                        \
-           "Initial heap size (in bytes); zero means OldSize + NewSize")     \
-                                                                             \
--  product(uintx, MaxHeapSize, ScaleForWordSize(96*M),                       \
-+  product(uintx, MaxHeapSize, ScaleForWordSize(512*M),                      \
-           "Maximum heap size (in bytes)")                                   \
-                                                                             \
-   product(uintx, OldSize, ScaleForWordSize(4*M),                            \
--- a/patches/hotspot/default/icedtea-params-cast-size_t.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
---- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2011-04-20 04:39:42.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2011-04-21 10:52:34.766273674 +0100
-@@ -957,7 +957,7 @@
-   if (free_percentage < desired_free_percentage) {
-     size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
-     assert(desired_capacity >= capacity(), "invalid expansion size");
--    expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes);
-+    expand_bytes = MAX2((long unsigned int) (desired_capacity - capacity()), (long unsigned int) MinHeapDeltaBytes);
-   }
-   if (expand_bytes > 0) {
-     if (PrintGCDetails && Verbose) {
-@@ -6253,7 +6253,7 @@
-     HeapWord* curAddr = _markBitMap.startWord();
-     while (curAddr < _markBitMap.endWord()) {
-       size_t remaining  = pointer_delta(_markBitMap.endWord(), curAddr);
--      MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining));
-+      MemRegion chunk(curAddr, MIN2((size_t) CMSBitMapYieldQuantum, remaining));
-       _markBitMap.clear_large_range(chunk);
-       if (ConcurrentMarkSweepThread::should_yield() &&
-           !foregroundGCIsActive() &&
-@@ -6546,7 +6546,7 @@
-     return;
-   }
-   // Double capacity if possible
--  size_t new_capacity = MIN2(_capacity*2, MarkStackSizeMax);
-+  size_t new_capacity = MIN2((size_t) _capacity*2, (size_t) MarkStackSizeMax);
-   // Do not give up existing stack until we have managed to
-   // get the double capacity that we desired.
-   ReservedSpace rs(ReservedSpace::allocation_align_size_up(
-diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
---- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2011-04-20 04:39:42.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2011-04-21 10:52:34.766273674 +0100
-@@ -897,8 +897,8 @@
- void PSParallelCompact::initialize_dead_wood_limiter()
- {
-   const size_t max = 100;
--  _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
--  _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
-+  _dwl_mean = double(MIN2((size_t) ParallelOldDeadWoodLimiterMean, max)) / 100.0;
-+  _dwl_std_dev = double(MIN2((size_t) ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
-   _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
-   DEBUG_ONLY(_dwl_initialized = true;)
-   _dwl_adjustment = normal_distribution(1.0);
-diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp
---- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp	2011-03-14 22:09:03.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp	2011-04-21 10:52:34.770273739 +0100
-@@ -69,7 +69,7 @@
-   _last_used = current_live;
- 
-   // We have different alignment constraints than the rest of the heap.
--  const size_t alignment = MAX2(MinPermHeapExpansion,
-+  const size_t alignment = MAX2((size_t) MinPermHeapExpansion,
-                                 virtual_space()->alignment());
- 
-   // Compute the desired size:
-diff -Nru openjdk.orig/hotspot/src/share/vm/memory/collectorPolicy.cpp openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp
---- openjdk.orig/hotspot/src/share/vm/memory/collectorPolicy.cpp	2011-04-20 04:39:42.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp	2011-04-21 10:52:34.770273739 +0100
-@@ -329,7 +329,7 @@
-     // yield a size that is too small) and bound it by MaxNewSize above.
-     // Ergonomics plays here by previously calculating the desired
-     // NewSize and MaxNewSize.
--    max_new_size = MIN2(MAX2(max_new_size, NewSize), MaxNewSize);
-+    max_new_size = MIN2(MAX2(max_new_size, (size_t) NewSize), (size_t) MaxNewSize);
-   }
-   assert(max_new_size > 0, "All paths should set max_new_size");
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
---- openjdk.orig/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp	2011-04-11 12:33:06.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp	2011-04-21 10:52:34.770273739 +0100
-@@ -240,7 +240,7 @@
-   size_t init_sz;
- 
-   if (TLABSize > 0) {
--    init_sz = MIN2(TLABSize / HeapWordSize, max_size());
-+    init_sz = MIN2((size_t) (TLABSize / HeapWordSize), max_size());
-   } else if (global_stats() == NULL) {
-     // Startup issue - main thread initialized before heap initialized.
-     init_sz = min_size();
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2011-04-20 04:39:42.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2011-04-21 10:52:34.770273739 +0100
-@@ -1130,7 +1130,7 @@
-     // NewSize was set on the command line and it is larger than
-     // preferred_max_new_size.
-     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
--      FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
-+      FLAG_SET_ERGO(uintx, MaxNewSize, MAX2((size_t) NewSize, preferred_max_new_size));
-     } else {
-       FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
-     }
-@@ -1159,8 +1159,8 @@
-       // Unless explicitly requested otherwise, make young gen
-       // at least min_new, and at most preferred_max_new_size.
-       if (FLAG_IS_DEFAULT(NewSize)) {
--        FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
--        FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
-+        FLAG_SET_ERGO(uintx, NewSize, MAX2((size_t) NewSize, min_new));
-+        FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, (size_t) NewSize));
-         if (PrintGCDetails && Verbose) {
-           // Too early to use gclog_or_tty
-           tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
--- a/patches/hotspot/default/icedtea-parisc-opt.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
---- openjdk/hotspot/make/linux/makefiles/product.make.orig	2008-12-10 19:02:31.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/product.make	2008-12-10 19:24:53.000000000 +0100
-@@ -25,6 +25,11 @@
- # Sets make macros for making optimized version of Gamma VM
- # (This is the "product", not the "release" version.)
- 
-+# work around an ICE in gcc-4.1 and gcc-4.3 on parisc-linux
-+ifeq ($(BUILDARCH)-$(ZERO_LIBARCH), zero-parisc)
-+  OPT_CFLAGS/codeBlob.o = $(OPT_CFLAGS/NOOPT)
-+endif
-+
- # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make
- OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS)
- OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
---- openjdk/hotspot/make/linux/makefiles/optimized.make.orig	2008-12-10 19:02:22.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/optimized.make	2008-12-10 19:24:24.000000000 +0100
-@@ -25,6 +25,11 @@
- # Sets make macros for making optimized version of Gamma VM
- # (This is the "product", not the "release" version.)
- 
-+# work around an ICE in gcc-4.1 and gcc-4.3 on parisc-linux
-+ifeq ($(BUILDARCH)-$(ZERO_LIBARCH), zero-parisc)
-+  OPT_CFLAGS/codeBlob.o = $(OPT_CFLAGS/NOOPT)
-+endif
-+
- # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make
- OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS)
- OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
--- a/patches/hotspot/default/icedtea-sparc-ptracefix.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-diff -up openjdk/hotspot/agent/src/os/linux/libproc.h.BAD openjdk/hotspot/agent/src/os/linux/libproc.h
---- openjdk/hotspot/agent/src/os/linux/libproc.h.BAD	2008-05-29 19:03:34.000000000 -0400
-+++ openjdk/hotspot/agent/src/os/linux/libproc.h	2008-05-29 19:01:45.000000000 -0400
-@@ -34,14 +34,25 @@
- 
- #if defined(sparc) || defined(sparcv9)
- /*
--  If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
--  otherwise it should be from /usr/include/asm-sparc
--  These two files define pt_regs structure differently
-+  Taken from asm-sparc/ptrace.h and asm-sparc64/ptrace.h
- */ 
- #ifdef _LP64
--#include "asm-sparc64/ptrace.h"
-+struct pt_regs {
-+	unsigned long u_regs[16]; /* globals and ins */
-+	unsigned long tstate;
-+	unsigned long tpc;
-+	unsigned long tnpc;
-+	unsigned int y;
-+	unsigned int fprs;
-+};
- #else
--#include "asm-sparc/ptrace.h"
-+struct pt_regs {
-+	unsigned long psr;
-+	unsigned long pc;
-+	unsigned long npc;
-+	unsigned long y;
-+	unsigned long u_regs[16]; /* globals and ins */
-+};
- #endif
- 
- #endif //sparc or sparcv9
--- a/patches/hotspot/default/icedtea-sparc-trapsfix.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
---- openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2011-03-14 22:09:02.000000000 +0000
-+++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2011-03-15 23:02:33.883758538 +0000
-@@ -28,7 +28,16 @@
- #include "runtime/os.hpp"
- #include "runtime/threadLocalStorage.hpp"
- 
--#include <asm-sparc/traps.h>
-+/* Headers for 32bit sparc with a 32bit userland end up in asm/
-+ * Headers for 32bit sparc with a 64bit userland end up in asm-sparc/
-+ * There is no traps.h in asm-sparc64/
-+ */
-+
-+#if defined(__sparc__) && defined(__arch64__)
-+# include <asm-sparc/traps.h>
-+#else 
-+# include <asm/traps.h>
-+#endif
- 
- void MacroAssembler::read_ccr_trap(Register ccr_save) {
-   // No implementation
--- a/patches/hotspot/default/icedtea-text-relocations.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
---- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2011-04-11 12:33:06.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/gcc.make	2011-04-11 13:31:35.116973986 +0100
-@@ -58,7 +58,11 @@
- # Compiler flags
- 
- # position-independent code
-+ifneq ($(filter parisc ppc ppc64 s390 s390x sparc sparc64 sparcv9,$(ZERO_LIBARCH)),)
- PICFLAG = -fPIC
-+else
-+PICFLAG = -fpic
-+endif
- 
- VM_PICFLAG/LIBJVM = $(PICFLAG)
- VM_PICFLAG/AOUT   =
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/rules.make openjdk/hotspot/make/linux/makefiles/rules.make
---- openjdk.orig/hotspot/make/linux/makefiles/rules.make	2011-04-11 12:33:06.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/rules.make	2011-04-11 13:31:35.128974182 +0100
-@@ -148,20 +148,10 @@
- 
- include $(GAMMADIR)/make/altsrc.make
- 
--# The non-PIC object files are only generated for 32 bit platforms.
--ifdef LP64
- %.o: %.cpp
- 	@echo Compiling $<
- 	$(QUIETLY) $(REMOVE_TARGET)
- 	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
--else
--%.o: %.cpp
--	@echo Compiling $<
--	$(QUIETLY) $(REMOVE_TARGET)
--	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
--	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
--	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
--endif
- 
- %.o: %.s
- 	@echo Assembling $<
-diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/rules.make openjdk/hotspot/make/solaris/makefiles/rules.make
---- openjdk.orig/hotspot/make/solaris/makefiles/rules.make	2011-04-11 12:33:06.000000000 +0100
-+++ openjdk/hotspot/make/solaris/makefiles/rules.make	2011-04-11 13:31:35.128974182 +0100
-@@ -148,20 +148,10 @@
- 
- include $(GAMMADIR)/make/altsrc.make
- 
--# Sun compiler for 64 bit Solaris does not support building non-PIC object files.
--ifdef LP64
- %.o: %.cpp
- 	@echo Compiling $<
- 	$(QUIETLY) $(REMOVE_TARGET)
- 	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
--else
--%.o: %.cpp
--	@echo Compiling $<
--	$(QUIETLY) $(REMOVE_TARGET)
--	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
--	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
--	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
--endif
- 
- %.o: %.s
- 	@echo Assembling $<
--- a/patches/hotspot/default/icedtea-use-idx_t.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/methodLiveness.cpp openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp
---- openjdk.orig/hotspot/src/share/vm/compiler/methodLiveness.cpp	2008-11-06 08:40:55.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp	2008-11-10 00:55:09.000000000 +0000
-@@ -567,15 +567,15 @@
- 
- 
- MethodLiveness::BasicBlock::BasicBlock(MethodLiveness *analyzer, int start, int limit) :
--         _gen((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-+         _gen((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-                          analyzer->bit_map_size_bits()),
--         _kill((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-+         _kill((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-                          analyzer->bit_map_size_bits()),
--         _entry((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-+         _entry((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-                          analyzer->bit_map_size_bits()),
--         _normal_exit((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-+         _normal_exit((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-                          analyzer->bit_map_size_bits()),
--         _exception_exit((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-+         _exception_exit((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
-                          analyzer->bit_map_size_bits()),
-          _last_bci(-1) {
-   _analyzer = analyzer;
-@@ -992,7 +992,7 @@
- }
- 
- MethodLivenessResult MethodLiveness::BasicBlock::get_liveness_at(ciMethod* method, int bci) {
--  MethodLivenessResult answer(NEW_RESOURCE_ARRAY(uintptr_t, _analyzer->bit_map_size_words()),
-+  MethodLivenessResult answer(NEW_RESOURCE_ARRAY(size_t, _analyzer->bit_map_size_words()),
-                 _analyzer->bit_map_size_bits());
-   answer.set_is_valid();
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/bitMap.hpp openjdk/hotspot/src/share/vm/utilities/bitMap.hpp
---- openjdk.orig/hotspot/src/share/vm/utilities/bitMap.hpp	2008-11-06 08:40:58.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/utilities/bitMap.hpp	2008-11-10 00:57:20.000000000 +0000
-@@ -73,7 +73,7 @@
- 
-   // Set a word to a specified value or to all ones; clear a word.
-   void set_word  (idx_t word, bm_word_t val) { _map[word] = val; }
--  void set_word  (idx_t word)            { set_word(word, ~(uintptr_t)0); }
-+  void set_word  (idx_t word)            { set_word(word, ~(idx_t)0); }
-   void clear_word(idx_t word)            { _map[word] = 0; }
- 
-   // Utilities for ranges of bits.  Ranges are half-open [beg, end).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/memory-limits.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,24 @@
+diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp openjdk/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
+--- openjdk.orig/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	2010-01-15 17:37:38.000000000 +0000
++++ openjdk/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	2010-02-22 12:46:31.000000000 +0000
+@@ -95,7 +95,7 @@
+ 
+ // Heap related flags
+ define_pd_global(uintx,PermSize,    ScaleForWordSize(16*M));
+-define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M));
++define_pd_global(uintx,MaxPermSize, ScaleForWordSize(128*M));
+ 
+ // Ergonomics related flags
+ define_pd_global(bool, NeverActAsServerClassMachine, false);
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp	2010-02-19 17:14:39.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp	2010-02-22 12:46:54.000000000 +0000
+@@ -2919,7 +2919,7 @@
+   product(uintx, InitialHeapSize, 0,                                        \
+           "Initial heap size (in bytes); zero means OldSize + NewSize")     \
+                                                                             \
+-  product(uintx, MaxHeapSize, ScaleForWordSize(96*M),                       \
++  product(uintx, MaxHeapSize, ScaleForWordSize(512*M),                      \
+           "Maximum heap size (in bytes)")                                   \
+                                                                             \
+   product(uintx, OldSize, ScaleForWordSize(4*M),                            \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/params-cast-size_t.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,103 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2011-04-20 04:39:42.000000000 +0100
++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	2011-04-21 10:52:34.766273674 +0100
+@@ -957,7 +957,7 @@
+   if (free_percentage < desired_free_percentage) {
+     size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
+     assert(desired_capacity >= capacity(), "invalid expansion size");
+-    expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes);
++    expand_bytes = MAX2((long unsigned int) (desired_capacity - capacity()), (long unsigned int) MinHeapDeltaBytes);
+   }
+   if (expand_bytes > 0) {
+     if (PrintGCDetails && Verbose) {
+@@ -6253,7 +6253,7 @@
+     HeapWord* curAddr = _markBitMap.startWord();
+     while (curAddr < _markBitMap.endWord()) {
+       size_t remaining  = pointer_delta(_markBitMap.endWord(), curAddr);
+-      MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining));
++      MemRegion chunk(curAddr, MIN2((size_t) CMSBitMapYieldQuantum, remaining));
+       _markBitMap.clear_large_range(chunk);
+       if (ConcurrentMarkSweepThread::should_yield() &&
+           !foregroundGCIsActive() &&
+@@ -6546,7 +6546,7 @@
+     return;
+   }
+   // Double capacity if possible
+-  size_t new_capacity = MIN2(_capacity*2, MarkStackSizeMax);
++  size_t new_capacity = MIN2((size_t) _capacity*2, (size_t) MarkStackSizeMax);
+   // Do not give up existing stack until we have managed to
+   // get the double capacity that we desired.
+   ReservedSpace rs(ReservedSpace::allocation_align_size_up(
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2011-04-20 04:39:42.000000000 +0100
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	2011-04-21 10:52:34.766273674 +0100
+@@ -897,8 +897,8 @@
+ void PSParallelCompact::initialize_dead_wood_limiter()
+ {
+   const size_t max = 100;
+-  _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
+-  _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
++  _dwl_mean = double(MIN2((size_t) ParallelOldDeadWoodLimiterMean, max)) / 100.0;
++  _dwl_std_dev = double(MIN2((size_t) ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
+   _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
+   DEBUG_ONLY(_dwl_initialized = true;)
+   _dwl_adjustment = normal_distribution(1.0);
+diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp
+--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp	2011-03-14 22:09:03.000000000 +0000
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp	2011-04-21 10:52:34.770273739 +0100
+@@ -69,7 +69,7 @@
+   _last_used = current_live;
+ 
+   // We have different alignment constraints than the rest of the heap.
+-  const size_t alignment = MAX2(MinPermHeapExpansion,
++  const size_t alignment = MAX2((size_t) MinPermHeapExpansion,
+                                 virtual_space()->alignment());
+ 
+   // Compute the desired size:
+diff -Nru openjdk.orig/hotspot/src/share/vm/memory/collectorPolicy.cpp openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp
+--- openjdk.orig/hotspot/src/share/vm/memory/collectorPolicy.cpp	2011-04-20 04:39:42.000000000 +0100
++++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp	2011-04-21 10:52:34.770273739 +0100
+@@ -329,7 +329,7 @@
+     // yield a size that is too small) and bound it by MaxNewSize above.
+     // Ergonomics plays here by previously calculating the desired
+     // NewSize and MaxNewSize.
+-    max_new_size = MIN2(MAX2(max_new_size, NewSize), MaxNewSize);
++    max_new_size = MIN2(MAX2(max_new_size, (size_t) NewSize), (size_t) MaxNewSize);
+   }
+   assert(max_new_size > 0, "All paths should set max_new_size");
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
+--- openjdk.orig/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp	2011-04-11 12:33:06.000000000 +0100
++++ openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp	2011-04-21 10:52:34.770273739 +0100
+@@ -240,7 +240,7 @@
+   size_t init_sz;
+ 
+   if (TLABSize > 0) {
+-    init_sz = MIN2(TLABSize / HeapWordSize, max_size());
++    init_sz = MIN2((size_t) (TLABSize / HeapWordSize), max_size());
+   } else if (global_stats() == NULL) {
+     // Startup issue - main thread initialized before heap initialized.
+     init_sz = min_size();
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2011-04-20 04:39:42.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2011-04-21 10:52:34.770273739 +0100
+@@ -1130,7 +1130,7 @@
+     // NewSize was set on the command line and it is larger than
+     // preferred_max_new_size.
+     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
+-      FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
++      FLAG_SET_ERGO(uintx, MaxNewSize, MAX2((size_t) NewSize, preferred_max_new_size));
+     } else {
+       FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
+     }
+@@ -1159,8 +1159,8 @@
+       // Unless explicitly requested otherwise, make young gen
+       // at least min_new, and at most preferred_max_new_size.
+       if (FLAG_IS_DEFAULT(NewSize)) {
+-        FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
+-        FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
++        FLAG_SET_ERGO(uintx, NewSize, MAX2((size_t) NewSize, min_new));
++        FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, (size_t) NewSize));
+         if (PrintGCDetails && Verbose) {
+           // Too early to use gclog_or_tty
+           tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/parisc-opt.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,28 @@
+--- openjdk/hotspot/make/linux/makefiles/product.make.orig	2008-12-10 19:02:31.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/product.make	2008-12-10 19:24:53.000000000 +0100
+@@ -25,6 +25,11 @@
+ # Sets make macros for making optimized version of Gamma VM
+ # (This is the "product", not the "release" version.)
+ 
++# work around an ICE in gcc-4.1 and gcc-4.3 on parisc-linux
++ifeq ($(BUILDARCH)-$(ZERO_LIBARCH), zero-parisc)
++  OPT_CFLAGS/codeBlob.o = $(OPT_CFLAGS/NOOPT)
++endif
++
+ # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make
+ OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS)
+ OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
+--- openjdk/hotspot/make/linux/makefiles/optimized.make.orig	2008-12-10 19:02:22.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/optimized.make	2008-12-10 19:24:24.000000000 +0100
+@@ -25,6 +25,11 @@
+ # Sets make macros for making optimized version of Gamma VM
+ # (This is the "product", not the "release" version.)
+ 
++# work around an ICE in gcc-4.1 and gcc-4.3 on parisc-linux
++ifeq ($(BUILDARCH)-$(ZERO_LIBARCH), zero-parisc)
++  OPT_CFLAGS/codeBlob.o = $(OPT_CFLAGS/NOOPT)
++endif
++
+ # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make
+ OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS)
+ OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/sparc-ptracefix.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,34 @@
+diff -up openjdk/hotspot/agent/src/os/linux/libproc.h.BAD openjdk/hotspot/agent/src/os/linux/libproc.h
+--- openjdk/hotspot/agent/src/os/linux/libproc.h.BAD	2008-05-29 19:03:34.000000000 -0400
++++ openjdk/hotspot/agent/src/os/linux/libproc.h	2008-05-29 19:01:45.000000000 -0400
+@@ -34,14 +34,25 @@
+ 
+ #if defined(sparc) || defined(sparcv9)
+ /*
+-  If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
+-  otherwise it should be from /usr/include/asm-sparc
+-  These two files define pt_regs structure differently
++  Taken from asm-sparc/ptrace.h and asm-sparc64/ptrace.h
+ */ 
+ #ifdef _LP64
+-#include "asm-sparc64/ptrace.h"
++struct pt_regs {
++	unsigned long u_regs[16]; /* globals and ins */
++	unsigned long tstate;
++	unsigned long tpc;
++	unsigned long tnpc;
++	unsigned int y;
++	unsigned int fprs;
++};
+ #else
+-#include "asm-sparc/ptrace.h"
++struct pt_regs {
++	unsigned long psr;
++	unsigned long pc;
++	unsigned long npc;
++	unsigned long y;
++	unsigned long u_regs[16]; /* globals and ins */
++};
+ #endif
+ 
+ #endif //sparc or sparcv9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/sparc-trapsfix.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,21 @@
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
+--- openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2011-03-14 22:09:02.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2011-03-15 23:02:33.883758538 +0000
+@@ -28,7 +28,16 @@
+ #include "runtime/os.hpp"
+ #include "runtime/threadLocalStorage.hpp"
+ 
+-#include <asm-sparc/traps.h>
++/* Headers for 32bit sparc with a 32bit userland end up in asm/
++ * Headers for 32bit sparc with a 64bit userland end up in asm-sparc/
++ * There is no traps.h in asm-sparc64/
++ */
++
++#if defined(__sparc__) && defined(__arch64__)
++# include <asm-sparc/traps.h>
++#else 
++# include <asm/traps.h>
++#endif
+ 
+ void MacroAssembler::read_ccr_trap(Register ccr_save) {
+   // No implementation
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/text-relocations.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,63 @@
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
+--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2011-04-11 12:33:06.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/gcc.make	2011-04-11 13:31:35.116973986 +0100
+@@ -58,7 +58,11 @@
+ # Compiler flags
+ 
+ # position-independent code
++ifneq ($(filter parisc ppc ppc64 s390 s390x sparc sparc64 sparcv9,$(ZERO_LIBARCH)),)
+ PICFLAG = -fPIC
++else
++PICFLAG = -fpic
++endif
+ 
+ VM_PICFLAG/LIBJVM = $(PICFLAG)
+ VM_PICFLAG/AOUT   =
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/rules.make openjdk/hotspot/make/linux/makefiles/rules.make
+--- openjdk.orig/hotspot/make/linux/makefiles/rules.make	2011-04-11 12:33:06.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/rules.make	2011-04-11 13:31:35.128974182 +0100
+@@ -148,20 +148,10 @@
+ 
+ include $(GAMMADIR)/make/altsrc.make
+ 
+-# The non-PIC object files are only generated for 32 bit platforms.
+-ifdef LP64
+ %.o: %.cpp
+ 	@echo Compiling $<
+ 	$(QUIETLY) $(REMOVE_TARGET)
+ 	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
+-else
+-%.o: %.cpp
+-	@echo Compiling $<
+-	$(QUIETLY) $(REMOVE_TARGET)
+-	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
+-	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+-	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
+-endif
+ 
+ %.o: %.s
+ 	@echo Assembling $<
+diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/rules.make openjdk/hotspot/make/solaris/makefiles/rules.make
+--- openjdk.orig/hotspot/make/solaris/makefiles/rules.make	2011-04-11 12:33:06.000000000 +0100
++++ openjdk/hotspot/make/solaris/makefiles/rules.make	2011-04-11 13:31:35.128974182 +0100
+@@ -148,20 +148,10 @@
+ 
+ include $(GAMMADIR)/make/altsrc.make
+ 
+-# Sun compiler for 64 bit Solaris does not support building non-PIC object files.
+-ifdef LP64
+ %.o: %.cpp
+ 	@echo Compiling $<
+ 	$(QUIETLY) $(REMOVE_TARGET)
+ 	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
+-else
+-%.o: %.cpp
+-	@echo Compiling $<
+-	$(QUIETLY) $(REMOVE_TARGET)
+-	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
+-	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+-	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
+-endif
+ 
+ %.o: %.s
+ 	@echo Assembling $<
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/use-idx_t.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,45 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/methodLiveness.cpp openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/methodLiveness.cpp	2008-11-06 08:40:55.000000000 +0000
++++ openjdk/hotspot/src/share/vm/compiler/methodLiveness.cpp	2008-11-10 00:55:09.000000000 +0000
+@@ -567,15 +567,15 @@
+ 
+ 
+ MethodLiveness::BasicBlock::BasicBlock(MethodLiveness *analyzer, int start, int limit) :
+-         _gen((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _gen((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _kill((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _kill((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _entry((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _entry((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _normal_exit((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _normal_exit((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+-         _exception_exit((uintptr_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
++         _exception_exit((size_t*)analyzer->arena()->Amalloc(BytesPerWord * analyzer->bit_map_size_words()),
+                          analyzer->bit_map_size_bits()),
+          _last_bci(-1) {
+   _analyzer = analyzer;
+@@ -992,7 +992,7 @@
+ }
+ 
+ MethodLivenessResult MethodLiveness::BasicBlock::get_liveness_at(ciMethod* method, int bci) {
+-  MethodLivenessResult answer(NEW_RESOURCE_ARRAY(uintptr_t, _analyzer->bit_map_size_words()),
++  MethodLivenessResult answer(NEW_RESOURCE_ARRAY(size_t, _analyzer->bit_map_size_words()),
+                 _analyzer->bit_map_size_bits());
+   answer.set_is_valid();
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/bitMap.hpp openjdk/hotspot/src/share/vm/utilities/bitMap.hpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/bitMap.hpp	2008-11-06 08:40:58.000000000 +0000
++++ openjdk/hotspot/src/share/vm/utilities/bitMap.hpp	2008-11-10 00:57:20.000000000 +0000
+@@ -73,7 +73,7 @@
+ 
+   // Set a word to a specified value or to all ones; clear a word.
+   void set_word  (idx_t word, bm_word_t val) { _map[word] = val; }
+-  void set_word  (idx_t word)            { set_word(word, ~(uintptr_t)0); }
++  void set_word  (idx_t word)            { set_word(word, ~(idx_t)0); }
+   void clear_word(idx_t word)            { _map[word] = 0; }
+ 
+   // Utilities for ranges of bits.  Ranges are half-open [beg, end).
--- a/patches/icedtea-6592792.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +0,0 @@
-diff -Nru openjdk.orig/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java openjdk/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java
---- openjdk.orig/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java	2008-12-02 15:25:05.000000000 +0000
-+++ openjdk/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java	2008-12-02 15:29:09.000000000 +0000
-@@ -1,5 +1,5 @@
- /*
-- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
-+ * Copyright 2005-2008 Sun Microsystems, Inc.  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
-@@ -128,12 +128,7 @@
-         throws JAXBException
-     {
-         try {
--            Class spiClass;
--            if (classLoader == null) {
--                spiClass = Class.forName(className);
--            } else {
--                spiClass = classLoader.loadClass(className);
--            }
-+            Class spiClass = safeLoadClass(className,classLoader);
- 
-             /*
-              * javax.xml.bind.context.factory points to a class which has a
-@@ -205,11 +200,7 @@
-         ClassLoader cl = Thread.currentThread().getContextClassLoader();
-         Class spi;
-         try {
--            logger.fine("Trying to load "+className);
--            if (cl != null)
--                spi = cl.loadClass(className);
--            else
--                spi = Class.forName(className);
-+            spi = safeLoadClass(className,cl);
-         } catch (ClassNotFoundException e) {
-             throw new JAXBException(e);
-         }
-@@ -483,4 +474,31 @@
-      * For this reason, we have to hard-code the class name into the API.
-      */
-     private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory";
-+
-+    /**
-+     * Loads the class, provided that the calling thread has an access to the class being loaded.
-+     */
-+    private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
-+        logger.fine("Trying to load "+className);
-+        try {
-+            // make sure that the current thread has an access to the package of the given name.
-+            SecurityManager s = System.getSecurityManager();
-+            if (s != null) {
-+                int i = className.lastIndexOf('.');
-+                if (i != -1) {
-+                    s.checkPackageAccess(className.substring(0,i));
-+                }
-+            }
-+
-+            if (classLoader == null)
-+                return Class.forName(className);
-+            else
-+                return classLoader.loadClass(className);
-+        } catch (SecurityException se) {
-+            // anyone can access the platform default factory class without permission
-+            if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className))
-+                return Class.forName(className);
-+            throw se;
-+        }
-+    }
- }
-diff -Nru openjdk.orig/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java openjdk/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java
---- openjdk.orig/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java	2008-12-02 15:25:04.000000000 +0000
-+++ openjdk/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java	2008-12-02 15:29:09.000000000 +0000
-@@ -1,5 +1,5 @@
- /*
-- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
-+ * Copyright 2005-2008 Sun Microsystems, Inc.  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
-@@ -47,12 +47,7 @@
-                                       ClassLoader classLoader)
-     {
-         try {
--            Class spiClass;
--            if (classLoader == null) {
--                spiClass = Class.forName(className);
--            } else {
--                spiClass = classLoader.loadClass(className);
--            }
-+            Class spiClass = safeLoadClass(className, classLoader);
-             return spiClass.newInstance();
-         } catch (ClassNotFoundException x) {
-             throw new WebServiceException(
-@@ -152,4 +147,33 @@
- 
-         return newInstance(fallbackClassName, classLoader);
-     }
-+
-+
-+    private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.ws.spi.ProviderImpl";
-+
-+    /**
-+     * Loads the class, provided that the calling thread has an access to the class being loaded.
-+     */
-+    private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
-+        try {
-+            // make sure that the current thread has an access to the package of the given name.
-+            SecurityManager s = System.getSecurityManager();
-+            if (s != null) {
-+                int i = className.lastIndexOf('.');
-+                if (i != -1) {
-+                    s.checkPackageAccess(className.substring(0,i));
-+                }
-+            }
-+
-+            if (classLoader == null)
-+                return Class.forName(className);
-+            else
-+                return classLoader.loadClass(className);
-+        } catch (SecurityException se) {
-+            // anyone can access the platform default factory class without permission
-+            if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className))
-+                return Class.forName(className);
-+            throw se;
-+        }
-+    }
- }
-diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security openjdk/jdk/src/share/lib/security/java.security
---- openjdk.orig/jdk/src/share/lib/security/java.security	2008-11-20 08:44:48.000000000 +0000
-+++ openjdk/jdk/src/share/lib/security/java.security	2008-12-02 15:29:09.000000000 +0000
-@@ -127,7 +127,7 @@
- # passed to checkPackageAccess unless the
- # corresponding RuntimePermission ("accessClassInPackage."+package) has
- # been granted.
--package.access=sun.
-+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
- 
- #
- # List of comma-separated packages that start with or equal this string
-diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security-solaris openjdk/jdk/src/share/lib/security/java.security-solaris
---- openjdk.orig/jdk/src/share/lib/security/java.security-solaris	2008-11-20 08:44:48.000000000 +0000
-+++ openjdk/jdk/src/share/lib/security/java.security-solaris	2008-12-02 15:29:09.000000000 +0000
-@@ -128,7 +128,7 @@
- # passed to checkPackageAccess unless the
- # corresponding RuntimePermission ("accessClassInPackage."+package) has
- # been granted.
--package.access=sun.
-+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
- 
- #
- # List of comma-separated packages that start with or equal this string
-diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security-windows openjdk/jdk/src/share/lib/security/java.security-windows
---- openjdk.orig/jdk/src/share/lib/security/java.security-windows	2008-11-20 08:44:48.000000000 +0000
-+++ openjdk/jdk/src/share/lib/security/java.security-windows	2008-12-02 15:29:09.000000000 +0000
-@@ -128,7 +128,7 @@
- # passed to checkPackageAccess unless the
- # corresponding RuntimePermission ("accessClassInPackage."+package) has
- # been granted.
--package.access=sun.
-+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
- 
- #
- # List of comma-separated packages that start with or equal this string
-diff -Nru openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh
---- openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test6592792.sh	2008-12-02 15:29:09.000000000 +0000
-@@ -0,0 +1,61 @@
-+#!/bin/sh
-+
-+if [ "${TESTSRC}" = "" ]
-+then TESTSRC=.
-+fi
-+
-+if [ "${TESTJAVA}" = "" ]
-+then
-+  PARENT=`dirname \`which java\``
-+  TESTJAVA=`dirname ${PARENT}`
-+  echo "TESTJAVA not set, selecting " ${TESTJAVA}
-+  echo "If this is incorrect, try setting the variable manually."
-+fi
-+
-+if [ "${TESTCLASSES}" = "" ]
-+then
-+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-+  exit 1
-+fi
-+
-+BIT_FLAG=""
-+
-+# set platform-dependent variables
-+OS=`uname -s`
-+case "$OS" in
-+  SunOS | Linux )
-+    NULL=/dev/null
-+    PS=":"
-+    FS="/"
-+    ## for solaris, linux it's HOME
-+    FILE_LOCATION=$HOME
-+    if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
-+    then
-+        BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT`
-+    fi
-+    ;;
-+  Windows_* )
-+    NULL=NUL
-+    PS=";"
-+    FS="\\"
-+    ;;
-+  * )
-+    echo "Unrecognized system!"
-+    exit 1;
-+    ;;
-+esac
-+
-+JEMMYPATH=${CPAPPEND}
-+CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
-+
-+THIS_DIR=`pwd`
-+
-+${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -version
-+
-+${TESTJAVA}${FS}bin${FS}javac ${BIT_FLAG} -d . -cp ${TESTJAVA}${FS}jre${FS}lib${FS}rt.jar ${TESTSRC}${FS}Test.java
-+
-+${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -cp . Test
-+
-+STATUS=$?
-+
-+exit $STATUS
-diff -Nru openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java
---- openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	2008-12-02 15:29:09.000000000 +0000
-@@ -0,0 +1,65 @@
-+/*
-+ *  @test
-+ *  @bug 6592792
-+ *  @summary Add com.sun.xml.internal to the "package.access" property in $JAVA_HOME/lib/security/java.security
-+ *  @run shell Test6592792.sh
-+ */
-+
-+import java.lang.*;
-+import java.lang.reflect.*;
-+import com.sun.xml.internal.ws.server.*;
-+import com.sun.xml.internal.ws.server.SingletonResolver;
-+import com.sun.xml.internal.ws.api.server.*;
-+
-+public class Test {
-+
-+  public static void main(String[] args) throws Exception{
-+      // Enable the security manager
-+      SecurityManager sm = new SecurityManager();
-+      System.setSecurityManager(sm);
-+      new Test();
-+  }
-+
-+  Object invokeMethod(Object target,Method m,Object args[]) throws Exception {
-+      SingletonResolver r = new SingletonResolver(target);
-+      Invoker invoker = r.createInvoker();
-+      return invoker.invoke(null, m, args);
-+  }
-+
-+  public Test() throws Exception{
-+      try {
-+          Class c=Class.forName("java.lang.Class");
-+
-+          Class ctab[]=new Class[1];
-+          ctab[0]=Class.forName("java.lang.String");
-+          Method forName=c.getMethod("forName",ctab);
-+
-+          Class gtab[]=new Class[2];
-+          gtab[0]=Class.forName("java.lang.String");
-+          gtab[1]=Class[].class;
-+          Method getMethod=c.getMethod("getMethod",gtab);
-+
-+          Method newInstance=c.getMethod("newInstance",(Class[])null);
-+
-+          Object otab[]=new Object[1];
-+          otab[0]="sun.misc.Unsafe";
-+
-+          Object o=invokeMethod(null,forName,otab);
-+          c = (Class)o;		// sun.misc.Unsafe class
-+          // Test FAILED: Should n't have got the reference.   
-+          throw new RuntimeException("Test Failed: Got reference to: "+o);
-+
-+
-+          //o=invokeMethod(c,getMethod, new Object[]{"getUnsafe", (Class[])null});
-+          //System.out.println("Got reference to: "+o);
-+          //throw new RuntimeException("Got reference to: "+o);
-+          //o=invokeMethod(c,(Method)o,null);
-+          //System.out.println("Got reference to: "+o);
-+          //throw new RuntimeException("Got reference to: "+o);
-+   
-+      } catch(java.security.AccessControlException e) {
-+          System.out.println("Test passed");
-+          //e.printStackTrace();
-+      } 
-+   }
-+}
--- a/patches/icedtea-6733959.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,225 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/share/bin/java.c openjdk/jdk/src/share/bin/java.c
---- openjdk.orig/jdk/src/share/bin/java.c	2008-12-02 16:28:05.000000000 +0000
-+++ openjdk/jdk/src/share/bin/java.c	2008-12-02 17:08:57.000000000 +0000
-@@ -885,8 +885,14 @@
-      * "Valid" returns (other than unrecoverable errors) follow.  Set
-      * main_class as a side-effect of this routine.
-      */
--    if (info.main_class != NULL)
-+    if (info.main_class != NULL) {
-+      if (strlen(info.main_class) <= MAXNAMELEN) {
-         *main_class = JLI_StringDup(info.main_class);
-+      } else {
-+        JLI_ReportErrorMessage("Error: main-class: attribute exceeds system limits\n", JNI_TRUE);
-+	exit(1);
-+      }
-+    }
- 
-     /*
-      * If no version selection information is found either on the command
-diff -Nru openjdk.orig/jdk/test/tools/launcher/MultipleJRE.sh openjdk/jdk/test/tools/launcher/MultipleJRE.sh
---- openjdk.orig/jdk/test/tools/launcher/MultipleJRE.sh	2008-12-03 12:35:03.000000000 +0000
-+++ openjdk/jdk/test/tools/launcher/MultipleJRE.sh	2008-12-02 17:07:57.000000000 +0000
-@@ -49,10 +49,23 @@
-   exit 1
- fi
- 
-+JAVAEXE="$TESTJAVA/bin/java"
- JAVA="$TESTJAVA/bin/java -classpath $TESTCLASSES"
- JAR="$TESTJAVA/bin/jar"
- OS=`uname -s`;
- 
-+# Tests whether we are on windows (true) or not.
-+IsWindows() {
-+    case "$OS" in
-+        Windows* | CYGWIN* )
-+            printf "true"
-+        ;;
-+        * )
-+            printf "false"
-+        ;;
-+    esac
-+}
-+
- #
- # Shell routine to test for the proper rejection of syntactically incorrect
- # version specifications.
-@@ -262,6 +275,29 @@
- 	fi
- }
- 
-+# Tests very long Main-Class attribute in the jar.
-+TestLongMainClass() {
-+    JVER=$1
-+    if [ "$JVER" = "mklink" ]; then
-+        JVER=XX
-+        JDKXX=jdk/j2re$JVER
-+        rm -rf jdk
-+        mkdir jdk
-+        ln -s $TESTJAVA $JDKXX
-+        JAVA_VERSION_PATH="`pwd`/jdk"
-+        export JAVA_VERSION_PATH
-+    fi
-+    $JAVAEXE -cp $TESTCLASSES ZipMeUp UglyBetty.jar 4097 
-+    message="`$JAVAEXE -version:$JVER -jar UglyBetty.jar 2>&1`"
-+    echo $message | grep "Error: main-class: attribute exceeds system limits" > /dev/null 2>&1
-+    if [ $? -ne 0 ]; then
-+        printf "Long manifest test did not get expected error"
-+        exit 1
-+    fi
-+    unset JAVA_VERSION_PATH
-+    rm -rf jdk
-+}
-+
- #
- # Main test sequence starts here
- #
-@@ -280,14 +316,12 @@
- LaunchVM "" "${RELEASE}"
- CreateJar "" "0"
- LaunchVM "" "${RELEASE}"
--case "$OS" in
--	Windows* | CYGWIN* )
--		MAXIMUM_PATH=255;
--	;;
--	*)
--		MAXIMUM_PATH=1024;
--	;;
--esac
-+if [ `IsWindows` = "true" ]; then
-+    MAXIMUM_PATH=115;  # 115 = 255 - 140
-+else
-+    MAXIMUM_PATH=884;  # 884 = 1024 - 140
-+fi
-+
- 
- PATH_LENGTH=`printf "%s" "$UGLYCLASS" | wc -c`
- if [ ${PATH_LENGTH} -lt ${MAXIMUM_PATH} ]; then
-@@ -357,15 +391,28 @@
- TestSyntax "1.2+.3"				# Embedded modifier
- TestSyntax "1.2.4+&1.2*&1++"			# Long and invalid
- 
-+# On windows we see if there is another jre installed, usually
-+# there is, then we test using that, otherwise links are created
-+# to get through to SelectVersion.
-+if [ `IsWindows` = "false" ]; then
-+   TestLongMainClass "mklink"
-+else
-+    $JAVAEXE -version:1.0+
-+    if [ $? -eq 0 ]; then
-+        TestLongMainClass "1.0+"
-+    else
-+        printf  "Warning: TestLongMainClass skipped as there is no"
-+       printf  "viable MJRE installed.\n"
-+    fi
-+fi
-+
- #
- # Because scribbling in the registry can be rather destructive, only a
- # subset of the tests are run on Windows.
- #
--case "$OS" in
--	Windows* | CYGWIN* )
--		exit 0;
--	;;
--esac
-+if [ `IsWindows` = "true" ]; then
-+   exit 0;
-+fi
- 
- #
- # Additional version specifiers containing spaces.  (Sigh, unable to
-diff -Nru openjdk.orig/jdk/test/tools/launcher/ZipMeUp.java openjdk/jdk/test/tools/launcher/ZipMeUp.java
---- openjdk.orig/jdk/test/tools/launcher/ZipMeUp.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/tools/launcher/ZipMeUp.java	2008-12-02 17:07:57.000000000 +0000
-@@ -0,0 +1,90 @@
-+/*
-+ * Copyright 2008 Sun Microsystems, Inc.  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
-+ * under the terms of the GNU General Public License version 2 only, as
-+ * published by the Free Software Foundation.
-+ *
-+ * This code is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * version 2 for more details (a copy is included in the LICENSE file that
-+ * accompanied this code).
-+ *
-+ * You should have received a copy of the GNU General Public License version
-+ * 2 along with this work; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+ *
-+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+/**
-+ * A simple class to create our erring Jar with a very long Main-Class
-+ * attribute in the manifest.
-+ */
-+import java.io.ByteArrayOutputStream;
-+import java.io.FileOutputStream;
-+import java.io.IOException;
-+import java.io.PrintStream;
-+import java.util.zip.CRC32;
-+import java.util.zip.CheckedOutputStream;
-+import java.util.zip.ZipEntry;
-+import java.util.zip.ZipOutputStream;
-+public class ZipMeUp {
-+    
-+    static final CRC32 crc = new CRC32();
-+    
-+    private static String SOME_KLASS = ".Some";
-+    
-+    static byte[] getManifestAsBytes(int nchars) throws IOException {
-+        crc.reset();
-+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-+        CheckedOutputStream cos = new CheckedOutputStream(baos, crc);
-+        PrintStream ps = new PrintStream(cos);
-+        ps.println("Manifest-Version: 1.0");
-+        ps.print("Main-Class: ");
-+        for (int i = 0 ; i < nchars - SOME_KLASS.length(); i++) {
-+            ps.print(i%10);
-+        }
-+        ps.println(SOME_KLASS);
-+        cos.flush();
-+        cos.close();
-+        ps.close();
-+        return baos.toByteArray();
-+    }
-+    /**
-+     * The arguments are: filename_to_create length
-+     * @param args
-+     * @throws java.lang.Exception
-+     */
-+    public static void main(String...args) throws Exception  {
-+        FileOutputStream fos = new FileOutputStream(args[0]);
-+        ZipOutputStream zos = new ZipOutputStream(fos);
-+        byte[] manifest = getManifestAsBytes(Integer.parseInt(args[1]));
-+        ZipEntry ze = new ZipEntry("META-INF/MANIFEST.MF");
-+        ze.setMethod(ZipEntry.STORED);
-+        ze.setSize(manifest.length);
-+        ze.setCompressedSize(manifest.length);
-+        ze.setCrc(crc.getValue());
-+        ze.setTime(System.currentTimeMillis());
-+        zos.putNextEntry(ze);
-+        zos.write(manifest);
-+        zos.flush();
-+        
-+        // add a zero length class
-+        ze = new ZipEntry(SOME_KLASS + ".class");
-+        ze.setMethod(ZipEntry.STORED);
-+        ze.setSize(0);
-+        ze.setCompressedSize(0);
-+        ze.setCrc(0);
-+        ze.setTime(System.currentTimeMillis());
-+        zos.putNextEntry(ze);
-+        zos.flush();
-+        zos.closeEntry();
-+        zos.close();
-+        System.exit(0);
-+    }
-+}
--- a/patches/icedtea-6755943.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,373 +0,0 @@
-diff -Nru openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java
---- openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java	2008-12-02 15:42:47.000000000 +0000
-@@ -0,0 +1,369 @@
-+/*
-+ * Copyright 2008 Sun Microsystems, Inc.  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
-+ * under the terms of the GNU General Public License version 2 only, as
-+ * published by the Free Software Foundation.
-+ *
-+ * This code is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * version 2 for more details (a copy is included in the LICENSE file that
-+ * accompanied this code).
-+ *
-+ * You should have received a copy of the GNU General Public License version
-+ * 2 along with this work; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+ *
-+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6755943
-+ * @summary Checks any memory overruns in archive length.
-+ * @run main/timeout=1200 MemoryAllocatorTest
-+ */
-+import java.io.BufferedReader;
-+import java.io.DataOutputStream;
-+import java.io.File;
-+import java.io.FileOutputStream;
-+import java.io.IOException;
-+import java.io.InputStreamReader;
-+import java.io.OutputStream;
-+import java.io.RandomAccessFile;
-+import java.nio.MappedByteBuffer;
-+import java.nio.channels.FileChannel;
-+import java.util.ArrayList;
-+import java.util.List;
-+import java.util.Map;
-+
-+public class MemoryAllocatorTest {
-+
-+    /*
-+     * The smallest possible pack file with 1 empty resource
-+     */
-+    static int[] magic = {
-+        0xCA, 0xFE, 0xD0, 0x0D
-+    };
-+    static int[] version_info = {
-+        0x07, // minor
-+        0x96  // major
-+    };
-+    static int[] option = {
-+        0x10
-+    };
-+    static int[] size_hi = {
-+        0x00
-+    };
-+    static int[] size_lo_ulong = {
-+        0xFF, 0xFC, 0xFC, 0xFC, 0xFC // ULONG_MAX 0xFFFFFFFF
-+    };
-+    static int[] size_lo_correct = {
-+        0x17
-+    };
-+    static int[] data = {
-+        0x00, 0xEC, 0xDA, 0xDE, 0xF8, 0x45, 0x01, 0x02,
-+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+        0x00, 0x00, 0x00, 0x01, 0x31, 0x01, 0x00
-+    };
-+    // End of pack file data
-+
-+    static final String JAVA_HOME = System.getProperty("java.home");
-+
-+    static final boolean debug = Boolean.getBoolean("MemoryAllocatorTest.Debug");
-+    static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows");
-+    static final boolean LINUX = System.getProperty("os.name").startsWith("Linux");
-+    static final boolean SIXTYFOUR_BIT = System.getProperty("sun.arch.data.model", "32").equals("64");
-+    static final private int EXPECTED_EXIT_CODE = (WINDOWS) ? -1 : 255;
-+
-+    static int testExitValue = 0;
-+    
-+    static byte[] bytes(int[] a) {
-+        byte[] b = new byte[a.length];
-+        for (int i = 0; i < b.length; i++) {
-+            b[i] = (byte) a[i];
-+        }
-+        return b;
-+    }
-+    
-+    static void createPackFile(boolean good, File packFile) throws IOException {
-+        FileOutputStream fos = new FileOutputStream(packFile);
-+        fos.write(bytes(magic));
-+        fos.write(bytes(version_info));
-+        fos.write(bytes(option));
-+        fos.write(bytes(size_hi));
-+        if (good) {
-+            fos.write(bytes(size_lo_correct));
-+        } else {
-+            fos.write(bytes(size_lo_ulong));
-+        }
-+        fos.write(bytes(data));
-+    }
-+
-+    /*
-+     * This method modifies the LSB of the size_lo for various wicked
-+     * values between MAXINT-0x3F and MAXINT.
-+     */
-+    static int modifyPackFile(File packFile) throws IOException {
-+        RandomAccessFile raf = new RandomAccessFile(packFile, "rws");
-+        long len = packFile.length();
-+        FileChannel fc = raf.getChannel();
-+        MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_WRITE, 0, len);
-+        int pos = magic.length + version_info.length + option.length +
-+                size_hi.length;
-+        byte value = bb.get(pos);
-+        value--;
-+        bb.position(pos);
-+        bb.put(value);
-+        bb.force();
-+        fc.truncate(len);
-+        fc.close();
-+        return value & 0xFF;
-+    }
-+
-+    static String getUnpack200Cmd() throws Exception {
-+        File binDir = new File(JAVA_HOME, "bin");
-+        File unpack200File = WINDOWS
-+                ? new File(binDir, "unpack200.exe")
-+                : new File(binDir, "unpack200");
-+
-+        String cmd = unpack200File.getAbsolutePath();
-+        if (!unpack200File.canExecute()) {
-+            throw new Exception("please check" +
-+                    cmd + " exists and is executable");
-+        }
-+        return cmd;
-+    }
-+
-+    static TestResult runUnpacker(File packFile) throws Exception {
-+        if (!packFile.exists()) {
-+            throw new Exception("please check" + packFile + " exists");
-+        }
-+        ArrayList<String> alist = new ArrayList<String>();
-+        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(),
-+                packFile.getName(), "testout.jar");
-+        Map<String, String> env = pb.environment();
-+        pb.directory(new File("."));
-+        int retval = 0;
-+        try {
-+            pb.redirectErrorStream(true);
-+            Process p = pb.start();
-+            BufferedReader rd = new BufferedReader(
-+                    new InputStreamReader(p.getInputStream()), 8192);
-+            String in = rd.readLine();
-+            while (in != null) {
-+                alist.add(in);
-+                System.out.println(in);
-+                in = rd.readLine();
-+            }
-+            retval = p.waitFor();
-+            p.destroy();
-+        } catch (Exception ex) {
-+            ex.printStackTrace();
-+            throw new RuntimeException(ex.getMessage());
-+        }
-+        return new TestResult("", retval, alist);
-+    }
-+
-+    /*
-+     * The debug version builds of unpack200 call abort(3) which might set
-+     * an unexpected return value, therefore this test is to determine
-+     * if we are using a product or non-product build and check the
-+     * return value appropriately.
-+     */
-+    static boolean isNonProductVersion() throws Exception {
-+        ArrayList<String> alist = new ArrayList<String>();
-+        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(), "--version");
-+        Map<String, String> env = pb.environment();
-+        pb.directory(new File("."));
-+        int retval = 0;
-+        try {
-+            pb.redirectErrorStream(true);
-+            Process p = pb.start();
-+            BufferedReader rd = new BufferedReader(
-+                    new InputStreamReader(p.getInputStream()), 8192);
-+            String in = rd.readLine();
-+            while (in != null) {
-+                alist.add(in);
-+                System.out.println(in);
-+                in = rd.readLine();
-+            }
-+            retval = p.waitFor();
-+            p.destroy();
-+        } catch (Exception ex) {
-+            ex.printStackTrace();
-+            throw new RuntimeException(ex.getMessage());
-+        }
-+        for (String x : alist) {
-+            if (x.contains("non-product")) {
-+                return true;
-+            }
-+        }
-+        return false;
-+    }
-+
-+    /**
-+     * @param args the command line arguments
-+     * @throws java.lang.Exception 
-+     */
-+    public static void main(String[] args) throws Exception {
-+
-+        File packFile = new File("tiny.pack");
-+        boolean isNPVersion = isNonProductVersion();
-+
-+        // Create a good pack file and test if everything is ok
-+        createPackFile(true, packFile);
-+        TestResult tr = runUnpacker(packFile);
-+        tr.setDescription("a good pack file");
-+        tr.checkPositive();
-+        tr.isOK();
-+        System.out.println(tr);
-+
-+        /*
-+         * jprt systems on windows and linux seem to have abundant memory
-+         * therefore can take a very long time to run, and even if it does
-+         * the error message is not accurate for us to discern if the test
-+         * passes successfully.
-+         */
-+        if (SIXTYFOUR_BIT && (LINUX || WINDOWS)) {
-+            System.out.println("Warning: Windows/Linux 64bit tests passes vacuously");
-+            return;
-+        }
-+        
-+        /*
-+         * debug builds call abort, the exit code under these conditions
-+         * are not really relevant.
-+         */
-+        if (isNPVersion) {
-+            System.out.println("Warning: non-product build: exit values not checked");
-+        }
-+    
-+        // create a bad pack file
-+        createPackFile(false, packFile);
-+        tr = runUnpacker(packFile);
-+        tr.setDescription("a wicked pack file");
-+        tr.contains("Native allocation failed");
-+        if(!isNPVersion) {
-+            tr.checkValue(EXPECTED_EXIT_CODE);
-+        }
-+        System.out.println(tr);
-+        int value = modifyPackFile(packFile);
-+        tr.setDescription("value=" + value);
-+
-+        // continue creating bad pack files by modifying the specimen pack file.
-+        while (value >= 0xc0) {
-+            tr = runUnpacker(packFile);
-+            tr.contains("Native allocation failed");
-+            if (!isNPVersion) {
-+                tr.checkValue(EXPECTED_EXIT_CODE);
-+            }
-+            tr.setDescription("wicked value=0x" +
-+                    Integer.toHexString(value & 0xFF));
-+            System.out.println(tr);
-+            value = modifyPackFile(packFile);
-+        }
-+        if (testExitValue != 0) {
-+            throw new Exception("Pack200 archive length tests(" +
-+                    testExitValue + ") failed ");
-+        } else {
-+            System.out.println("All tests pass");
-+        }
-+    }
-+
-+    /*
-+     * A class to encapsulate the test results and stuff, with some ease
-+     * of use methods to check the test results.
-+     */
-+    static class TestResult {
-+
-+        StringBuilder status;
-+        int exitValue;
-+        List<String> testOutput;
-+        String description;
-+
-+        public TestResult(String str, int rv, List<String> oList) {
-+            status = new StringBuilder(str);
-+            exitValue = rv;
-+            testOutput = oList;
-+        }
-+
-+        void setDescription(String description) {
-+            this.description = description;
-+        }
-+
-+        void checkValue(int value) {
-+            if (exitValue != value) {
-+                status =
-+                        status.append("  Error: test expected exit value " +
-+                        value + "got " + exitValue);
-+                testExitValue++;
-+            }
-+        }
-+
-+        void checkNegative() {
-+            if (exitValue == 0) {
-+                status = status.append(
-+                        "  Error: test did not expect 0 exit value");
-+
-+                testExitValue++;
-+            }
-+        }
-+
-+        void checkPositive() {
-+            if (exitValue != 0) {
-+                status = status.append(
-+                        "  Error: test did not return 0 exit value");
-+                testExitValue++;
-+            }
-+        }
-+
-+        boolean isOK() {
-+            return exitValue == 0;
-+        }
-+
-+        boolean isZeroOutput() {
-+            if (!testOutput.isEmpty()) {
-+                status = status.append("  Error: No message from cmd please");
-+                testExitValue++;
-+                return false;
-+            }
-+            return true;
-+        }
-+
-+        boolean isNotZeroOutput() {
-+            if (testOutput.isEmpty()) {
-+                status = status.append("  Error: Missing message");
-+                testExitValue++;
-+                return false;
-+            }
-+            return true;
-+        }
-+
-+        public String toString() {
-+            if (debug) {
-+                for (String x : testOutput) {
-+                    status = status.append(x + "\n");
-+                }
-+            }
-+            if (description != null) {
-+                status.insert(0, description);
-+            }
-+            return status.append("\nexitValue = " + exitValue).toString();
-+        }
-+
-+        boolean contains(String str) {
-+            for (String x : testOutput) {
-+                if (x.contains(str)) {
-+                    return true;
-+                }
-+            }
-+            status = status.append("   Error: string <" + str + "> not found ");
-+            testExitValue++;
-+            return false;
-+        }
-+    }
-+}
--- a/patches/icedtea-alpha-fixes.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-diff -Nru openjdk.orig/hotspot/agent/src/os/linux/Makefile openjdk/hotspot/agent/src/os/linux/Makefile
---- openjdk.orig/hotspot/agent/src/os/linux/Makefile	2010-09-01 09:57:06.000000000 +0100
-+++ openjdk/hotspot/agent/src/os/linux/Makefile	2010-09-01 10:27:09.592191147 +0100
-@@ -40,7 +40,7 @@
- 
- LIBS     = -lthread_db
- 
--CFLAGS   = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES)
-+CFLAGS   = -c -fPIC -g -D_GNU_SOURCE -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) $(INCLUDES)
- 
- LIBSA = $(ARCH)/libsaproc.so
- 
-@@ -73,7 +73,7 @@
- 	$(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS)
- 
- test.o: test.c
--	$(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c
-+	$(GCC) -c -o test.o -g -D_GNU_SOURCE -D_$(ARCH)_ $(if $(filter $(ARCH),alpha),,-D$(ARCH)) $(INCLUDES) test.c
- 
- test: test.o
- 	$(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS)
-diff -Nru openjdk.orig/hotspot/src/share/vm/oops/generateOopMap.cpp openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp
---- openjdk.orig/hotspot/src/share/vm/oops/generateOopMap.cpp	2010-08-27 19:15:27.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/oops/generateOopMap.cpp	2010-09-01 10:28:08.943025196 +0100
-@@ -2104,7 +2104,7 @@
- void GenerateOopMap::report_error(const char *format, ...) {
-   va_list ap;
-   va_start(ap, format);
--  error_work(format, ap);
-+  report_error(format, ap);
- }
- 
- void GenerateOopMap::verify_error(const char *format, ...) {
--- a/patches/icedtea-alt-jar.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
---- openjdk.orig/jdk/make/common/shared/Defs-java.gmk	2008-05-30 03:50:36.000000000 -0400
-+++ openjdk/jdk/make/common/shared/Defs-java.gmk	2008-08-06 11:18:26.000000000 -0400
-@@ -187,7 +181,11 @@
- 
- BOOT_JAVA_CMD      = $(BOOTDIR)/bin/java $(JAVA_TOOLS_FLAGS)
- BOOT_JAVAC_CMD     = $(BOOTDIR)/bin/javac $(JAVAC_JVM_FLAGS) $(BOOT_JAVACFLAGS)
--BOOT_JAR_CMD       = $(BOOTDIR)/bin/jar
-+ifdef ALT_JAR_CMD
-+  BOOT_JAR_CMD       = $(ALT_JAR_CMD)
-+else
-+  BOOT_JAR_CMD       = $(BOOTDIR)/bin/jar
-+endif
- BOOT_JARSIGNER_CMD = $(BOOTDIR)/bin/jarsigner
- 
- # Various tools we need to run (FIXUP: Are these the right ones?)
--- a/patches/icedtea-clean-crypto.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1078 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/javax/crypto/Makefile openjdk/jdk/make/javax/crypto/Makefile
---- openjdk.orig/jdk/make/javax/crypto/Makefile	2010-07-29 21:55:27.000000000 +0100
-+++ openjdk/jdk/make/javax/crypto/Makefile	2010-09-01 10:37:32.926684780 +0100
-@@ -157,7 +157,8 @@
- #
- 
- ifdef OPENJDK
--all: build-jar install-jar build-policy install-limited
-+# We don't need any policy files.
-+all: build-jar install-jar
- else  # OPENJDK
- ifeq ($(strip $(FILES_java)),)
- all:
-diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java openjdk/jdk/src/share/classes/javax/crypto/Cipher.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/Cipher.java	2010-07-29 21:55:43.000000000 +0100
-+++ openjdk/jdk/src/share/classes/javax/crypto/Cipher.java	2010-09-01 10:37:32.926684780 +0100
-@@ -144,12 +144,6 @@
-     // The transformation
-     private String transformation;
- 
--    // Crypto permission representing the maximum allowable cryptographic
--    // strength that this Cipher object can be used for. (The cryptographic
--    // strength is a function of the keysize and algorithm parameters encoded
--    // in the crypto permission.)
--    private CryptoPermission cryptoPerm;
--
-     // The exemption mechanism that needs to be enforced
-     private ExemptionMechanism exmech;
- 
-@@ -190,16 +184,9 @@
-     protected Cipher(CipherSpi cipherSpi,
-                      Provider provider,
-                      String transformation) {
--        // See bug 4341369 & 4334690 for more info.
--        // If the caller is trusted, then okey.
--        // Otherwise throw a NullPointerException.
--        if (!JceSecurityManager.INSTANCE.isCallerTrusted()) {
--            throw new NullPointerException();
--        }
-         this.spi = cipherSpi;
-         this.provider = provider;
-         this.transformation = transformation;
--        this.cryptoPerm = CryptoAllPermission.INSTANCE;
-         this.lock = null;
-     }
- 
-@@ -212,7 +199,6 @@
-     Cipher(CipherSpi cipherSpi, String transformation) {
-         this.spi = cipherSpi;
-         this.transformation = transformation;
--        this.cryptoPerm = CryptoAllPermission.INSTANCE;
-         this.lock = null;
-     }
- 
-@@ -442,9 +428,6 @@
-         Exception failure = null;
-         while (t.hasNext()) {
-             Service s = (Service)t.next();
--            if (JceSecurity.canUseProvider(s.getProvider()) == false) {
--                continue;
--            }
-             Transform tr = getTransform(s, transforms);
-             if (tr == null) {
-                 // should never happen
-@@ -570,7 +553,6 @@
-         }
-         Exception failure = null;
-         List transforms = getTransforms(transformation);
--        boolean providerChecked = false;
-         String paddingError = null;
-         for (Iterator t = transforms.iterator(); t.hasNext();) {
-             Transform tr = (Transform)t.next();
-@@ -578,19 +560,6 @@
-             if (s == null) {
-                 continue;
-             }
--            if (providerChecked == false) {
--                // for compatibility, first do the lookup and then verify
--                // the provider. this makes the difference between a NSAE
--                // and a SecurityException if the
--                // provider does not support the algorithm.
--                Exception ve = JceSecurity.getVerificationResult(provider);
--                if (ve != null) {
--                    String msg = "JCE cannot authenticate the provider "
--                        + provider.getName();
--                    throw new SecurityException(msg, ve);
--                }
--                providerChecked = true;
--            }
-             if (tr.supportsMode(s) == S_NO) {
-                 continue;
-             }
-@@ -603,7 +572,6 @@
-                 tr.setModePadding(spi);
-                 Cipher cipher = new Cipher(spi, transformation);
-                 cipher.provider = s.getProvider();
--                cipher.initCryptoPermission();
-                 return cipher;
-             } catch (Exception e) {
-                 failure = e;
-@@ -622,22 +590,6 @@
-                 ("No such algorithm: " + transformation, failure);
-     }
- 
--    // If the requested crypto service is export-controlled,
--    // determine the maximum allowable keysize.
--    private void initCryptoPermission() throws NoSuchAlgorithmException {
--        if (JceSecurity.isRestricted() == false) {
--            cryptoPerm = CryptoAllPermission.INSTANCE;
--            exmech = null;
--            return;
--        }
--        cryptoPerm = getConfiguredPermission(transformation);
--        // Instantiate the exemption mechanism (if required)
--        String exmechName = cryptoPerm.getExemptionMechanism();
--        if (exmechName != null) {
--            exmech = ExemptionMechanism.getInstance(exmechName);
--        }
--    }
--
-     // max number of debug warnings to print from chooseFirstProvider()
-     private static int warnCount = 10;
- 
-@@ -679,9 +631,6 @@
-                     s = (Service)serviceIterator.next();
-                     thisSpi = null;
-                 }
--                if (JceSecurity.canUseProvider(s.getProvider()) == false) {
--                    continue;
--                }
-                 Transform tr = getTransform(s, transforms);
-                 if (tr == null) {
-                     // should never happen
-@@ -699,7 +648,6 @@
-                         thisSpi = (CipherSpi)obj;
-                     }
-                     tr.setModePadding(thisSpi);
--                    initCryptoPermission();
-                     spi = thisSpi;
-                     provider = s.getProvider();
-                     // not needed any more
-@@ -731,19 +679,15 @@
-             InvalidAlgorithmParameterException {
-         switch (type) {
-         case I_KEY:
--            checkCryptoPerm(thisSpi, key);
-             thisSpi.engineInit(opmode, key, random);
-             break;
-         case I_PARAMSPEC:
--            checkCryptoPerm(thisSpi, key, paramSpec);
-             thisSpi.engineInit(opmode, key, paramSpec, random);
-             break;
-         case I_PARAMS:
--            checkCryptoPerm(thisSpi, key, params);
-             thisSpi.engineInit(opmode, key, params, random);
-             break;
-         case I_CERT:
--            checkCryptoPerm(thisSpi, key);
-             thisSpi.engineInit(opmode, key, random);
-             break;
-         default:
-@@ -777,9 +721,6 @@
-                 if (s.supportsParameter(key) == false) {
-                     continue;
-                 }
--                if (JceSecurity.canUseProvider(s.getProvider()) == false) {
--                    continue;
--                }
-                 Transform tr = getTransform(s, transforms);
-                 if (tr == null) {
-                     // should never happen
-@@ -793,7 +734,6 @@
-                         thisSpi = (CipherSpi)s.newInstance(null);
-                     }
-                     tr.setModePadding(thisSpi);
--                    initCryptoPermission();
-                     implInit(thisSpi, initType, opmode, key, paramSpec,
-                                                         params, random);
-                     provider = s.getProvider();
-@@ -939,107 +879,6 @@
-         return exmech;
-     }
- 
--    //
--    // Crypto permission check code below
--    //
--    private void checkCryptoPerm(CipherSpi checkSpi, Key key)
--            throws InvalidKeyException {
--        if (cryptoPerm == CryptoAllPermission.INSTANCE) {
--            return;
--        }
--        // Check if key size and default parameters are within legal limits
--        AlgorithmParameterSpec params;
--        try {
--            params = getAlgorithmParameterSpec(checkSpi.engineGetParameters());
--        } catch (InvalidParameterSpecException ipse) {
--            throw new InvalidKeyException
--                ("Unsupported default algorithm parameters");
--        }
--        if (!passCryptoPermCheck(checkSpi, key, params)) {
--            throw new InvalidKeyException(
--                "Illegal key size or default parameters");
--        }
--    }
--
--    private void checkCryptoPerm(CipherSpi checkSpi, Key key,
--            AlgorithmParameterSpec params) throws InvalidKeyException,
--            InvalidAlgorithmParameterException {
--        if (cryptoPerm == CryptoAllPermission.INSTANCE) {
--            return;
--        }
--        // Determine keysize and check if it is within legal limits
--        if (!passCryptoPermCheck(checkSpi, key, null)) {
--            throw new InvalidKeyException("Illegal key size");
--        }
--        if ((params != null) && (!passCryptoPermCheck(checkSpi, key, params))) {
--            throw new InvalidAlgorithmParameterException("Illegal parameters");
--        }
--    }
--
--    private void checkCryptoPerm(CipherSpi checkSpi, Key key,
--            AlgorithmParameters params)
--            throws InvalidKeyException, InvalidAlgorithmParameterException {
--        if (cryptoPerm == CryptoAllPermission.INSTANCE) {
--            return;
--        }
--        // Convert the specified parameters into specs and then delegate.
--        AlgorithmParameterSpec pSpec;
--        try {
--            pSpec = getAlgorithmParameterSpec(params);
--        } catch (InvalidParameterSpecException ipse) {
--            throw new InvalidAlgorithmParameterException
--                ("Failed to retrieve algorithm parameter specification");
--        }
--        checkCryptoPerm(checkSpi, key, pSpec);
--    }
--
--    private boolean passCryptoPermCheck(CipherSpi checkSpi, Key key,
--                                        AlgorithmParameterSpec params)
--            throws InvalidKeyException {
--        String em = cryptoPerm.getExemptionMechanism();
--        int keySize = checkSpi.engineGetKeySize(key);
--        // Use the "algorithm" component of the cipher
--        // transformation so that the perm check would
--        // work when the key has the "aliased" algo.
--        String algComponent;
--        int index = transformation.indexOf('/');
--        if (index != -1) {
--            algComponent = transformation.substring(0, index);
--        } else {
--            algComponent = transformation;
--        }
--        CryptoPermission checkPerm =
--            new CryptoPermission(algComponent, keySize, params, em);
--
--        if (!cryptoPerm.implies(checkPerm)) {
--            if (debug != null) {
--                debug.println("Crypto Permission check failed");
--                debug.println("granted: " + cryptoPerm);
--                debug.println("requesting: " + checkPerm);
--            }
--            return false;
--        }
--        if (exmech == null) {
--            return true;
--        }
--        try {
--            if (!exmech.isCryptoAllowed(key)) {
--                if (debug != null) {
--                    debug.println(exmech.getName() + " isn't enforced");
--                }
--                return false;
--            }
--        } catch (ExemptionMechanismException eme) {
--            if (debug != null) {
--                debug.println("Cannot determine whether "+
--                              exmech.getName() + " has been enforced");
--                eme.printStackTrace();
--            }
--            return false;
--        }
--        return true;
--    }
--
-     // check if opmode is one of the defined constants
-     // throw InvalidParameterExeption if not
-     private static void checkOpmode(int opmode) {
-@@ -1144,7 +983,6 @@
-         checkOpmode(opmode);
- 
-         if (spi != null) {
--            checkCryptoPerm(spi, key);
-             spi.engineInit(opmode, key, random);
-         } else {
-             try {
-@@ -1270,7 +1108,6 @@
-         checkOpmode(opmode);
- 
-         if (spi != null) {
--            checkCryptoPerm(spi, key, params);
-             spi.engineInit(opmode, key, params, random);
-         } else {
-             chooseProvider(I_PARAMSPEC, opmode, key, params, null, random);
-@@ -1391,7 +1228,6 @@
-         checkOpmode(opmode);
- 
-         if (spi != null) {
--            checkCryptoPerm(spi, key, params);
-             spi.engineInit(opmode, key, params, random);
-         } else {
-             chooseProvider(I_PARAMS, opmode, key, null, params, random);
-@@ -1555,7 +1391,6 @@
-             (certificate==null? null:certificate.getPublicKey());
- 
-         if (spi != null) {
--            checkCryptoPerm(spi, publicKey);
-             spi.engineInit(opmode, publicKey, random);
-         } else {
-             try {
-@@ -2361,12 +2196,15 @@
-         return null;
-     }
- 
-+    // Used by getMaxAllowedKeyLength and getMaxAllowedParameterSpec
-+    // always returns CryptoAllPermission. Old stuff from bad old days.
-     private static CryptoPermission getConfiguredPermission(
-             String transformation) throws NullPointerException,
-             NoSuchAlgorithmException {
-         if (transformation == null) throw new NullPointerException();
--        String[] parts = tokenizeTransformation(transformation);
--        return JceSecurityManager.INSTANCE.getCryptoPermission(parts[0]);
-+	// Called to make sure it is a valid transformation.
-+        tokenizeTransformation(transformation);
-+        return CryptoAllPermission.INSTANCE;
-     }
- 
-     /**
-diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JarVerifier.java openjdk/jdk/src/share/classes/javax/crypto/JarVerifier.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/JarVerifier.java	2010-07-29 21:55:43.000000000 +0100
-+++ openjdk/jdk/src/share/classes/javax/crypto/JarVerifier.java	1970-01-01 01:00:00.000000000 +0100
-@@ -1,157 +0,0 @@
--/*
-- * Copyright (c) 2007, 2009, 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
-- * under the terms of the GNU General Public License version 2 only, as
-- * published by the Free Software Foundation.  Oracle designates this
-- * particular file as subject to the "Classpath" exception as provided
-- * by Oracle in the LICENSE file that accompanied this code.
-- *
-- * This code is distributed in the hope that it will be useful, but WITHOUT
-- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- * version 2 for more details (a copy is included in the LICENSE file that
-- * accompanied this code).
-- *
-- * You should have received a copy of the GNU General Public License version
-- * 2 along with this work; if not, write to the Free Software Foundation,
-- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-- *
-- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-- * or visit www.oracle.com if you need additional information or have any
-- * questions.
-- */
--
--package javax.crypto;
--
--import java.io.*;
--import java.net.*;
--import java.security.*;
--import java.util.jar.*;
--
--/**
-- * This class verifies JAR files (and any supporting JAR files), and
-- * determines whether they may be used in this implementation.
-- *
-- * The JCE in OpenJDK has an open cryptographic interface, meaning it
-- * does not restrict which providers can be used.  Compliance with
-- * United States export controls and with local law governing the
-- * import/export of products incorporating the JCE in the OpenJDK is
-- * the responsibility of the licensee.
-- *
-- * @since 1.7
-- */
--final class JarVerifier {
--
--    // The URL for the JAR file we want to verify.
--    private URL jarURL;
--    private boolean savePerms;
--    private CryptoPermissions appPerms = null;
--
--    /**
--     * Creates a JarVerifier object to verify the given URL.
--     *
--     * @param jarURL the JAR file to be verified.
--     * @param savePerms if true, save the permissions allowed by the
--     *          exemption mechanism
--     */
--    JarVerifier(URL jarURL, boolean savePerms) {
--        this.jarURL = jarURL;
--        this.savePerms = savePerms;
--    }
--
--    /**
--     * Verify the JAR file is signed by an entity which has a certificate
--     * issued by a trusted CA.
--     *
--     * In OpenJDK, we just need to examine the "cryptoperms" file to see
--     * if any permissions were bundled together with this jar file.
--     */
--    void verify() throws JarException, IOException {
--
--        // Short-circuit.  If we weren't asked to save any, we're done.
--        if (!savePerms) {
--            return;
--        }
--
--        // If the protocol of jarURL isn't "jar", we should
--        // construct a JAR URL so we can open a JarURLConnection
--        // for verifying this provider.
--        final URL url = jarURL.getProtocol().equalsIgnoreCase("jar")?
--                        jarURL : new URL("jar:" + jarURL.toString() + "!/");
--
--        JarFile jf = null;
--        try {
--
--            // Get a link to the Jarfile to search.
--            try {
--                jf = (JarFile)
--                    AccessController.doPrivileged(
--                        new PrivilegedExceptionAction() {
--                            public Object run() throws Exception {
--                                JarURLConnection conn =
--                                    (JarURLConnection) url.openConnection();
--                                // You could do some caching here as
--                                // an optimization.
--                                conn.setUseCaches(false);
--                                return conn.getJarFile();
--                            }
--                        });
--            } catch (java.security.PrivilegedActionException pae) {
--                SecurityException se = new SecurityException(
--                    "Cannot load " + url.toString());
--                se.initCause(pae);
--                throw se;
--            }
--
--            if (jf != null) {
--                JarEntry je = jf.getJarEntry("cryptoPerms");
--                if (je == null) {
--                    throw new JarException(
--                        "Can not find cryptoPerms");
--                }
--                try {
--                    appPerms = new CryptoPermissions();
--                    appPerms.load(jf.getInputStream(je));
--                } catch (Exception ex) {
--                    JarException jex =
--                        new JarException("Cannot load/parse" +
--                            jarURL.toString());
--                    jex.initCause(ex);
--                    throw jex;
--                }
--            }
--        } finally {
--            // Only call close() when caching is not enabled.
--            // Otherwise, exceptions will be thrown for all
--            // subsequent accesses of this cached jar.
--            if (jf != null) {
--                jf.close();
--            }
--        }
--    }
--
--    /**
--     * Verify that the provided certs include the
--     * framework signing certificate.
--     *
--     * @param certs the list of certs to be checked.
--     * @throws Exception if the list of certs did not contain
--     *          the framework signing certificate
--     */
--    static void verifyPolicySigned(java.security.cert.Certificate[] certs)
--            throws Exception {
--    }
--
--    /**
--     * Returns the permissions which are bundled with the JAR file,
--     * aka the "cryptoperms" file.
--     *
--     * NOTE: if this JarVerifier instance is constructed with "savePerms"
--     * equal to false, then this method would always return null.
--     */
--    CryptoPermissions getPermissions() {
--        return appPerms;
--    }
--}
-diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurity.java	2010-07-29 21:55:43.000000000 +0100
-+++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurity.java	2010-09-01 10:37:32.934684089 +0100
-@@ -27,8 +27,6 @@
- 
- import java.util.*;
- import java.util.jar.*;
--import java.io.*;
--import java.net.URL;
- import java.security.*;
- 
- import java.security.Provider.Service;
-@@ -47,72 +45,25 @@
- 
- final class JceSecurity {
- 
-+    // Used in KeyGenerator, Cipher and KeyAgreement.
-     static final SecureRandom RANDOM = new SecureRandom();
- 
--    // The defaultPolicy and exemptPolicy will be set up
--    // in the static initializer.
--    private static CryptoPermissions defaultPolicy = null;
--    private static CryptoPermissions exemptPolicy = null;
--
--    // Map<Provider,?> of the providers we already have verified
--    // value == PROVIDER_VERIFIED is successfully verified
--    // value is failure cause Exception in error case
--    private final static Map verificationResults = new IdentityHashMap();
--
--    // Map<Provider,?> of the providers currently being verified
--    private final static Map verifyingProviders = new IdentityHashMap();
--
--    // Set the default value. May be changed in the static initializer.
--    private static boolean isRestricted = true;
--
-     /*
-      * Don't let anyone instantiate this.
-      */
-     private JceSecurity() {
-     }
- 
--    static {
--        try {
--            AccessController.doPrivileged(new PrivilegedExceptionAction() {
--                public Object run() throws Exception {
--                    setupJurisdictionPolicies();
--                    return null;
--                }
--            });
--
--            isRestricted = defaultPolicy.implies(
--                CryptoAllPermission.INSTANCE) ? false : true;
--        } catch (Exception e) {
--            SecurityException se =
--                new SecurityException(
--                    "Can not initialize cryptographic mechanism");
--            se.initCause(e);
--            throw se;
--        }
--    }
--
-     static Instance getInstance(String type, Class clazz, String algorithm,
-             String provider) throws NoSuchAlgorithmException,
-             NoSuchProviderException {
-         Service s = GetInstance.getService(type, algorithm, provider);
--        Exception ve = getVerificationResult(s.getProvider());
--        if (ve != null) {
--            String msg = "JCE cannot authenticate the provider " + provider;
--            throw (NoSuchProviderException)
--                                new NoSuchProviderException(msg).initCause(ve);
--        }
-         return GetInstance.getInstance(s, clazz);
-     }
- 
-     static Instance getInstance(String type, Class clazz, String algorithm,
-             Provider provider) throws NoSuchAlgorithmException {
-         Service s = GetInstance.getService(type, algorithm, provider);
--        Exception ve = JceSecurity.getVerificationResult(provider);
--        if (ve != null) {
--            String msg = "JCE cannot authenticate the provider "
--                + provider.getName();
--            throw new SecurityException(msg, ve);
--        }
-         return GetInstance.getInstance(s, clazz);
-     }
- 
-@@ -122,10 +73,6 @@
-         NoSuchAlgorithmException failure = null;
-         for (Iterator t = services.iterator(); t.hasNext(); ) {
-             Service s = (Service)t.next();
--            if (canUseProvider(s.getProvider()) == false) {
--                // allow only signed providers
--                continue;
--            }
-             try {
-                 Instance instance = GetInstance.getInstance(s, clazz);
-                 return instance;
-@@ -137,198 +84,10 @@
-                 + " not available", failure);
-     }
- 
--    /**
--     * Verify if the JAR at URL codeBase is a signed exempt application
--     * JAR file and returns the permissions bundled with the JAR.
--     *
--     * @throws Exception on error
--     */
--    static CryptoPermissions verifyExemptJar(URL codeBase) throws Exception {
--        JarVerifier jv = new JarVerifier(codeBase, true);
--        jv.verify();
--        return jv.getPermissions();
--    }
--
--    /**
--     * Verify if the JAR at URL codeBase is a signed provider JAR file.
--     *
--     * @throws Exception on error
--     */
--    static void verifyProviderJar(URL codeBase) throws Exception {
--        // Verify the provider JAR file and all
--        // supporting JAR files if there are any.
--        JarVerifier jv = new JarVerifier(codeBase, false);
--        jv.verify();
--    }
--
--    private final static Object PROVIDER_VERIFIED = Boolean.TRUE;
--
--    /*
--     * Verify that the provider JAR files are signed properly, which
--     * means the signer's certificate can be traced back to a
--     * JCE trusted CA.
--     * Return null if ok, failure Exception if verification failed.
--     */
--    static synchronized Exception getVerificationResult(Provider p) {
--        Object o = verificationResults.get(p);
--        if (o == PROVIDER_VERIFIED) {
--            return null;
--        } else if (o != null) {
--            return (Exception)o;
--        }
--        if (verifyingProviders.get(p) != null) {
--            // this method is static synchronized, must be recursion
--            // return failure now but do not save the result
--            return new NoSuchProviderException("Recursion during verification");
--        }
--        try {
--            verifyingProviders.put(p, Boolean.FALSE);
--            URL providerURL = getCodeBase(p.getClass());
--            verifyProviderJar(providerURL);
--            // Verified ok, cache result
--            verificationResults.put(p, PROVIDER_VERIFIED);
--            return null;
--        } catch (Exception e) {
--            verificationResults.put(p, e);
--            return e;
--        } finally {
--            verifyingProviders.remove(p);
--        }
--    }
--
--    // return whether this provider is properly signed and can be used by JCE
-+    // Used to return whether this provider is properly signed and
-+    // can be used by JCE. These days just returns true. Still used
-+    // in SecretKeyFactory, KeyGenerator, Mac and KeyAgreement.
-     static boolean canUseProvider(Provider p) {
--        return getVerificationResult(p) == null;
--    }
--
--    // dummy object to represent null
--    private static final URL NULL_URL;
--
--    static {
--        try {
--            NULL_URL = new URL("http://null.sun.com/");
--        } catch (Exception e) {
--            throw new RuntimeException(e);
--        }
--    }
--
--    // reference to a Map we use as a cache for codebases
--    private static final Map codeBaseCacheRef = new WeakHashMap();
--
--    /*
--     * Retuns the CodeBase for the given class.
--     */
--    static URL getCodeBase(final Class clazz) {
--        URL url = (URL)codeBaseCacheRef.get(clazz);
--        if (url == null) {
--            url = (URL)AccessController.doPrivileged(new PrivilegedAction() {
--                public Object run() {
--                    ProtectionDomain pd = clazz.getProtectionDomain();
--                    if (pd != null) {
--                        CodeSource cs = pd.getCodeSource();
--                        if (cs != null) {
--                            return cs.getLocation();
--                        }
--                    }
--                    return NULL_URL;
--                }
--            });
--            codeBaseCacheRef.put(clazz, url);
--        }
--        return (url == NULL_URL) ? null : url;
--    }
--
--    private static void setupJurisdictionPolicies() throws Exception {
--        String javaHomeDir = System.getProperty("java.home");
--        String sep = File.separator;
--        String pathToPolicyJar = javaHomeDir + sep + "lib" + sep +
--            "security" + sep;
--
--        File exportJar = new File(pathToPolicyJar, "US_export_policy.jar");
--        File importJar = new File(pathToPolicyJar, "local_policy.jar");
--        URL jceCipherURL = ClassLoader.getSystemResource
--                ("javax/crypto/Cipher.class");
--
--        if ((jceCipherURL == null) ||
--                !exportJar.exists() || !importJar.exists()) {
--            throw new SecurityException
--                                ("Cannot locate policy or framework files!");
--        }
--
--        // Read jurisdiction policies.
--        CryptoPermissions defaultExport = new CryptoPermissions();
--        CryptoPermissions exemptExport = new CryptoPermissions();
--        loadPolicies(exportJar, defaultExport, exemptExport);
--
--        CryptoPermissions defaultImport = new CryptoPermissions();
--        CryptoPermissions exemptImport = new CryptoPermissions();
--        loadPolicies(importJar, defaultImport, exemptImport);
--
--        // Merge the export and import policies for default applications.
--        if (defaultExport.isEmpty() || defaultImport.isEmpty()) {
--            throw new SecurityException("Missing mandatory jurisdiction " +
--                                        "policy files");
--        }
--        defaultPolicy = defaultExport.getMinimum(defaultImport);
--
--        // Merge the export and import policies for exempt applications.
--        if (exemptExport.isEmpty())  {
--            exemptPolicy = exemptImport.isEmpty() ? null : exemptImport;
--        } else {
--            exemptPolicy = exemptExport.getMinimum(exemptImport);
--        }
--    }
--
--    /**
--     * Load the policies from the specified file. Also checks that the
--     * policies are correctly signed.
--     */
--    private static void loadPolicies(File jarPathName,
--                                     CryptoPermissions defaultPolicy,
--                                     CryptoPermissions exemptPolicy)
--        throws Exception {
--
--        JarFile jf = new JarFile(jarPathName);
--
--        Enumeration entries = jf.entries();
--        while (entries.hasMoreElements()) {
--            JarEntry je = (JarEntry)entries.nextElement();
--            InputStream is = null;
--            try {
--                if (je.getName().startsWith("default_")) {
--                    is = jf.getInputStream(je);
--                    defaultPolicy.load(is);
--                } else if (je.getName().startsWith("exempt_")) {
--                    is = jf.getInputStream(je);
--                    exemptPolicy.load(is);
--                } else {
--                    continue;
--                }
--            } finally {
--                if (is != null) {
--                    is.close();
--                }
--            }
--
--            // Enforce the signer restraint, i.e. signer of JCE framework
--            // jar should also be the signer of the two jurisdiction policy
--            // jar files.
--            JarVerifier.verifyPolicySigned(je.getCertificates());
--        }
--        // Close and nullify the JarFile reference to help GC.
--        jf.close();
--        jf = null;
--    }
--
--    static CryptoPermissions getDefaultPolicy() {
--        return defaultPolicy;
--    }
--
--    static CryptoPermissions getExemptPolicy() {
--        return exemptPolicy;
--    }
--
--    static boolean isRestricted() {
--        return isRestricted;
-+        return true;
-     }
- }
-diff -Nru openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurityManager.java openjdk/jdk/src/share/classes/javax/crypto/JceSecurityManager.java
---- openjdk.orig/jdk/src/share/classes/javax/crypto/JceSecurityManager.java	2010-07-29 21:55:43.000000000 +0100
-+++ openjdk/jdk/src/share/classes/javax/crypto/JceSecurityManager.java	1970-01-01 01:00:00.000000000 +0100
-@@ -1,252 +0,0 @@
--/*
-- * Copyright (c) 1999, 2007, 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
-- * under the terms of the GNU General Public License version 2 only, as
-- * published by the Free Software Foundation.  Oracle designates this
-- * particular file as subject to the "Classpath" exception as provided
-- * by Oracle in the LICENSE file that accompanied this code.
-- *
-- * This code is distributed in the hope that it will be useful, but WITHOUT
-- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- * version 2 for more details (a copy is included in the LICENSE file that
-- * accompanied this code).
-- *
-- * You should have received a copy of the GNU General Public License version
-- * 2 along with this work; if not, write to the Free Software Foundation,
-- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-- *
-- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-- * or visit www.oracle.com if you need additional information or have any
-- * questions.
-- */
--
--package javax.crypto;
--
--import java.security.*;
--import java.net.*;
--import java.util.*;
--import java.util.jar.*;
--
--/**
-- * The JCE security manager.
-- *
-- * <p>The JCE security manager is responsible for determining the maximum
-- * allowable cryptographic strength for a given applet/application, for a given
-- * algorithm, by consulting the configured jurisdiction policy files and
-- * the cryptographic permissions bundled with the applet/application.
-- *
-- * <p>Note that this security manager is never installed, only instantiated.
-- *
-- * @author Jan Luehe
-- *
-- * @since 1.4
-- */
--
--final class JceSecurityManager extends SecurityManager {
--
--    private static final CryptoPermissions defaultPolicy;
--    private static final CryptoPermissions exemptPolicy;
--    private static final CryptoAllPermission allPerm;
--    private static final Vector TrustedCallersCache = new Vector(2);
--    private static final Map exemptCache = new HashMap();
--
--    // singleton instance
--    static final JceSecurityManager INSTANCE;
--
--    static {
--        defaultPolicy = JceSecurity.getDefaultPolicy();
--        exemptPolicy = JceSecurity.getExemptPolicy();
--        allPerm = CryptoAllPermission.INSTANCE;
--        INSTANCE = (JceSecurityManager)
--              AccessController.doPrivileged(new PrivilegedAction() {
--                  public Object run() {
--                      return new JceSecurityManager();
--                  }
--              });
--    }
--
--    private JceSecurityManager() {
--        // empty
--    }
--
--    /**
--     * Returns the maximum allowable crypto strength for the given
--     * applet/application, for the given algorithm.
--     */
--    CryptoPermission getCryptoPermission(String alg) {
--        // Need to convert to uppercase since the crypto perm
--        // lookup is case sensitive.
--        alg = alg.toUpperCase(Locale.ENGLISH);
--
--        // If CryptoAllPermission is granted by default, we return that.
--        // Otherwise, this will be the permission we return if anything goes
--        // wrong.
--        CryptoPermission defaultPerm = getDefaultPermission(alg);
--        if (defaultPerm == CryptoAllPermission.INSTANCE) {
--            return defaultPerm;
--        }
--
--        // Determine the codebase of the caller of the JCE API.
--        // This is the codebase of the first class which is not in
--        // javax.crypto.* packages.
--        // NOTE: javax.crypto.* package maybe subject to package
--        // insertion, so need to check its classloader as well.
--        Class[] context = getClassContext();
--        URL callerCodeBase = null;
--        int i;
--        for (i=0; i<context.length; i++) {
--            Class cls = context[i];
--            callerCodeBase = JceSecurity.getCodeBase(cls);
--            if (callerCodeBase != null) {
--                break;
--            } else {
--                if (cls.getName().startsWith("javax.crypto.")) {
--                    // skip jce classes since they aren't the callers
--                    continue;
--                }
--                // use default permission when the caller is system classes
--                return defaultPerm;
--            }
--        }
--
--        if (i == context.length) {
--            return defaultPerm;
--        }
--
--        CryptoPermissions appPerms;
--        synchronized (this.getClass()) {
--            if (exemptCache.containsKey(callerCodeBase)) {
--                appPerms = (CryptoPermissions)exemptCache.get(callerCodeBase);
--            } else {
--                appPerms = getAppPermissions(callerCodeBase);
--                exemptCache.put(callerCodeBase, appPerms);
--            }
--        }
--
--        if (appPerms == null) {
--            return defaultPerm;
--        }
--
--        // If the app was granted the special CryptoAllPermission, return that.
--        if (appPerms.implies(allPerm)) {
--            return allPerm;
--        }
--
--        // Check if the crypto permissions granted to the app contain a
--        // crypto permission for the requested algorithm that does not require
--        // any exemption mechanism to be enforced.
--        // Return that permission, if present.
--        PermissionCollection appPc = appPerms.getPermissionCollection(alg);
--        if (appPc == null) {
--            return defaultPerm;
--        }
--        Enumeration enum_ = appPc.elements();
--        while (enum_.hasMoreElements()) {
--            CryptoPermission cp = (CryptoPermission)enum_.nextElement();
--            if (cp.getExemptionMechanism() == null) {
--                return cp;
--            }
--        }
--
--        // Check if the jurisdiction file for exempt applications contains
--        // any entries for the requested algorithm.
--        // If not, return the default permission.
--        PermissionCollection exemptPc =
--            exemptPolicy.getPermissionCollection(alg);
--        if (exemptPc == null) {
--            return defaultPerm;
--        }
--
--        // In the jurisdiction file for exempt applications, go through the
--        // list of CryptoPermission entries for the requested algorithm, and
--        // stop at the first entry:
--        //  - that is implied by the collection of crypto permissions granted
--        //    to the app, and
--        //  - whose exemption mechanism is available from one of the
--        //    registered CSPs
--        enum_ = exemptPc.elements();
--        while (enum_.hasMoreElements()) {
--            CryptoPermission cp = (CryptoPermission)enum_.nextElement();
--            try {
--                ExemptionMechanism.getInstance(cp.getExemptionMechanism());
--                if (cp.getAlgorithm().equals(
--                                      CryptoPermission.ALG_NAME_WILDCARD)) {
--                    CryptoPermission newCp;
--                    if (cp.getCheckParam()) {
--                        newCp = new CryptoPermission(
--                                alg, cp.getMaxKeySize(),
--                                cp.getAlgorithmParameterSpec(),
--                                cp.getExemptionMechanism());
--                    } else {
--                        newCp = new CryptoPermission(
--                                alg, cp.getMaxKeySize(),
--                                cp.getExemptionMechanism());
--                    }
--                    if (appPerms.implies(newCp)) {
--                        return newCp;
--                    }
--                }
--
--                if (appPerms.implies(cp)) {
--                    return cp;
--                }
--            } catch (Exception e) {
--                continue;
--            }
--        }
--        return defaultPerm;
--    }
--
--    private static CryptoPermissions getAppPermissions(URL callerCodeBase) {
--        // Check if app is exempt, and retrieve the permissions bundled with it
--        try {
--            return JceSecurity.verifyExemptJar(callerCodeBase);
--        } catch (Exception e) {
--            // Jar verification fails
--            return null;
--        }
--
--    }
--
--    /**
--     * Returns the default permission for the given algorithm.
--     */
--    private CryptoPermission getDefaultPermission(String alg) {
--        Enumeration enum_ =
--            defaultPolicy.getPermissionCollection(alg).elements();
--        return (CryptoPermission)enum_.nextElement();
--    }
--
--    // See  bug 4341369 & 4334690 for more info.
--    boolean isCallerTrusted() {
--        // Get the caller and its codebase.
--        Class[] context = getClassContext();
--        URL callerCodeBase = null;
--        int i;
--        for (i=0; i<context.length; i++) {
--            callerCodeBase = JceSecurity.getCodeBase(context[i]);
--            if (callerCodeBase != null) {
--                break;
--            }
--        }
--        // The caller is in the JCE framework.
--        if (i == context.length) {
--            return true;
--        }
--        //The caller has been verified.
--        if (TrustedCallersCache.contains(context[i])) {
--            return true;
--        }
--        // Check whether the caller is a trusted provider.
--        try {
--            JceSecurity.verifyProviderJar(callerCodeBase);
--        } catch (Exception e2) {
--            return false;
--        }
--        TrustedCallersCache.addElement(context[i]);
--        return true;
--    }
--}
-diff -Nru openjdk.orig/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java openjdk/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java
---- openjdk.orig/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2010-07-29 21:56:21.000000000 +0100
-+++ openjdk/jdk/test/com/sun/crypto/provider/Cipher/UTIL/TestUtil.java	2010-09-01 10:37:32.934684089 +0100
-@@ -44,18 +44,9 @@
-         }
-     }
- 
--    private static boolean isUnlimitedPolicy() throws IOException {
-+    private static boolean isUnlimitedPolicy() {
-         if (instance == null) {
--            String jreDir = System.getProperty("java.home");
--            String localPolicyPath = jreDir + File.separator + "lib" +
--                File.separator + "security" + File.separator +
--                "local_policy.jar";
--            JarFile localPolicy = new JarFile(localPolicyPath);
--            if (localPolicy.getEntry("exempt_local.policy") == null) {
--                return true;
--            } else {
--                return false;
--            }
-+            return true;
-         } else {
-             return instance.isUnlimited;
-         }
--- a/patches/icedtea-demos.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
---- openjdkb18/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2007-08-16 03:33:19.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2007-08-23 16:12:59.000000000 -0400
-@@ -43,7 +43,7 @@
- 
- # Source lists
- LIBNAME=gctest
--SOURCES=gctest.c ../agent_util/agent_util.c
-+SOURCES=gctest.c ../../agent_util/src/agent_util.c
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -89,7 +89,7 @@
-     # Object files needed to create library
-     OBJECTS=$(SOURCES:%.c=%.o)
-     # Library name and options needed to build it
--    LIBRARY=lib$(LIBNAME).so
-+    LIBRARY=../lib/lib$(LIBNAME).so
-     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
-     # Libraries we are dependent on
-     LIBRARIES=-lc
-@@ -122,7 +122,7 @@
- 
- # Common -I options
- CFLAGS += -I.
--CFLAGS += -I../agent_util
-+CFLAGS += -I../../agent_util/src
- CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
- 
- # Default rule
---- openjdkb18/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2007-08-16 03:33:20.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2007-08-24 15:15:40.000000000 -0400
-@@ -41,13 +41,15 @@
- #
- ########################################################################
- 
-+JAVA_CRW_DEMO=../../java_crw_demo/src/libjava_crw_demo.so
-+
- # Source lists
- LIBNAME=heapTracker
--SOURCES=heapTracker.c ../agent_util/agent_util.c
-+SOURCES=heapTracker.c ../../agent_util/src/agent_util.c
- JAVA_SOURCES=HeapTracker.java
- 
- # Name of jar file that needs to be created
--JARFILE=heapTracker.jar
-+JARFILE=../heapTracker.jar
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -93,10 +95,10 @@
-     # Object files needed to create library
-     OBJECTS=$(SOURCES:%.c=%.o)
-     # Library name and options needed to build it
--    LIBRARY=lib$(LIBNAME).so
-+    LIBRARY=../lib/lib$(LIBNAME).so
-     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
-     # Libraries we are dependent on
--    LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
-+    LIBRARIES=-L../../java_crw_demo/src/ -ljava_crw_demo -lc
-     # Building a shared library
-     LINK_SHARED=$(LINK.c) -shared -o $@
- endif
-@@ -128,15 +130,18 @@
- 
- # Common -I options
- CFLAGS += -I.
--CFLAGS += -I../agent_util
--CFLAGS += -I../java_crw_demo
-+CFLAGS += -I../../agent_util/src
-+CFLAGS += -I../../java_crw_demo/src
- CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
- 
- # Default rule (build both native library and jar file)
- all: $(LIBRARY) $(JARFILE)
- 
-+$(JAVA_CRW_DEMO):
-+	make JDK=$(JDK) OSNAME=$(OSNAME) -C ../../java_crw_demo/src -f sample.makefile.txt
-+
- # Build native library
--$(LIBRARY): $(OBJECTS)
-+$(LIBRARY): $(OBJECTS) $(JAVA_CRW_DEMO)
- 	$(LINK_SHARED) $(OBJECTS) $(LIBRARIES)
- 
- # Build jar file
---- openjdkb18/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2007-08-16 03:33:20.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2007-08-23 16:13:00.000000000 -0400
-@@ -43,7 +43,7 @@
- 
- # Source lists
- LIBNAME=heapViewer
--SOURCES=heapViewer.c ../agent_util/agent_util.c
-+SOURCES=heapViewer.c ../../agent_util/src/agent_util.c
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -89,7 +89,7 @@
-     # Object files needed to create library
-     OBJECTS=$(SOURCES:%.c=%.o)
-     # Library name and options needed to build it
--    LIBRARY=lib$(LIBNAME).so
-+    LIBRARY=../lib/lib$(LIBNAME).so
-     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
-     # Libraries we are dependent on
-     LIBRARIES=-lc
-@@ -123,6 +123,7 @@
- # Common -I options
- CFLAGS += -I.
- CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
-+CFLAGS += -I../../agent_util/src
- 
- # Default rule
- all: $(LIBRARY)
---- openjdkb18/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2007-08-23 16:12:58.000000000 -0400
-@@ -73,7 +73,7 @@
- JAVA_SOURCES=Tracker.java
- 
- # Name of jar file that needs to be created
--#JARFILE=hprof.jar
-+JARFILE=../hprof.jar
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -110,7 +110,7 @@
- # Linux GNU C Compiler
- ifeq ($(OSNAME), linux)
-     # GNU Compiler options needed to build it
--    COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer
-+    COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer -DSKIP_NPT
-     # Options that help find errors
-     COMMON_FLAGS+= -W -Wall  -Wno-unused -Wno-parentheses
-     # To allow access to dladdr()
-@@ -166,7 +166,7 @@
- 
- # Common -I options
- CFLAGS += -I.
--CFLAGS += -I../java_crw_demo
-+CFLAGS += -I../../java_crw_demo/src
- CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
- 
- # Default rule (build both native library and jar file)
---- openjdkb18/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2007-08-24 15:16:17.000000000 -0400
-@@ -41,13 +41,15 @@
- #
- ########################################################################
- 
-+JAVA_CRW_DEMO=../../java_crw_demo/src/libjava_crw_demo.so
-+
- # Source lists
- LIBNAME=minst
--SOURCES=minst.c ../agent_util/agent_util.c
-+SOURCES=minst.c ../../agent_util/src/agent_util.c
- JAVA_SOURCES=Minst.java
- 
- # Name of jar file that needs to be created
--JARFILE=minst.jar
-+JARFILE=../minst.jar
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -93,10 +95,10 @@
-     # Object files needed to create library
-     OBJECTS=$(SOURCES:%.c=%.o)
-     # Library name and options needed to build it
--    LIBRARY=lib$(LIBNAME).so
-+    LIBRARY=../lib/lib$(LIBNAME).so
-     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
-     # Libraries we are dependent on
--    LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
-+    LIBRARIES=-L../../java_crw_demo/src/ -ljava_crw_demo -lc
-     # Building a shared library
-     LINK_SHARED=$(LINK.c) -shared -o $@
- endif
-@@ -128,15 +130,18 @@
- 
- # Common -I options
- CFLAGS += -I.
--CFLAGS += -I../agent_util
--CFLAGS += -I../java_crw_demo
-+CFLAGS += -I../../agent_util/src
-+CFLAGS += -I../../java_crw_demo/src
- CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
- 
- # Default rule (build both native library and jar file)
- all: $(LIBRARY) $(JARFILE)
- 
-+$(JAVA_CRW_DEMO):	
-+	make JDK=$(JDK) OSNAME=$(OSNAME) -C ../../java_crw_demo/src -f sample.makefile.txt
-+
- # Build native library
--$(LIBRARY): $(OBJECTS)
-+$(LIBRARY): $(OBJECTS) $(JAVA_CRW_DEMO)
- 	$(LINK_SHARED) $(OBJECTS) $(LIBRARIES)
- 
- # Build jar file
---- openjdkb18/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2007-08-24 15:16:01.000000000 -0400
-@@ -41,13 +41,15 @@
- #
- ########################################################################
- 
-+JAVA_CRW_DEMO=../../java_crw_demo/src/libjava_crw_demo.so
-+
- # Source lists
- LIBNAME=mtrace
--SOURCES=mtrace.c ../agent_util/agent_util.c
-+SOURCES=mtrace.c ../../agent_util/src/agent_util.c
- JAVA_SOURCES=Mtrace.java
- 
- # Name of jar file that needs to be created
--JARFILE=mtrace.jar
-+JARFILE=../mtrace.jar
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -93,10 +95,11 @@
-     # Object files needed to create library
-     OBJECTS=$(SOURCES:%.c=%.o)
-     # Library name and options needed to build it
--    LIBRARY=lib$(LIBNAME).so
-+    LIBRARY=../lib/lib$(LIBNAME).so
-     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
-     # Libraries we are dependent on
--    LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
-+    LIBRARIES=-L../../java_crw_demo/src -ljava_crw_demo -lc
-+
-     # Building a shared library
-     LINK_SHARED=$(LINK.c) -shared -o $@
- endif
-@@ -128,15 +131,18 @@
- 
- # Common -I options
- CFLAGS += -I.
--CFLAGS += -I../agent_util
--CFLAGS += -I../java_crw_demo
-+CFLAGS += -I../../agent_util/src
-+CFLAGS += -I../../java_crw_demo/src
- CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
- 
- # Default rule (build both native library and jar file)
- all: $(LIBRARY) $(JARFILE)
- 
-+$(JAVA_CRW_DEMO):
-+	make JDK=$(JDK) OSNAME=$(OSNAME) -C ../../java_crw_demo/src -f sample.makefile.txt
-+
- # Build native library
--$(LIBRARY): $(OBJECTS)
-+$(LIBRARY): $(OBJECTS) $(JAVA_CRW_DEMO)
- 	$(LINK_SHARED) $(OBJECTS) $(LIBRARIES)
- 
- # Build jar file
---- openjdkb18/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2007-08-23 16:12:58.000000000 -0400
-@@ -43,7 +43,7 @@
- 
- # Source lists
- LIBNAME=versionCheck
--SOURCES=versionCheck.c ../agent_util/agent_util.c
-+SOURCES=versionCheck.c ../../agent_util/src/agent_util.c
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -89,7 +89,7 @@
-     # Object files needed to create library
-     OBJECTS=$(SOURCES:%.c=%.o)
-     # Library name and options needed to build it
--    LIBRARY=lib$(LIBNAME).so
-+    LIBRARY=../lib/lib$(LIBNAME).so
-     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
-     # Libraries we are dependent on
-     LIBRARIES=-lc
-@@ -122,7 +122,7 @@
- 
- # Common -I options
- CFLAGS += -I.
--CFLAGS += -I../agent_util
-+CFLAGS += -I../../agent_util/src
- CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
- 
- # Default rule
---- openjdkb18/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2007-08-16 03:33:21.000000000 -0400
-+++ openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2007-08-23 16:13:06.000000000 -0400
-@@ -43,7 +43,7 @@
- 
- # Source lists
- LIBNAME=waiters
--SOURCES=waiters.cpp Agent.cpp Thread.cpp Monitor.cpp ../agent_util/agent_util.c
-+SOURCES=waiters.cpp Agent.cpp Thread.cpp Monitor.cpp
- 
- # Solaris Sun C Compiler Version 5.5
- ifeq ($(OSNAME), solaris)
-@@ -89,9 +89,10 @@
-     endif
-     # Object files needed to create library
-     OBJECTS=$(SOURCES:%.cpp=%.o)
-+    OBJECTS+=../../agent_util/src/agent_util.o
-     # Library name and options needed to build it
--    LIBRARY=lib$(LIBNAME).so
--    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
-+    LIBRARY=../lib/lib$(LIBNAME).so
-+    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
-     # Libraries we are dependent on
-     LIBRARIES=
-     # Building a shared library
-@@ -123,9 +124,10 @@
- 
- # Common -I options
- CXXFLAGS += -I.
--CXXFLAGS += -I../agent_util
-+CXXFLAGS += -I../../agent_util/src
- CXXFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
- 
-+CFLAGS = $(CXXFLAGS)
- # Default rule
- all: $(LIBRARY)
- 
--- a/patches/icedtea-disable-intree-ec.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security openjdk/jdk/src/share/lib/security/java.security
---- openjdk.orig/jdk/src/share/lib/security/java.security	2009-09-10 19:04:25.000000000 +0100
-+++ openjdk/jdk/src/share/lib/security/java.security	2009-09-11 14:53:07.000000000 +0100
-@@ -45,13 +45,12 @@
- #
- security.provider.1=sun.security.provider.Sun
- security.provider.2=sun.security.rsa.SunRsaSign
--security.provider.3=sun.security.ec.SunEC
--security.provider.4=com.sun.net.ssl.internal.ssl.Provider
--security.provider.5=com.sun.crypto.provider.SunJCE
--security.provider.6=sun.security.jgss.SunProvider
--security.provider.7=com.sun.security.sasl.Provider
--security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
--security.provider.9=sun.security.smartcardio.SunPCSC
-+security.provider.3=com.sun.net.ssl.internal.ssl.Provider
-+security.provider.4=com.sun.crypto.provider.SunJCE
-+security.provider.5=sun.security.jgss.SunProvider
-+security.provider.6=com.sun.security.sasl.Provider
-+security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
-+security.provider.8=sun.security.smartcardio.SunPCSC
- 
- #
- # Select the source of seed data for SecureRandom. By default an
--- a/patches/icedtea-gcc-suffix.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
---- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2011-03-29 14:22:49.000000000 +0100
-+++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2011-03-29 23:34:00.169408541 +0100
-@@ -54,8 +54,8 @@
- ifeq ($(PLATFORM), linux)
- 
-   # Settings specific to Linux
--  CC             = $(COMPILER_PATH)gcc
--  CPP            = $(COMPILER_PATH)gcc -E
-+  CC             = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
-+  CPP            = $(COMPILER_PATH)gcc$(GCC_SUFFIX) -E
-   # statically link libstdc++ before C++ ABI is stablized on Linux
-   ifneq ($(STATIC_CXX),false)
-     STATIC_CXX     = true
-@@ -64,9 +64,9 @@
-     # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
-     # We need to use gcc to statically link the C++ runtime. gcc and g++ use
-     # the same subprocess to compile C++ files, so it is OK to build using gcc.
--    CXX            = $(COMPILER_PATH)gcc
-+    CXX            = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
-   else
--    CXX            = $(COMPILER_PATH)g++
-+    CXX            = $(COMPILER_PATH)g++$(GCC_SUFFIX)
-   endif
-   # Option used to create a shared library
-   SHARED_LIBRARY_FLAG = -shared -mimpure-text
--- a/patches/icedtea-headers.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/sun/font/Makefile openjdk/jdk/make/sun/font/Makefile
---- openjdk.orig/jdk/make/sun/font/Makefile	2010-02-12 08:15:45.000000000 +0000
-+++ openjdk/jdk/make/sun/font/Makefile	2010-02-19 18:26:43.000000000 +0000
-@@ -129,7 +129,7 @@
-   ifeq ($(USING_SYSTEM_FT_LIB), false)
-     FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX).6
-   endif
--  OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype
-+  OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) $(FT2_LIB)
- endif 
- 
- library:: $(FREETYPE_LIB)
-@@ -159,11 +159,13 @@
- #
- CFLAGS       += -DHEADLESS
- CXXFLAGS     += -DHEADLESS
-+FREETYPE_HEADERS=$(shell $(ECHO) \"$(FREETYPE2_HEADERS)\" | grep -o .I.*[a\-z])
- 
- ifndef OPENJDK
-   CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
- else
--  CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
-+  CPPFLAGS += $(FREETYPE_HEADERS) $(FREETYPE_HEADERS)/freetype2 \
-+	-I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
- endif
- 
- ifeq ($(PLATFORM), windows)
-diff -Nru openjdk.orig/jdk/make/tools/freetypecheck/Makefile openjdk/jdk/make/tools/freetypecheck/Makefile
---- openjdk.orig/jdk/make/tools/freetypecheck/Makefile	2009-12-04 23:26:49.000000000 +0000
-+++ openjdk/jdk/make/tools/freetypecheck/Makefile	2010-02-19 18:08:00.000000000 +0000
-@@ -50,7 +50,7 @@
-   ifeq ($(PLATFORM), solaris)
-     FT_LD_OPTIONS += -R $(FREETYPE_LIB_PATH) -lfreetype
-   else #linux
--      FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) -lfreetype
-+      FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) $(FT2_LIB)
-   endif
- endif
- FT_OPTIONS += -I$(FREETYPE_HEADERS_PATH)
--- a/patches/icedtea-hotspot-gcc-pr36917.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
---- openjdk/hotspot/make/linux/makefiles/i486.make~	2008-07-10 22:04:18.000000000 +0200
-+++ openjdk/hotspot/make/linux/makefiles/i486.make	2008-07-24 12:23:11.344839305 +0200
-@@ -34,3 +34,6 @@
- CFLAGS += -DVM_LITTLE_ENDIAN
- 
- OPT_CFLAGS/compactingPermGenGen.o = -O1
-+
-+# GCC PR tree-optimization/36917
-+OPT_CFLAGS/ciTypeFlow.o += $(OPT_CFLAGS) -fno-ivopts
--- a/patches/icedtea-javafiles.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2010-07-29 21:54:09.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2011-03-16 20:45:33.914471077 +0000
-@@ -62,7 +62,6 @@
- 	com/sun/corba/se/impl/encoding/TypeCodeInputStream.java \
- 	com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java \
- 	com/sun/corba/se/impl/encoding/TypeCodeReader.java \
--	com/sun/corba/se/impl/encoding/WrapperInputStream.java
--
--
--
-+	com/sun/corba/se/impl/encoding/WrapperInputStream.java \
-+	com/sun/corba/se/impl/encoding/IDLJavaSerializationInputStream.java \
-+	com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java
-diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2010-07-29 21:54:09.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2011-03-16 20:45:33.922471207 +0000
-@@ -66,4 +66,5 @@
- 	com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java \
- 	com/sun/corba/se/impl/ior/iiop/MaxStreamFormatVersionComponentImpl.java \
- 	com/sun/corba/se/impl/ior/iiop/RequestPartitioningComponentImpl.java \
--	com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java
-+	com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java \
-+	com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java
-diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2010-07-29 21:54:09.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2011-03-16 20:45:33.922471207 +0000
-@@ -81,4 +81,5 @@
- 	com/sun/corba/se/impl/orbutil/graph/Node.java \
- 	com/sun/corba/se/impl/orbutil/graph/NodeData.java \
- 	com/sun/corba/se/impl/orbutil/graph/Graph.java \
--	com/sun/corba/se/impl/orbutil/graph/GraphImpl.java 
-+	com/sun/corba/se/impl/orbutil/graph/GraphImpl.java \
-+	com/sun/corba/se/impl/orbutil/GetPropertyAction.java
-diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2010-07-29 21:54:09.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2011-03-16 20:45:33.922471207 +0000
-@@ -81,5 +81,5 @@
- 	com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_1.java \
- 	com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_2.java \
- 	com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddress.java \
--	com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java
--
-+	com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java \
-+	com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyOrReplyMessage.java
-diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2010-07-29 21:54:09.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2011-03-16 20:45:33.922471207 +0000
-@@ -30,6 +30,7 @@
- 	com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java \
- 	com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java \
- 	com/sun/corba/se/spi/monitoring/MonitoringFactories.java \
-+	com/sun/corba/se/spi/monitoring/MonitoringConstants.java \
- 	com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java \
- 	com/sun/corba/se/spi/monitoring/MonitoredObject.java \
- 	com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java \
-diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk
---- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2010-07-29 21:54:09.000000000 +0100
-+++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2011-03-16 20:45:33.922471207 +0000
-@@ -29,5 +29,6 @@
- 	com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java \
- 	com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java \
- 	com/sun/corba/se/spi/presentation/rmi/PresentationManager.java \
-+	com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java \
- 	com/sun/corba/se/spi/presentation/rmi/StubAdapter.java
- 
-diff -Nru openjdk.orig/jdk/make/java/java/FILES_java.gmk openjdk/jdk/make/java/java/FILES_java.gmk
---- openjdk.orig/jdk/make/java/java/FILES_java.gmk	2011-03-14 22:10:30.000000000 +0000
-+++ openjdk/jdk/make/java/java/FILES_java.gmk	2011-03-16 20:45:33.922471207 +0000
-@@ -29,6 +29,80 @@
- # will generate header files
- #
- JAVA_JAVA_java = \
-+    java/lang/reflect/AccessibleObject.java \
-+    java/lang/reflect/AnnotatedElement.java \
-+    java/lang/reflect/Array.java \
-+    java/lang/reflect/Constructor.java \
-+    java/lang/reflect/Field.java \
-+    java/lang/reflect/GenericArrayType.java \
-+    java/lang/reflect/GenericDeclaration.java \
-+    java/lang/reflect/GenericSignatureFormatError.java \
-+    java/lang/reflect/InvocationHandler.java \
-+    java/lang/reflect/InvocationTargetException.java \
-+    java/lang/reflect/MalformedParameterizedTypeException.java \
-+    java/lang/reflect/Member.java \
-+    java/lang/reflect/Method.java \
-+    java/lang/reflect/Modifier.java \
-+    java/lang/reflect/package-info.java \
-+    java/lang/reflect/ParameterizedType.java \
-+    java/lang/reflect/Proxy.java \
-+    java/lang/reflect/ReflectAccess.java \
-+    java/lang/reflect/ReflectPermission.java \
-+    java/lang/reflect/Type.java \
-+    java/lang/reflect/TypeVariable.java \
-+    java/lang/reflect/UndeclaredThrowableException.java \
-+    java/lang/reflect/WildcardType.java \
-+    java/lang/ref/Finalizer.java \
-+    java/lang/ref/FinalReference.java \
-+    java/lang/ref/PhantomReference.java \
-+    java/lang/ref/Reference.java \
-+    java/lang/ref/ReferenceQueue.java \
-+    java/lang/ref/SoftReference.java \
-+    java/lang/ref/WeakReference.java \
-+    java/lang/management/ClassLoadingMXBean.java \
-+    java/lang/management/CompilationMXBean.java \
-+    java/lang/management/GarbageCollectorMXBean.java \
-+    java/lang/management/LockInfo.java \
-+    java/lang/management/ManagementFactory.java \
-+    java/lang/management/ManagementPermission.java \
-+    java/lang/management/MemoryManagerMXBean.java \
-+    java/lang/management/MemoryMXBean.java \
-+    java/lang/management/MemoryNotificationInfo.java \
-+    java/lang/management/MemoryPoolMXBean.java \
-+    java/lang/management/MemoryType.java \
-+    java/lang/management/MemoryUsage.java \
-+    java/lang/management/MonitorInfo.java \
-+    java/lang/management/OperatingSystemMXBean.java \
-+    java/lang/management/RuntimeMXBean.java \
-+    java/lang/management/ThreadInfo.java \
-+    java/lang/management/ThreadMXBean.java \
-+    java/lang/instrument/ClassDefinition.java \
-+    java/lang/instrument/ClassFileTransformer.java \
-+    java/lang/instrument/IllegalClassFormatException.java \
-+    java/lang/instrument/Instrumentation.java \
-+    java/lang/instrument/UnmodifiableClassException.java \
-+    java/lang/annotation/AnnotationFormatError.java \
-+    java/lang/annotation/Annotation.java \
-+    java/lang/annotation/AnnotationTypeMismatchException.java \
-+    java/lang/annotation/Documented.java \
-+    java/lang/annotation/ElementType.java \
-+    java/lang/annotation/IncompleteAnnotationException.java \
-+    java/lang/annotation/Inherited.java \
-+    java/lang/annotation/package-info.java \
-+    java/lang/annotation/Retention.java \
-+    java/lang/annotation/RetentionPolicy.java \
-+    java/lang/annotation/Target.java \
-+    java/io/IOError.java \
-+    java/lang/Deprecated.java \
-+    java/lang/Iterable.java \
-+    java/util/RandomAccess.java \
-+    java/lang/CharacterData00.java \
-+    java/lang/CharacterData01.java \
-+    java/lang/CharacterData02.java \
-+    java/lang/CharacterData0E.java \
-+    java/lang/CharacterDataLatin1.java \
-+    java/lang/CharacterDataPrivateUse.java \
-+    java/lang/CharacterDataUndefined.java \
-     java/lang/Object.java \
-     java/lang/AutoCloseable.java \
-     java/lang/Class.java \
-@@ -139,13 +213,6 @@
-     java/lang/Override.java \
-     java/lang/SafeVarargs.java \
-     java/lang/SuppressWarnings.java \
--    java/lang/ref/Reference.java \
--        java/lang/ref/SoftReference.java \
--	java/lang/ref/WeakReference.java \
--	java/lang/ref/FinalReference.java \
--	java/lang/ref/PhantomReference.java \
--    java/lang/ref/ReferenceQueue.java \
--    java/lang/ref/Finalizer.java \
-     java/util/BitSet.java \
-     java/util/Calendar.java \
-         java/util/GregorianCalendar.java \
--- a/patches/icedtea-jpegclasses.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,647 +0,0 @@
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java	2008-03-31 18:04:57.000000000 -0400
-@@ -0,0 +1,51 @@
-+/* ImageFormatException.java
-+   Copyright (C) 2007 Matthew Flaschen
-+
-+   This file is part of IcedTea
-+
-+   IcedTea is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   IcedTea is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+package com.sun.image.codec.jpeg;
-+
-+public class ImageFormatException extends RuntimeException
-+{
-+	public ImageFormatException()
-+	{
-+		this("");
-+	}
-+
-+	public ImageFormatException(String s)
-+	{
-+		super(s);
-+	}
-+}
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java	2008-03-31 18:04:57.000000000 -0400
-@@ -0,0 +1,146 @@
-+/* JPEGCodec.java -- 
-+   Copyright (C) 2007 Free Software Foundation, Inc.
-+   Copyright (C) 2007 Matthew Flaschen
-+
-+   This file is part of GNU Classpath.
-+
-+   GNU Classpath is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   GNU Classpath is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+package com.sun.image.codec.jpeg;
-+
-+import java.io.InputStream;
-+import java.io.OutputStream;
-+import java.io.IOException;
-+
-+import java.awt.image.BufferedImage;
-+import java.awt.image.Raster;
-+
-+import javax.imageio.*;
-+import javax.imageio.stream.*;
-+import javax.imageio.plugins.jpeg.*;
-+
-+import java.util.Iterator;
-+
-+public class JPEGCodec
-+{
-+
-+	public static JPEGImageDecoder createJPEGDecoder(InputStream is)
-+	{
-+		return new ImageIOJPEGImageDecoder(is);
-+	}
-+
-+	public static JPEGImageEncoder createJPEGEncoder(OutputStream os)
-+	{
-+		return null;
-+	}
-+
-+	public static JPEGImageDecoder createJPEGDecoder(InputStream src, JPEGDecodeParam jdp)
-+	{
-+		return null; 
-+	}
-+        
-+	public static JPEGImageEncoder createJPEGEncoder(OutputStream dest, JPEGEncodeParam jep)
-+	{
-+		return null;
-+	}
-+        
-+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi)
-+	{
-+		return null;
-+	}
-+        
-+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands, int colorID)
-+	{
-+		return null;
-+	}
-+		
-+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam jdp)
-+	{
-+		return null;
-+	}
-+        
-+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras, int colorID)
-+	{
-+		return null;
-+	}
-+        
-+
-+	private static class ImageIOJPEGImageDecoder implements JPEGImageDecoder
-+	{
-+		
-+		private static final String JPGMime = "image/jpeg";
-+    
-+		private ImageReader JPGReader;
-+		
-+		private InputStream in;
-+		
-+		private ImageIOJPEGImageDecoder (InputStream newIs)
-+		{
-+			in = newIs;
-+			
-+			Iterator<ImageReader> JPGReaderIter = ImageIO.getImageReadersByMIMEType(JPGMime);
-+			if(JPGReaderIter.hasNext())
-+			{
-+				JPGReader  = JPGReaderIter.next();
-+			}
-+			
-+			JPGReader.setInput(new MemoryCacheImageInputStream(in));
-+		}
-+
-+		public BufferedImage decodeAsBufferedImage() throws IOException, ImageFormatException
-+		{
-+			return JPGReader.read(0);
-+		}
-+		
-+		public Raster decodeAsRaster() throws IOException, ImageFormatException
-+		{
-+			return JPGReader.readRaster(0, null);
-+		}
-+		
-+		public InputStream getInputStream()
-+		{
-+			return in;
-+		}
-+		
-+		public JPEGDecodeParam getJPEGDecodeParam()
-+		{
-+			return null;
-+		}
-+
-+		public void setJPEGDecodeParam(JPEGDecodeParam jdp)
-+		{
-+			return;
-+		}
-+
-+	}
-+}
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java	2008-03-31 18:04:57.000000000 -0400
-@@ -0,0 +1,50 @@
-+/* JPEGImageDecoder.java -- 
-+   Copyright (C) 2007 Free Software Foundation, Inc.
-+   Copyright (C) 2007 Matthew Flaschen
-+
-+   This file is part of GNU Classpath.
-+
-+   GNU Classpath is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   GNU Classpath is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+package com.sun.image.codec.jpeg;
-+
-+public interface JPEGDecodeParam
-+{
-+
-+  public static final int COLOR_ID_UNKNOWN = 0;
-+  public static final int COLOR_ID_RGBA = 1;
-+  public static final int COLOR_ID_RGB = 2;
-+  public static final int COLOR_ID_GRAY = 3;
-+  public static final int COLOR_ID_YCbCrA = 4;
-+  public static final int COLOR_ID_YCbCr = 5;
-+}
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java	2008-03-31 18:04:57.000000000 -0400
-@@ -0,0 +1,139 @@
-+/* JPEGEncodeParam.java -- 
-+   Copyright (C) 2007 Free Software Foundation, Inc.
-+
-+   This file is part of GNU Classpath.
-+
-+   GNU Classpath is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   GNU Classpath is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+package com.sun.image.codec.jpeg;
-+
-+public class JPEGEncodeParam
-+{
-+	public static final int COLOR_ID_UNKNOWN = 0;
-+	public static final int COLOR_ID_RGBA = 1;
-+	public static final int COLOR_ID_RGB = 2;
-+	public static final int COLOR_ID_GRAY = 3;
-+	public static final int COLOR_ID_YCbCrA = 4;
-+	public static final int COLOR_ID_CMYK = 5;
-+	public static final int COLOR_ID_YCbCr = 6;
-+
-+	public JPEGEncodeParam()
-+	{
-+	}
-+
-+	public void setQuality(float i, boolean b)
-+        {
-+        }	
-+
-+	public void setQuality(int i, boolean b)
-+	{
-+	}
-+
-+	public JPEGEncodeParam clone()
-+	{
-+	  return null;
-+	}
-+
-+	public void setTableInfoValid(boolean b)
-+	{
-+	}
-+
-+	public void setImageInfoValid(boolean b)
-+	{
-+	}
-+
-+	public int getHorizontalSubsampling(int i)
-+	{
-+	  return 0;
-+	}
-+
-+	public int getVerticalSubsampling(int i)
-+        {
-+          return 0;
-+        }
-+
-+	public int getWidth()
-+	{
-+	  return 0;
-+	}
-+
-+	public int getHeight()
-+	{
-+	  return 0;
-+	}
-+
-+	public int getDensityUnit()
-+        {
-+          return 0;
-+        }
-+
-+        public int getXDensity()
-+        {
-+          return 0;
-+        }
-+
-+        public int getYDensity()
-+        {
-+          return 0;
-+        }
-+
-+        public int getRestartInterval()
-+        {
-+          return 0;
-+        }
-+
-+        public JPEGQTable getQTable(int i)
-+        {
-+          return new JPEGQTable();
-+        }	
-+
-+	public void setDensityUnit(int i)
-+	{
-+	}
-+
-+	public void setXDensity(int i)
-+	{
-+	}
-+
-+	public void setYDensity(int i)
-+	{
-+	}
-+
-+	public void setRestartInterval(int i)
-+	{
-+	}
-+
-+	public void setQTable(int i, JPEGQTable jqt)
-+	{
-+	}
-+}
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java	2008-03-31 18:04:57.000000000 -0400
-@@ -0,0 +1,60 @@
-+/* JPEGImageDecoder.java -- 
-+   Copyright (C) 2007 Free Software Foundation, Inc.
-+   Copyright (C) 2007 Matthew Flaschen
-+
-+   This file is part of GNU Classpath.
-+
-+   GNU Classpath is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   GNU Classpath is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+
-+package com.sun.image.codec.jpeg;
-+import java.awt.image.BufferedImage;
-+import java.awt.image.Raster;
-+
-+import java.io.InputStream;
-+import java.io.IOException;
-+
-+
-+public interface JPEGImageDecoder
-+{
-+
-+	public BufferedImage decodeAsBufferedImage() throws IOException, ImageFormatException;
-+	
-+	public Raster decodeAsRaster() throws IOException, ImageFormatException;
-+	
-+	public InputStream getInputStream();
-+
-+	public JPEGDecodeParam getJPEGDecodeParam();
-+
-+	public void setJPEGDecodeParam(JPEGDecodeParam jdp);
-+}
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java	2008-03-31 18:04:57.000000000 -0400
-@@ -0,0 +1,67 @@
-+/* JPEGImageEncoder.java -- 
-+   Copyright (C) 2007 Free Software Foundation, Inc.
-+
-+   This file is part of GNU Classpath.
-+
-+   GNU Classpath is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   GNU Classpath is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+package com.sun.image.codec.jpeg;
-+
-+import com.sun.image.codec.jpeg.*;
-+import java.awt.image.BufferedImage;
-+import java.awt.image.Raster;
-+
-+public class JPEGImageEncoder
-+{
-+	public JPEGImageEncoder()
-+	{
-+	}
-+	
-+	public JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi)
-+	{
-+		return null;
-+	}
-+
-+	public void encode(BufferedImage bi, JPEGEncodeParam p)
-+	{
-+	}
-+
-+	public void encode(Raster bi)
-+        {
-+        }
-+
-+	public void encode(BufferedImage bi)
-+        {
-+        }
-+
-+}
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java	2008-03-31 18:04:57.000000000 -0400
-@@ -0,0 +1,44 @@
-+/* JPEGQTable.java -- 
-+   Copyright (C) 2007 Free Software Foundation, Inc.
-+   Copyright (C) 2007 Matthew Flaschen
-+
-+   This file is part of GNU Classpath.
-+
-+   GNU Classpath is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   GNU Classpath is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+package com.sun.image.codec.jpeg;
-+
-+public class JPEGQTable
-+{
-+
-+}
-diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java
---- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java	1969-12-31 19:00:00.000000000 -0500
-+++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java	2008-03-31 19:38:37.000000000 -0400
-@@ -0,0 +1,58 @@
-+/* TruncatedFileException.java
-+   Copyright (C) 2007 Matthew Flaschen
-+
-+   This file is part of IcedTea
-+
-+   IcedTea is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   IcedTea is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with GNU Classpath; see the file COPYING.  If not, write to the
-+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+   02110-1301 USA.
-+
-+   Linking this library statically or dynamically with other modules is
-+   making a combined work based on this library.  Thus, the terms and
-+   conditions of the GNU General Public License cover the whole
-+   combination.
-+
-+   As a special exception, the copyright holders of this library give you
-+   permission to link this library with independent modules to produce an
-+   executable, regardless of the license terms of these independent
-+   modules, and to copy and distribute the resulting executable under
-+   terms of your choice, provided that you also meet, for each linked
-+   independent module, the terms and conditions of the license of that
-+   module.  An independent module is a module which is not derived from
-+   or based on this library.  If you modify this library, you may extend
-+   this exception to your version of the library, but you are not
-+   obligated to do so.  If you do not wish to do so, delete this
-+   exception statement from your version. */
-+
-+package com.sun.image.codec.jpeg;
-+
-+import java.awt.image.BufferedImage;
-+
-+public class TruncatedFileException extends RuntimeException
-+{
-+	public TruncatedFileException()
-+	{
-+		this("");
-+	}
-+
-+	public TruncatedFileException(String s)
-+	{
-+		super(s);
-+	}
-+
-+	public BufferedImage getBufferedImage()
-+	{
-+	  return null;
-+	}
-+}
--- a/patches/icedtea-jvmtiEnv.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp.old	2009-02-26 17:18:35.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp	2009-02-26 17:16:59.000000000 +0000
-@@ -2702,6 +2702,9 @@
-   (*entry_count_ptr) = num_entries;
-   (*table_ptr) = jvmti_table;
- 
-+  if (num_entries == 0)
-+    return JVMTI_ERROR_ABSENT_INFORMATION;
-+
-   return JVMTI_ERROR_NONE;
- } /* end GetLineNumberTable */
- 
--- a/patches/icedtea-lc_ctype.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/solaris/native/java/lang/java_props_md.c openjdk/jdk/src/solaris/native/java/lang/java_props_md.c
---- openjdk.orig/jdk/src/solaris/native/java/lang/java_props_md.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/java/lang/java_props_md.c	2011-03-15 23:40:55.950143541 +0000
-@@ -119,7 +119,7 @@
- 
- static int ParseLocale(int cat, char ** std_language, char ** std_script,
-                        char ** std_country, char ** std_variant, char ** std_encoding) {
--    char temp[64];
-+    char *temp;
-     char *language = NULL, *country = NULL, *variant = NULL,
-          *encoding = NULL;
-     char *p, encoding_variant[64];
-@@ -163,6 +163,7 @@
-      * <country name>, <encoding name>, and <variant name> are optional.
-      */
- 
-+    temp = (char*) malloc(strlen(lc)+1);
-     strcpy(temp, lc);
- 
-     /* Parse the language, country, encoding, and variant from the
-@@ -301,6 +302,10 @@
- #endif
-     }
- 
-+	
-+    /* Free temp */
-+    free(temp);
-+
-     return 1;
- }
- 
--- a/patches/icedtea-libraries.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1277 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
---- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2011-04-20 04:40:20.000000000 +0100
-+++ openjdk/jdk/make/com/sun/java/pack/Makefile	2011-04-21 09:00:44.681761082 +0100
-@@ -74,12 +74,10 @@
- 	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
- 	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
- 
--  ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
--  OTHER_CXXFLAGS += $(ZINCLUDE)
--  LDDFLAGS += $(ZIPOBJS)
-+  OTHER_LDLIBS += -lz
- else
-   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
--  OTHER_LDLIBS += $(JVMLIB)
-+  OTHER_LDLIBS += -lz $(JVMLIB)
- endif
- 
- CXXFLAGS_DBG += -DFULL
-@@ -98,12 +96,12 @@
-   RES = $(OBJDIR)/$(PGRM).res
- else
-   LDOUTPUT = -o #Have a space 
--  LDDFLAGS += -lc
-+  LDDFLAGS += -lz -lc
-   OTHER_LDLIBS  += $(LIBCXX)
- # setup the list of libraries to link in...
- ifeq ($(PLATFORM), linux)
- ifeq ("$(CC_VER_MAJOR)", "3")
--  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
-+  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
- endif
- endif #LINUX
- endif #PLATFORM
-diff -Nru openjdk.orig/jdk/make/common/Program.gmk openjdk/jdk/make/common/Program.gmk
---- openjdk.orig/jdk/make/common/Program.gmk	2011-04-20 04:40:20.000000000 +0100
-+++ openjdk/jdk/make/common/Program.gmk	2011-04-21 09:02:42.995660993 +0100
-@@ -83,6 +83,7 @@
- 	endif
-     endif
-     ifeq ($(PLATFORM), linux)
-+        LDFLAGS += -lz
- 	LDFLAGS += $(LDFLAG_Z_ORIGIN)
- 	LDFLAGS += -Wl,--allow-shlib-undefined
- 	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
-@@ -239,7 +240,6 @@
- endif
- 
- OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
--OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
- 
- OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
- VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
-diff -Nru openjdk.orig/jdk/make/java/jli/Makefile openjdk/jdk/make/java/jli/Makefile
---- openjdk.orig/jdk/make/java/jli/Makefile	2011-04-20 04:40:20.000000000 +0100
-+++ openjdk/jdk/make/java/jli/Makefile	2011-04-21 09:00:44.681761082 +0100
-@@ -44,7 +44,6 @@
- 
- include $(BUILDDIR)/common/Defs.gmk
- 
--ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
- LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
- LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
- 
-@@ -69,13 +68,7 @@
- 	parse_manifest.c \
- 	version_comp.c \
- 	wildcard.c \
--	jli_util.c \
--	inflate.c \
--	inftrees.c \
--	inffast.c \
--	zadler32.c \
--	zcrc32.c \
--	zutil.c
-+	jli_util.c
- 
- ifneq ($(PLATFORM), windows)
-   FILES_c += ergo.c 
-@@ -105,7 +98,7 @@
- 	# Note: its important to keep this order meaning -lc is the
- 	# last library otherwise it could cause compatibility issues
- 	# by pulling in SUNW_private symbols from libc
--	LDLIBS = -ldl -lc
-+	LDLIBS = -ldl -lz -lc
- ifeq ($(USE_PTHREADS),true)
- 	LDLIBS += -lpthread
- endif # USE_PTHREADS 
-@@ -129,7 +122,6 @@
- 
- OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
- OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
--OTHER_INCLUDES += -I$(ZIP_SRC)
- 
- #
- # Library to compile.
-@@ -164,4 +156,4 @@
- #
- # Add to ambient vpath so we pick up the library files
- #
--vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
-+vpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC)
-diff -Nru openjdk.orig/jdk/make/java/zip/FILES_c.gmk openjdk/jdk/make/java/zip/FILES_c.gmk
---- openjdk.orig/jdk/make/java/zip/FILES_c.gmk	2010-07-29 21:55:27.000000000 +0100
-+++ openjdk/jdk/make/java/zip/FILES_c.gmk	2011-04-21 09:00:44.681761082 +0100
-@@ -29,16 +29,4 @@
- 	Deflater.c \
- 	Inflater.c \
- 	ZipFile.c \
--	zip_util.c \
--	compress.c \
--	deflate.c \
--	gzio.c \
--	infback.c \
--	inffast.c \
--	inflate.c \
--	inftrees.c \
--	trees.c \
--	uncompr.c \
--	zadler32.c \
--	zcrc32.c \
--	zutil.c 
-+	zip_util.c
-diff -Nru openjdk.orig/jdk/make/java/zip/Makefile openjdk/jdk/make/java/zip/Makefile
---- openjdk.orig/jdk/make/java/zip/Makefile	2011-04-20 04:40:20.000000000 +0100
-+++ openjdk/jdk/make/java/zip/Makefile	2011-04-21 09:00:44.697761341 +0100
-@@ -71,16 +71,10 @@
- CPPFLAGS += -UDEBUG 
- endif
- 
--CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
- CPPFLAGS += -I$(SHARE_SRC)/native/java/io
- CPPFLAGS += -I$(PLATFORM_SRC)/native/java/io
- 
- #
--# Add to ambient vpath so we pick up the library files
--#
--vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/zlib-$(ZLIB_VERSION)
--
--#
- # Link to JVM library for JVM_Zip* functions
- #
--OTHER_LDLIBS = $(JVMLIB)
-+OTHER_LDLIBS = $(JVMLIB) -lz
-diff -Nru openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk openjdk/jdk/make/sun/jpeg/FILES_c.gmk
---- openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk	2010-07-29 21:55:29.000000000 +0100
-+++ openjdk/jdk/make/sun/jpeg/FILES_c.gmk	2011-04-21 09:00:44.697761341 +0100
-@@ -25,51 +25,7 @@
- 
- FILES_c = \
- 	imageioJPEG.c \
--	jpegdecoder.c \
--	jcomapi.c \
--	jdapimin.c \
--	jdapistd.c \
--	jdcoefct.c \
--	jdcolor.c \
--	jddctmgr.c \
--	jdhuff.c \
--	jdinput.c \
--	jdmainct.c \
--	jdmarker.c \
--	jdmaster.c \
--	jdmerge.c \
--	jdphuff.c \
--	jdpostct.c \
--	jdsample.c \
--	jerror.c \
--	jidctflt.c \
--	jidctfst.c \
--	jidctint.c \
--	jidctred.c \
--	jmemmgr.c \
--	jmemnobs.c \
--	jquant1.c \
--	jquant2.c \
--	jutils.c \
--	jcapimin.c \
--	jcapistd.c \
--	jccoefct.c \
--	jccolor.c \
--	jcdctmgr.c \
--	jchuff.c \
--	jcinit.c \
--	jcmainct.c \
--	jcmarker.c \
--	jcmaster.c \
--	jcparam.c \
--	jcphuff.c \
--	jcprepct.c \
--	jcsample.c \
--	jctrans.c \
--	jdtrans.c \
--	jfdctflt.c \
--	jfdctfst.c \
--	jfdctint.c
-+	jpegdecoder.c
- 
- ifndef OPENJDK
- FILES_c += \
-diff -Nru openjdk.orig/jdk/make/sun/jpeg/Makefile openjdk/jdk/make/sun/jpeg/Makefile
---- openjdk.orig/jdk/make/sun/jpeg/Makefile	2011-04-20 04:40:21.000000000 +0100
-+++ openjdk/jdk/make/sun/jpeg/Makefile	2011-04-21 09:00:44.697761341 +0100
-@@ -80,6 +80,8 @@
- include $(BUILDDIR)/common/Mapfile-vers.gmk
- include $(BUILDDIR)/common/Library.gmk
- 
-+LDLIBS += -ldl 
-+
- #
- # Add to ambient vpath to get files in a subdirectory
- #
-diff -Nru openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk openjdk/jdk/make/sun/splashscreen/FILES_c.gmk
---- openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk	2010-07-29 21:55:29.000000000 +0100
-+++ openjdk/jdk/make/sun/splashscreen/FILES_c.gmk	2011-04-21 09:00:44.697761341 +0100
-@@ -30,79 +30,5 @@
- 	splashscreen_impl.c \
- 	splashscreen_jpeg.c \
- 	splashscreen_png.c \
--	splashscreen_sys.c \
--	png.c \
--	pngerror.c \
--	pngget.c \
--	pngmem.c  \
--	pngpread.c \
--	pngread.c \
--	pngrio.c \
--	pngrtran.c \
--	pngrutil.c \
--	pngset.c \
--	pngtrans.c \
--	pngwio.c \
--	pngwrite.c \
--	pngwtran.c \
--	pngwutil.c \
--	dgif_lib.c \
--	gif_err.c \
--	gifalloc.c \
--	compress.c \
--	deflate.c \
--	gzio.c \
--	infback.c \
--	inffast.c \
--	inflate.c \
--	inftrees.c \
--	trees.c \
--	uncompr.c \
--	zadler32.c \
--	zcrc32.c \
--	zutil.c \
--	jcomapi.c \
--	jdapimin.c \
--	jdapistd.c \
--	jdcoefct.c \
--	jdcolor.c \
--	jddctmgr.c \
--	jdhuff.c \
--	jdinput.c \
--	jdmainct.c \
--	jdmarker.c \
--	jdmaster.c \
--	jdmerge.c \
--	jdphuff.c \
--	jdpostct.c \
--	jdsample.c \
--	jerror.c \
--	jidctflt.c \
--	jidctfst.c \
--	jidctint.c \
--	jidctred.c \
--	jmemmgr.c \
--	jmemnobs.c \
--	jquant1.c \
--	jquant2.c \
--	jutils.c \
--	jcapimin.c \
--	jcapistd.c \
--	jccoefct.c \
--	jccolor.c \
--	jcdctmgr.c \
--	jchuff.c \
--	jcinit.c \
--	jcmainct.c \
--	jcmarker.c \
--	jcmaster.c \
--	jcparam.c \
--	jcphuff.c \
--	jcprepct.c \
--	jcsample.c \
--	jctrans.c \
--	jdtrans.c \
--	jfdctflt.c \
--	jfdctfst.c \
--	jfdctint.c
-+	splashscreen_sys.c
- 
-diff -Nru openjdk.orig/jdk/make/sun/splashscreen/Makefile openjdk/jdk/make/sun/splashscreen/Makefile
---- openjdk.orig/jdk/make/sun/splashscreen/Makefile	2011-04-20 04:40:21.000000000 +0100
-+++ openjdk/jdk/make/sun/splashscreen/Makefile	2011-04-21 09:00:44.697761341 +0100
-@@ -59,12 +59,12 @@
- # C Flags
- #
- 
--CFLAGS += -DSPLASHSCREEN
-+CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE
- 
- ifneq ($(PLATFORM), windows)
-   CFLAGS += -DWITH_X11
-   CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
--  OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread
-+  OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpng -ljpeg -lgif -lz -lpthread
- else # PLATFORM
-   CFLAGS += -DWITH_WIN32
-   OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll
-@@ -76,14 +76,10 @@
- #
- vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/splashscreen
- vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)
--vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/giflib
--vpath %.c   $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
--vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/libpng
- vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg
- vpath %.c   $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen
- 
- CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen
--CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
- 
- # Shun the less than portable MMX assembly code in pnggccrd.c,
- # and use alternative implementations in C.
-diff -Nru openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
---- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2010-07-29 21:56:11.000000000 +0100
-+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2011-04-21 09:00:44.697761341 +0100
-@@ -89,11 +89,7 @@
- // bytes and byte arrays
- 
- typedef unsigned int uint;
--#ifdef _LP64
--typedef unsigned int uLong; // Historical zlib, should be 32-bit.
--#else
- typedef unsigned long uLong;
--#endif
- #ifdef _MSC_VER
- typedef LONGLONG        jlong;
- typedef DWORDLONG       julong;
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c openjdk/jdk/src/share/native/java/util/zip/Adler32.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c	2010-07-29 21:56:11.000000000 +0100
-+++ openjdk/jdk/src/share/native/java/util/zip/Adler32.c	2011-04-21 09:00:44.697761341 +0100
-@@ -29,7 +29,7 @@
- 
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_Adler32.h"
- 
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c openjdk/jdk/src/share/native/java/util/zip/CRC32.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c	2010-07-29 21:56:11.000000000 +0100
-+++ openjdk/jdk/src/share/native/java/util/zip/CRC32.c	2011-04-21 09:00:44.697761341 +0100
-@@ -29,7 +29,7 @@
- 
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_CRC32.h"
- 
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c openjdk/jdk/src/share/native/java/util/zip/Deflater.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/java/util/zip/Deflater.c	2011-04-21 09:00:44.697761341 +0100
-@@ -32,7 +32,7 @@
- #include "jlong.h"
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_Deflater.h"
- 
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c openjdk/jdk/src/share/native/java/util/zip/Inflater.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/java/util/zip/Inflater.c	2011-04-21 09:00:44.697761341 +0100
-@@ -35,7 +35,7 @@
- #include "jni.h"
- #include "jvm.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- #include "java_util_zip_Inflater.h"
- 
- #define MIN2(x, y)  ((x) < (y) ? (x) : (y))
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c openjdk/jdk/src/share/native/java/util/zip/zip_util.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/java/util/zip/zip_util.c	2011-04-21 09:00:44.697761341 +0100
-@@ -44,7 +44,8 @@
- #include "io_util.h"
- #include "io_util_md.h"
- #include "zip_util.h"
--#include "zlib.h"
-+
-+#include <zlib.h>
- 
- /* USE_MMAP means mmap the CEN & ENDHDR part of the zip file. */
- #ifdef USE_MMAP
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
---- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2011-04-20 04:40:22.000000000 +0100
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2011-04-21 09:00:44.697761341 +0100
-@@ -51,7 +51,9 @@
- 
- /* headers from the JPEG library */
- #include <jpeglib.h>
--#include "jerror.h"
-+#include <jerror.h>
-+
-+#include <dlfcn.h>
- 
- #undef MAX
- #define MAX(a,b)        ((a) > (b) ? (a) : (b))
-@@ -75,6 +77,62 @@
- static jfieldID JPEGHuffmanTable_lengthsID;
- static jfieldID JPEGHuffmanTable_valuesID;
- 
-+static void initIDs();
-+
-+typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
-+typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
-+typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
-+typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
-+typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
-+typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
-+typedef void (*fn_jpegabort)(j_common_ptr);
-+typedef void (*fn_jpegabortdecompress)(j_decompress_ptr);
-+typedef JHUFF_TBL * (*fn_jpegallochufftable)(j_common_ptr);
-+typedef JQUANT_TBL * (*fn_jpegallocquanttable)(j_common_ptr);
-+typedef void (*fn_jpegcreatecompress)(j_compress_ptr, int, size_t);
-+typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
-+typedef void (*fn_jpegdestroy)(j_common_ptr);
-+typedef void (*fn_jpegfinishcompress)(j_compress_ptr);
-+typedef boolean (*fn_jpeginputcomplete)(j_decompress_ptr);
-+typedef void (*fn_jpegsavemarkers)(j_decompress_ptr, int, unsigned int);
-+typedef void (*fn_jpegsetcolorspace)(j_compress_ptr, J_COLOR_SPACE);
-+typedef void (*fn_jpegsetdefaults)(j_compress_ptr);
-+typedef void (*fn_jpegsimpleprogression)(j_compress_ptr);
-+typedef void (*fn_jpegstartcompress)(j_compress_ptr, boolean);
-+typedef void (*fn_jpegsuppresstables)(j_compress_ptr, boolean);
-+typedef JDIMENSION (*fn_jpegwritescanlines)(j_compress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef void (*fn_jpegwritetables)(j_compress_ptr);
-+
-+fn_jpegabort jpegabort;
-+fn_jpegabortdecompress jpegabortdecompress;
-+fn_jpegallochufftable jpegallochufftable;
-+fn_jpegallocquanttable jpegallocquanttable;
-+fn_jpegcreatecompress jpegcreatecompress;
-+fn_jpegcreatedecompress jpegcreatedecompress;
-+fn_jpegdestroy jpegdestroy;
-+fn_jpegfinishcompress jpegfinishcompress;
-+fn_jpeginputcomplete jpeginputcomplete;
-+fn_jpegsavemarkers jpegsavemarkers;
-+fn_jpegsetcolorspace jpegsetcolorspace;
-+fn_jpegsetdefaults jpegsetdefaults;
-+fn_jpegsimpleprogression jpegsimpleprogression;
-+fn_jpegstartcompress jpegstartcompress;
-+fn_jpegsuppresstables jpegsuppresstables;
-+fn_jpegwritescanlines jpegwritescanlines;
-+fn_jpegwritetables jpegwritetables;
-+fn_jpegstderror jpegstderror;
-+fn_jpegstartoutput jpegstartoutput;
-+fn_jpegfinishdecompress jpegfinishdecompress;
-+fn_jpeghasmultiplescans jpeghasmultiplescans;
-+fn_jpegstartdecompress jpegstartdecompress;
-+fn_jpegreadheader jpegreadheader;
-+fn_jpegfinishoutput jpegfinishoutput;
-+fn_jpegreadscanlines jpegreadscanlines;
-+fn_jpegresynctorestart jpegresynctorestart;
-+
- /*
-  * Defined in jpegdecoder.c.  Copy code from there if and
-  * when that disappears. */
-@@ -608,7 +666,7 @@
-         return;
-     }
- 
--    jpeg_abort(cinfo);  // Frees any markers, but not tables
-+    jpegabort(cinfo);  // Frees any markers, but not tables
- 
- }
- 
-@@ -633,7 +691,7 @@
-         return;
-     }
- 
--    jpeg_abort(cinfo);  // Does not reset tables
-+    jpegabort(cinfo);  // Does not reset tables
- 
- }
- 
-@@ -651,7 +709,7 @@
-             free(cinfo->dest);
-             cinfo->dest = NULL;
-         }
--        jpeg_destroy(info);
-+        jpegdestroy(info);
-         free(info);
-     }
- }
-@@ -691,14 +749,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->quant_tbl_ptrs[i] == NULL) {
-                 decomp->quant_tbl_ptrs[i] =
--                    jpeg_alloc_quant_table(cinfo);
-+                    jpegallocquanttable(cinfo);
-             }
-             quant_ptr = decomp->quant_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->quant_tbl_ptrs[i] == NULL) {
-                 comp->quant_tbl_ptrs[i] =
--                    jpeg_alloc_quant_table(cinfo);
-+                    jpegallocquanttable(cinfo);
-             }
-             quant_ptr = comp->quant_tbl_ptrs[i];
-         }
-@@ -789,14 +847,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->dc_huff_tbl_ptrs[i] == NULL) {
-                 decomp->dc_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = decomp->dc_huff_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->dc_huff_tbl_ptrs[i] == NULL) {
-                 comp->dc_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = comp->dc_huff_tbl_ptrs[i];
-         }
-@@ -814,14 +872,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->ac_huff_tbl_ptrs[i] == NULL) {
-                 decomp->ac_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = decomp->ac_huff_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->ac_huff_tbl_ptrs[i] == NULL) {
-                 comp->ac_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = comp->ac_huff_tbl_ptrs[i];
-         }
-@@ -1381,6 +1439,8 @@
-      jclass ImageInputStreamClass,
-      jclass qTableClass,
-      jclass huffClass) {
-+   
-+    initIDs();
- 
-     ImageInputStream_readID = (*env)->GetMethodID(env,
-                                                   ImageInputStreamClass,
-@@ -1467,7 +1527,7 @@
-     }
- 
-     /* We set up the normal JPEG error routines, then override error_exit. */
--    cinfo->err = jpeg_std_error(&(jerr->pub));
-+    cinfo->err = jpegstderror(&(jerr->pub));
-     jerr->pub.error_exit = sun_jpeg_error_exit;
-     /* We need to setup our own print routines */
-     jerr->pub.output_message = sun_jpeg_output_message;
-@@ -1484,11 +1544,11 @@
-     }
- 
-     /* Perform library initialization */
--    jpeg_create_decompress(cinfo);
-+    jpegcreatedecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
- 
-     // Set up to keep any APP2 markers, as these might contain ICC profile
-     // data
--    jpeg_save_markers(cinfo, ICC_MARKER, 0xFFFF);
-+    jpegsavemarkers(cinfo, ICC_MARKER, 0xFFFF);
- 
-     /*
-      * Now set up our source.
-@@ -1507,7 +1567,7 @@
-     cinfo->src->init_source = imageio_init_source;
-     cinfo->src->fill_input_buffer = imageio_fill_input_buffer;
-     cinfo->src->skip_input_data = imageio_skip_input_data;
--    cinfo->src->resync_to_restart = jpeg_resync_to_restart; // use default
-+    cinfo->src->resync_to_restart = jpegresynctorestart; // use default
-     cinfo->src->term_source = imageio_term_source;
- 
-     /* set up the association to persist for future calls */
-@@ -1627,7 +1687,7 @@
-         src->bytes_in_buffer = 0;
-     }
- 
--    ret = jpeg_read_header(cinfo, FALSE);
-+    ret = jpegreadheader(cinfo, FALSE);
- 
-     if (ret == JPEG_HEADER_TABLES_ONLY) {
-         retval = JNI_TRUE;
-@@ -1756,7 +1816,7 @@
-                                cinfo->num_components,
-                                profileData);
-         if (reset) {
--            jpeg_abort_decompress(cinfo);
-+            jpegabortdecompress(cinfo);
-         }
-     }
- 
-@@ -1951,7 +2011,7 @@
-                    TRUE);
-     }
- 
--    progressive = jpeg_has_multiple_scans(cinfo);
-+    progressive = jpeghasmultiplescans(cinfo);
-     if (progressive) {
-         cinfo->buffered_image = TRUE;
-         cinfo->input_scan_number = minProgressivePass+1; // Java count from 0
-@@ -1963,7 +2023,7 @@
- 
-     data->streamBuf.suspendable = FALSE;
- 
--    jpeg_start_decompress(cinfo);
-+    jpegstartdecompress(cinfo);
- 
-     if (numBands !=  cinfo->output_components) {
-         JNU_ThrowByName(env, "javax/imageio/IIOException",
-@@ -1988,7 +2048,7 @@
-         if (progressive) {
-             // initialize the next pass.  Note that this skips up to
-             // the first interesting pass.
--            jpeg_start_output(cinfo, cinfo->input_scan_number);
-+            jpegstartoutput(cinfo, cinfo->input_scan_number);
-             if (wantUpdates) {
-                 (*env)->CallVoidMethod(env, this,
-                                        JPEGImageReader_passStartedID,
-@@ -2004,7 +2064,7 @@
-         // Skip until the first interesting line
-         while ((data->abortFlag == JNI_FALSE)
-                && ((jint)cinfo->output_scanline < sourceYStart)) {
--            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+            jpegreadscanlines(cinfo, &scanLinePtr, 1);
-         }
- 
-         scanlineLimit = sourceYStart+sourceHeight;
-@@ -2017,7 +2077,7 @@
-         while ((data->abortFlag == JNI_FALSE)
-                && ((jint)cinfo->output_scanline < scanlineLimit)) {
- 
--            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+            jpegreadscanlines(cinfo, &scanLinePtr, 1);
- 
-             // Now mangle it into our buffer
-             out = data->pixelBuf.buf.bp;
-@@ -2072,13 +2132,13 @@
-                 skipLines = linesLeft;
-             }
-             for(i = 0; i < skipLines; i++) {
--                jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+                jpegreadscanlines(cinfo, &scanLinePtr, 1);
-             }
-         }
-         if (progressive) {
--            jpeg_finish_output(cinfo); // Increments pass counter
-+            jpegfinishoutput(cinfo); // Increments pass counter
-             // Call Java to notify pass complete
--            if (jpeg_input_complete(cinfo)
-+            if (jpeginputcomplete(cinfo)
-                 || (cinfo->input_scan_number > maxProgressivePass)) {
-                 done = TRUE;
-             }
-@@ -2098,9 +2158,9 @@
-     if (cinfo->output_scanline == cinfo->output_height) {
-         //    if ((cinfo->output_scanline == cinfo->output_height) &&
-         //(jpeg_input_complete(cinfo))) {  // We read the whole file
--        jpeg_finish_decompress(cinfo);
-+        jpegfinishdecompress(cinfo);
-     } else {
--        jpeg_abort_decompress(cinfo);
-+        jpegabortdecompress(cinfo);
-     }
- 
-     free(scanLinePtr);
-@@ -2146,7 +2206,7 @@
- 
-     cinfo = (j_decompress_ptr) data->jpegObj;
- 
--    jpeg_abort_decompress(cinfo);
-+    jpegabortdecompress(cinfo);
- }
- 
- 
-@@ -2352,6 +2412,150 @@
- 
- /********************** end of destination manager ************/
- 
-+METHODDEF(void)
-+initIDs()
-+{
-+#if JPEG_LIB_VERSION >= 80
-+    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+#if JPEG_LIB_VERSION >= 70
-+    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+#endif
-+#endif
-+    
-+    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
-+    if (jpegstderror == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
-+    if (jpegreadheader == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
-+    if (jpeghasmultiplescans == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
-+    if (jpegstartdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
-+    if (jpegstartoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
-+    if (jpegfinishdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
-+    if (jpegreadscanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
-+    if (jpegfinishoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
-+    if (jpegresynctorestart == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegabort = (fn_jpegabort)dlsym(handle, "jpeg_abort");
-+    if (jpegabort == NULL) {
-+       dlclose(handle);
-+    }
-+ 
-+    jpegabortdecompress = (fn_jpegabortdecompress)dlsym(handle, "jpeg_abort_decompress");
-+    if (jpegabortdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegallochufftable = (fn_jpegallochufftable)dlsym(handle, "jpeg_alloc_huff_table");
-+    if (jpegallochufftable == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegallocquanttable = (fn_jpegallocquanttable)dlsym(handle, "jpeg_alloc_quant_table");
-+    if (jpegallocquanttable == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegcreatecompress = (fn_jpegcreatecompress)dlsym(handle, "jpeg_CreateCompress");
-+    if (jpegcreatecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
-+    if (jpegcreatedecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegdestroy = (fn_jpegdestroy)dlsym(handle, "jpeg_destroy");
-+    if (jpegdestroy == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishcompress = (fn_jpegfinishcompress)dlsym(handle, "jpeg_finish_compress");
-+    if (jpegfinishcompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeginputcomplete = (fn_jpeginputcomplete)dlsym(handle, "jpeg_input_complete");
-+    if (jpeginputcomplete == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsavemarkers = (fn_jpegsavemarkers)dlsym(handle, "jpeg_save_markers");
-+    if (jpegsavemarkers == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsetcolorspace = (fn_jpegsetcolorspace)dlsym(handle, "jpeg_set_colorspace");
-+    if (jpegsetcolorspace == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsetdefaults = (fn_jpegsetdefaults)dlsym(handle, "jpeg_set_defaults");
-+    if (jpegsetdefaults == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsimpleprogression = (fn_jpegsimpleprogression)dlsym(handle, "jpeg_simple_progression");
-+    if (jpegsimpleprogression == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartcompress = (fn_jpegstartcompress)dlsym(handle, "jpeg_start_compress");
-+    if (jpegstartcompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsuppresstables = (fn_jpegsuppresstables)dlsym(handle, "jpeg_suppress_tables");
-+    if (jpegsuppresstables == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegwritescanlines = (fn_jpegwritescanlines)dlsym(handle, "jpeg_write_scanlines");
-+    if (jpegwritescanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegwritetables = (fn_jpegwritetables)dlsym(handle, "jpeg_write_tables");
-+    if (jpegwritetables == NULL) {
-+       dlclose(handle);
-+    }
-+}
-+
- /********************** Writer JNI calls **********************/
- 
- 
-@@ -2363,6 +2567,8 @@
-      jclass qTableClass,
-      jclass huffClass) {
- 
-+    initIDs();
-+
-     ImageOutputStream_writeID = (*env)->GetMethodID(env,
-                                                     IOSClass,
-                                                     "write",
-@@ -2436,7 +2642,7 @@
-     }
- 
-     /* We set up the normal JPEG error routines, then override error_exit. */
--    cinfo->err = jpeg_std_error(&(jerr->pub));
-+    cinfo->err = jpegstderror(&(jerr->pub));
-     jerr->pub.error_exit = sun_jpeg_error_exit;
-     /* We need to setup our own print routines */
-     jerr->pub.output_message = sun_jpeg_output_message;
-@@ -2453,7 +2659,7 @@
-     }
- 
-     /* Perform library initialization */
--    jpeg_create_compress(cinfo);
-+    jpegcreatecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_compress_struct));
- 
-     /* Now set up the destination  */
-     dest = malloc(sizeof(struct jpeg_destination_mgr));
-@@ -2560,7 +2766,7 @@
-         return;
-     }
- 
--    jpeg_suppress_tables(cinfo, TRUE);  // Suppress writing of any current
-+    jpegsuppresstables(cinfo, TRUE);  // Suppress writing of any current
- 
-     data->streamBuf.suspendable = FALSE;
-     if (qtables != NULL) {
-@@ -2575,7 +2781,7 @@
-                    DCHuffmanTables, ACHuffmanTables, TRUE);
-     }
- 
--    jpeg_write_tables(cinfo); // Flushes the buffer for you
-+    jpegwritetables(cinfo); // Flushes the buffer for you
-     RELEASE_ARRAYS(env, data, NULL);
- }
- 
-@@ -2758,9 +2964,9 @@
-     cinfo->input_components = numBands;
-     cinfo->in_color_space = inCs;
- 
--    jpeg_set_defaults(cinfo);
-+    jpegsetdefaults(cinfo);
- 
--    jpeg_set_colorspace(cinfo, outCs);
-+    jpegsetcolorspace(cinfo, outCs);
- 
-     cinfo->optimize_coding = optimize;
- 
-@@ -2797,7 +3003,7 @@
-     (*env)->ReleaseIntArrayElements(env, QtableSelectors,
-                                     qsels, JNI_ABORT);
- 
--    jpeg_suppress_tables(cinfo, TRUE);  // Disable writing any current
-+    jpegsuppresstables(cinfo, TRUE);  // Disable writing any current
- 
-     qlen = setQTables(env, (j_common_ptr) cinfo, qtables, writeDQT);
- 
-@@ -2822,7 +3028,7 @@
- 
-     if (progressive) {
-         if (numScans == 0) { // then use default scans
--            jpeg_simple_progression(cinfo);
-+            jpegsimpleprogression(cinfo);
-         } else {
-             cinfo->num_scans = numScans;
-             // Copy the scanInfo to a local array
-@@ -2864,7 +3070,7 @@
- #endif
- 
-     // start the compressor; tables must already be set
--    jpeg_start_compress(cinfo, FALSE); // Leaves sent_table alone
-+    jpegstartcompress(cinfo, FALSE); // Leaves sent_table alone
- 
-     if (haveMetadata) {
-         // Flush the buffer
-@@ -2927,7 +3133,7 @@
-             }
-         }
-         // write it out
--        jpeg_write_scanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
-+        jpegwritescanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
-         targetLine += stepY;
-     }
- 
-@@ -2936,9 +3142,9 @@
-      * so use jpeg_abort instead of jpeg_finish_compress.
-      */
-     if (cinfo->next_scanline == cinfo->image_height) {
--        jpeg_finish_compress(cinfo);  // Flushes buffer with term_dest
-+        jpegfinishcompress(cinfo);  // Flushes buffer with term_dest
-     } else {
--        jpeg_abort((j_common_ptr)cinfo);
-+        jpegabort((j_common_ptr)cinfo);
-     }
- 
-     if (scale != NULL) {
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
---- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2011-04-20 04:40:22.000000000 +0100
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2011-04-21 09:00:44.697761341 +0100
-@@ -45,7 +45,9 @@
- #undef boolean
- #undef FAR
- #include <jpeglib.h>
--#include "jerror.h"
-+#include <jerror.h>
-+#include <dlfcn.h>
-+
- 
- /* The method IDs we cache. Note that the last two belongs to the
-  * java.io.InputStream class.
-@@ -56,6 +58,32 @@
- static jmethodID InputStream_readID;
- static jmethodID InputStream_availableID;
- 
-+typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
-+typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
-+typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
-+typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
-+typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
-+typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
-+typedef void (*fn_jpegdestroydecompress)(j_decompress_ptr);
-+typedef int (*fn_jpegconsumeinput)(j_decompress_ptr);
-+typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
-+
-+fn_jpegstderror jpegstderror;
-+fn_jpegstartoutput jpegstartoutput;
-+fn_jpegfinishdecompress jpegfinishdecompress;
-+fn_jpegconsumeinput jpegconsumeinput;
-+fn_jpegdestroydecompress jpegdestroydecompress; 
-+fn_jpeghasmultiplescans jpeghasmultiplescans;
-+fn_jpegstartdecompress jpegstartdecompress;
-+fn_jpegreadheader jpegreadheader;
-+fn_jpegfinishoutput jpegfinishoutput;
-+fn_jpegreadscanlines jpegreadscanlines;
-+fn_jpegresynctorestart jpegresynctorestart;
-+fn_jpegcreatedecompress jpegcreatedecompress;
-+
- /* Initialize the Java VM instance variable when the library is
-    first loaded */
- JavaVM *jvm;
-@@ -462,6 +490,76 @@
- Java_sun_awt_image_JPEGImageDecoder_initIDs(JNIEnv *env, jclass cls,
-                                             jclass InputStreamClass)
- {
-+#if JPEG_LIB_VERSION >= 80
-+    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+#if JPEG_LIB_VERSION >= 70
-+    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+#endif
-+#endif
-+ 
-+    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
-+    if (jpegstderror == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegdestroydecompress = (fn_jpegdestroydecompress)dlsym(handle, "jpeg_destroy_decompress");
-+    if (jpegdestroydecompress == NULL) {
-+       dlclose(handle);
-+    }  
-+
-+    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
-+    if (jpegcreatedecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
-+    if (jpegreadheader == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
-+    if (jpeghasmultiplescans == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
-+    if (jpegstartdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegconsumeinput = (fn_jpegconsumeinput)dlsym(handle, "jpeg_consume_input");
-+    if (jpegconsumeinput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
-+    if (jpegstartoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
-+    if (jpegfinishdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
-+    if (jpegreadscanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
-+    if (jpegfinishoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
-+    if (jpegresynctorestart == NULL) {
-+       dlclose(handle);
-+    }
-+
-     sendHeaderInfoID = (*env)->GetMethodID(env, cls, "sendHeaderInfo",
-                                            "(IIZZZ)Z");
-     sendPixelsByteID = (*env)->GetMethodID(env, cls, "sendPixels", "([BI)Z");
-@@ -519,7 +617,7 @@
-   /* Step 1: allocate and initialize JPEG decompression object */
- 
-   /* We set up the normal JPEG error routines, then override error_exit. */
--  cinfo.err = jpeg_std_error(&jerr.pub);
-+  cinfo.err = jpegstderror(&jerr.pub);
-   jerr.pub.error_exit = sun_jpeg_error_exit;
- 
-   /* We need to setup our own print routines */
-@@ -530,7 +628,7 @@
-     /* If we get here, the JPEG code has signaled an error.
-      * We need to clean up the JPEG object, close the input file, and return.
-      */
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     RELEASE_ARRAYS(env, &jsrc);
-     if (!(*env)->ExceptionOccurred(env)) {
-         char buffer[JMSG_LENGTH_MAX];
-@@ -541,7 +639,7 @@
-     return;
-   }
-   /* Now we can initialize the JPEG decompression object. */
--  jpeg_create_decompress(&cinfo);
-+  jpegcreatedecompress(&cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
- 
-   /* Step 2: specify data source (eg, a file) */
- 
-@@ -555,17 +653,17 @@
-   jsrc.pub.init_source = sun_jpeg_init_source;
-   jsrc.pub.fill_input_buffer = sun_jpeg_fill_input_buffer;
-   jsrc.pub.skip_input_data = sun_jpeg_skip_input_data;
--  jsrc.pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
-+  jsrc.pub.resync_to_restart = jpegresynctorestart; /* use default method */
-   jsrc.pub.term_source = sun_jpeg_term_source;
-   if (!GET_ARRAYS(env, &jsrc)) {
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
-   /* Step 3: read file parameters with jpeg_read_header() */
- 
--  (void) jpeg_read_header(&cinfo, TRUE);
-+  (void) jpegreadheader(&cinfo, TRUE);
-   /* select buffered-image mode if it is a progressive JPEG only */
--  buffered_mode = cinfo.buffered_image = jpeg_has_multiple_scans(&cinfo);
-+  buffered_mode = cinfo.buffered_image = jpeghasmultiplescans(&cinfo);
-   grayscale = (cinfo.out_color_space == JCS_GRAYSCALE);
- #ifdef YCCALPHA
-   hasalpha = (cinfo.out_color_space == JCS_RGBA);
-@@ -584,7 +682,7 @@
-                                   grayscale, hasalpha, buffered_mode);
-   if ((*env)->ExceptionOccurred(env) || !ret) {
-     /* No more interest in this image... */
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
-   /* Make a one-row-high sample array with enough room to expand to ints */
-@@ -595,7 +693,7 @@
-   }
- 
-   if (jsrc.hOutputBuffer == 0 || !GET_ARRAYS(env, &jsrc)) {
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
- 
-@@ -613,7 +711,7 @@
- 
-   /* Step 5: Start decompressor */
- 
--  jpeg_start_decompress(&cinfo);
-+  jpegstartdecompress(&cinfo);
- 
-   /* We may need to do some setup of our own at this point before reading
-    * the data.  After jpeg_start_decompress() we have the correct scaled
-@@ -638,28 +736,28 @@
-           do {
-               sun_jpeg_fill_suspended_buffer(&cinfo);
-               jsrc.suspendable = TRUE;
--              ret = jpeg_consume_input(&cinfo);
-+	      ret = jpegconsumeinput(&cinfo);
-               jsrc.suspendable = FALSE;
-           } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
-           if (ret == JPEG_REACHED_EOI) {
-               final_pass = TRUE;
-               cinfo.dct_method = JDCT_ISLOW;
-           }
--          jpeg_start_output(&cinfo, cinfo.input_scan_number);
-+	  jpegstartoutput(&cinfo, cinfo.input_scan_number);
-       }
-       while (cinfo.output_scanline < cinfo.output_height) {
-           if (! final_pass) {
-               do {
-                   sun_jpeg_fill_suspended_buffer(&cinfo);
-                   jsrc.suspendable = TRUE;
--                  ret = jpeg_consume_input(&cinfo);
-+		  ret = jpegconsumeinput(&cinfo);
-                   jsrc.suspendable = FALSE;
-               } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
-               if (ret == JPEG_REACHED_EOI) {
-                   break;
-               }
-           }
--          (void) jpeg_read_scanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
-+	  (void) jpegreadscanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
- 
-           if (grayscale) {
-               RELEASE_ARRAYS(env, &jsrc);
-@@ -695,18 +793,18 @@
-           if ((*env)->ExceptionOccurred(env) || !ret ||
-               !GET_ARRAYS(env, &jsrc)) {
-               /* No more interest in this image... */
--              jpeg_destroy_decompress(&cinfo);
-+	      jpegdestroydecompress(&cinfo);
-               return;
-           }
-       }
-       if (buffered_mode) {
--          jpeg_finish_output(&cinfo);
-+	  jpegfinishoutput(&cinfo);
-       }
-   } while (! final_pass);
- 
-   /* Step 7: Finish decompression */
- 
--  (void) jpeg_finish_decompress(&cinfo);
-+  (void) jpegfinishdecompress(&cinfo);
-   /* We can ignore the return value since suspension is not possible
-    * with the stdio data source.
-    * (nor with the Java data source)
-@@ -715,7 +813,7 @@
-   /* Step 8: Release JPEG decompression object */
- 
-   /* This is an important step since it will release a good deal of memory. */
--  jpeg_destroy_decompress(&cinfo);
-+  jpegdestroydecompress(&cinfo);
- 
-   /* After finish_decompress, we can close the input file.
-    * Here we postpone it until after no more JPEG errors are possible,
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
---- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2011-04-21 09:00:44.701761405 +0100
-@@ -26,7 +26,7 @@
- #include "splashscreen_impl.h"
- #include "splashscreen_gfx.h"
- 
--#include "../giflib/gif_lib.h"
-+#include <gif_lib.h>
- 
- #define GIF_TRANSPARENT     0x01
- #define GIF_USER_INPUT      0x02
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
---- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2010-07-29 21:56:12.000000000 +0100
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2011-04-21 09:00:44.701761405 +0100
-@@ -25,9 +25,8 @@
- 
- #include "splashscreen_impl.h"
- 
--#include "jinclude.h"
--#include "jpeglib.h"
--#include "jerror.h"
-+#include <jpeglib.h>
-+#include <jerror.h>
- 
- #include <setjmp.h>
- 
-@@ -105,13 +104,9 @@
-     stream_src_ptr src;
- 
-     if (cinfo->src == NULL) {   /* first time for this JPEG object? */
--        cinfo->src = (struct jpeg_source_mgr *)
--            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
--            JPOOL_PERMANENT, SIZEOF(stream_source_mgr));
--        src = (stream_src_ptr) cinfo->src;
--        src->buffer = (JOCTET *)
--            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
--            JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
-+        cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(stream_source_mgr));
-+	src = (stream_src_ptr) cinfo->src;
-+    	src->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof(JOCTET));
-     }
- 
-     src = (stream_src_ptr) cinfo->src;
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
---- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2011-04-21 09:00:44.701761405 +0100
-@@ -25,7 +25,7 @@
- 
- #include "splashscreen_impl.h"
- 
--#include "../libpng/png.h"
-+#include <png.h>
- 
- #include <setjmp.h>
- 
--- a/patches/icedtea-linker-libs-order.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
---- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2010-09-01 10:55:50.000000000 +0100
-+++ openjdk/jdk/make/com/sun/java/pack/Makefile	2010-09-01 15:54:07.312808721 +0100
-@@ -75,12 +75,12 @@
- 	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
- 	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
- 
--  OTHER_LDLIBS += -lz
- else
-   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
--  OTHER_LDLIBS += -lz $(JVMLIB)
-+  OTHER_LDLIBS += $(JVMLIB)
- endif
- 
-+OTHER_LDLIBS += -lz
- CXXFLAGS_DBG += -DFULL
- CXXFLAGS_OPT += -DPRODUCT
- CXXFLAGS_COMMON += -DFULL
-@@ -97,12 +97,11 @@
-   RES = $(OBJDIR)/$(PGRM).res
- else
-   LDOUTPUT = -o #Have a space 
--  LDDFLAGS += -lz -lc
--  OTHER_LDLIBS  += $(LIBCXX)
-+  OTHER_LDLIBS += $(LIBCXX) -lc
- # setup the list of libraries to link in...
- ifeq ($(PLATFORM), linux)
- ifeq ("$(CC_VER_MAJOR)", "3")
--  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
-+  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
- endif
- endif #LINUX
- endif #PLATFORM
-@@ -148,7 +147,7 @@
- 
- $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) updatefiles winres
- 	$(prep-target)
--	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
-+	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(OTHER_LDLIBS) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
- ifdef MT
- 	$(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
- endif
-diff -Nru openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile openjdk/jdk/make/javax/sound/jsoundalsa/Makefile
---- openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile	2010-07-29 21:55:27.000000000 +0100
-+++ openjdk/jdk/make/javax/sound/jsoundalsa/Makefile	2010-09-01 15:54:07.312808721 +0100
-@@ -66,7 +66,7 @@
- 	$(MIDIFILES_export) \
- 	$(PORTFILES_export)
- 
--LDFLAGS += -lasound
-+OTHER_LDLIBS += -lasound
- 
- CPPFLAGS += \
- 	-DUSE_DAUDIO=TRUE \
--- a/patches/icedtea-nss-config.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
---- openjdk.orig/jdk/src/share/lib/security/java.security	2009-08-25 11:43:59.000000000 +0100
-+++ openjdk/jdk/src/share/lib/security/java.security		2009-08-27 14:23:54.000000000 +0100
-@@ -51,6 +51,7 @@
- security.provider.6=com.sun.security.sasl.Provider
- security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
- security.provider.8=sun.security.smartcardio.SunPCSC
-+security.provider.9=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
- 
- #
- # Select the source of seed data for SecureRandom. By default an
--- a/patches/icedtea-nss-not-enabled-config.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- openjdk.orig/jdk/src/share/lib/security/java.security	2009-08-25 11:43:59.000000000 +0100
-+++ openjdk/jdk/src/share/lib/security/java.security		2009-08-27 14:23:54.000000000 +0100
-@@ -51,6 +51,10 @@
- security.provider.6=com.sun.security.sasl.Provider
- security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
- security.provider.8=sun.security.smartcardio.SunPCSC
-+# the NSS security provider was not enabled for this build; it can be enabled
-+# if NSS (libnss3) is available on the machine. The nss.cfg file may need
-+# editing to reflect the location of the NSS installation.
-+#security.provider.9=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
- 
- #
- # Select the source of seed data for SecureRandom. By default an
--- a/patches/icedtea-override-redirect-metacity.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2010-01-04 16:57:29.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2010-01-04 19:47:57.000000000 +0000
-@@ -1142,6 +1142,7 @@
- 
-     boolean isOverrideRedirect() {
-         return XWM.getWMID() == XWM.OPENLOOK_WM ||
-+            XWM.getWMID() == XWM.METACITY_WM ||
-             Window.Type.POPUP.equals(getWindowType());
-     }
- 
--- a/patches/icedtea-pr261.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/java/nio/FILES_java.gmk openjdk/jdk/make/java/nio/FILES_java.gmk
---- openjdk.orig/jdk/make/java/nio/FILES_java.gmk	2009-03-05 08:28:24.000000000 +0000
-+++ openjdk/jdk/make/java/nio/FILES_java.gmk	2009-03-06 17:57:56.000000000 +0000
-@@ -39,6 +39,7 @@
- 	java/nio/channels/AsynchronousServerSocketChannel.java \
- 	java/nio/channels/AsynchronousSocketChannel.java \
- 	java/nio/channels/ByteChannel.java \
-+	java/nio/channels/CancelledKeyException.java \
- 	java/nio/channels/Channel.java \
- 	java/nio/channels/Channels.java \
- 	java/nio/channels/CompletionHandler.java \
-@@ -51,6 +52,7 @@
- 	java/nio/channels/MembershipKey.java \
- 	java/nio/channels/MulticastChannel.java \
- 	java/nio/channels/NetworkChannel.java \
-+	java/nio/channels/Pipe.java \
- 	java/nio/channels/ReadableByteChannel.java \
- 	java/nio/channels/ScatteringByteChannel.java \
- 	java/nio/channels/SeekableByteChannel.java \
-diff -Nru openjdk.orig/jdk/make/java/nio/Makefile openjdk/jdk/make/java/nio/Makefile
---- openjdk.orig/jdk/make/java/nio/Makefile	2009-03-05 08:28:24.000000000 +0000
-+++ openjdk/jdk/make/java/nio/Makefile	2009-03-06 18:00:27.000000000 +0000
-@@ -183,6 +183,9 @@
- ifeq ($(PLATFORM), linux)
- FILES_java += \
-         sun/nio/ch/AbstractPollSelectorImpl.java \
-+	sun/nio/ch/DevPollArrayWrapper.java \
-+	sun/nio/ch/DevPollSelectorImpl.java \
-+	sun/nio/ch/DevPollSelectorProvider.java \
- 	sun/nio/ch/EPoll.java \
- 	sun/nio/ch/EPollArrayWrapper.java \
- 	sun/nio/ch/EPollPort.java \
-@@ -242,6 +245,7 @@
- 	UnixNativeDispatcher.c
- 
- FILES_export += \
-+ 	sun/nio/ch/DevPollArrayWrapper.java \
- 	sun/nio/ch/EPoll.java \
-         sun/nio/ch/EPollArrayWrapper.java \
- 	sun/nio/ch/EPollPort.java \
--- a/patches/icedtea-print-lsb-release.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
---- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2010-08-27 19:15:27.000000000 +0100
-+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2010-08-31 18:50:26.191830872 +0100
-@@ -1888,6 +1888,37 @@
-   return true;
- }
- 
-+bool _print_lsb_file(const char* filename, outputStream* st) {
-+  int fd = open(filename, O_RDONLY);
-+  if (fd == -1) {
-+     return false;
-+  }
-+
-+  char buf[512], *d_i, *d_r, *d_c;
-+  int bytes;
-+
-+  if ((bytes = read(fd, buf, sizeof(buf)-1)) == sizeof(buf)-1) {
-+     close(fd);
-+     return false;
-+  }
-+  close(fd);
-+
-+  buf[bytes] = '\n';
-+  buf[bytes+1] = '\0';
-+  d_i = strstr(buf, "DISTRIB_ID=");
-+  d_r = strstr(buf, "DISTRIB_RELEASE=");
-+  d_c = strstr(buf, "DISTRIB_CODENAME=");
-+  if (!d_i || !d_r || !d_c) {
-+     return false;
-+  }
-+  d_i = strchr(d_i, '=') + 1;  *strchrnul(d_i, '\n') = '\0';
-+  d_r = strchr(d_r, '=') + 1;  *strchrnul(d_r, '\n') = '\0';
-+  d_c = strchr(d_c, '=') + 1;  *strchrnul(d_c, '\n') = '\0';
-+  st->print("%s %s (%s)", d_i, d_r, d_c);
-+
-+  return true;
-+}
-+
- void os::print_dll_info(outputStream *st) {
-    st->print_cr("Dynamic libraries:");
- 
-@@ -1916,6 +1947,7 @@
-       !_print_ascii_file("/etc/SuSE-release", st) &&
-       !_print_ascii_file("/etc/turbolinux-release", st) &&
-       !_print_ascii_file("/etc/gentoo-release", st) &&
-+      !_print_lsb_file("/etc/lsb-release", st) &&
-       !_print_ascii_file("/etc/debian_version", st) &&
-       !_print_ascii_file("/etc/ltib-release", st) &&
-       !_print_ascii_file("/etc/angstrom-version", st)) {
--- a/patches/icedtea-pulse-soundproperties.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
---- openjdk/jdk/src/share/lib/sound.properties	2008-08-28 04:15:18.000000000 -0400
-+++ openjdk/jdk/src/share/lib/sound.properties	2008-10-03 16:59:21.000000000 -0400
-@@ -37,3 +37,13 @@
- # Specify the default Receiver by provider and name:
- # javax.sound.midi.Receiver=com.sun.media.sound.MidiProvider#SunMIDI1
- #
-+
-+# javax.sound.sampled.Clip=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
-+# javax.sound.sampled.Port=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
-+# javax.sound.sampled.SourceDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
-+# javax.sound.sampled.TargetDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
-+
-+javax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider
-+javax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider
-+javax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider
-+javax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider
--- a/patches/icedtea-rhino.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/com/sun/Makefile openjdk/jdk/make/com/sun/Makefile
---- openjdk.orig/jdk/make/com/sun/Makefile	2011-04-20 04:40:20.000000000 +0100
-+++ openjdk/jdk/make/com/sun/Makefile	2011-04-21 22:36:31.443422475 +0100
-@@ -31,13 +31,6 @@
- PRODUCT = sun
- include $(BUILDDIR)/common/Defs.gmk
- 
--ifndef OPENJDK
--  ORG_EXISTS := $(call DirExists,$(CLOSED_SRC)/share/classes/sun/org,,)
--  ifneq ("$(ORG_EXISTS)", "") 
--    SCRIPT_SUBDIR = script
--  endif
--endif
--
- # jarsigner is part of JRE
- SUBDIRS = java security net/ssl jarsigner
- 
-diff -Nru openjdk.orig/jdk/make/com/sun/script/Makefile openjdk/jdk/make/com/sun/script/Makefile
---- openjdk.orig/jdk/make/com/sun/script/Makefile	2011-04-20 04:40:20.000000000 +0100
-+++ openjdk/jdk/make/com/sun/script/Makefile	2011-04-21 22:36:31.443422475 +0100
-@@ -31,6 +31,8 @@
- 
- AUTO_FILES_JAVA_DIRS = com/sun/script
- 
-+OTHER_JAVACFLAGS = -classpath $(RHINO_JAR)
-+
- #
- # Files that need to be copied
- #
-diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
---- openjdk.orig/jdk/make/common/Release.gmk	2011-04-21 20:56:37.000000000 +0100
-+++ openjdk/jdk/make/common/Release.gmk	2011-04-21 22:36:31.443422475 +0100
-@@ -735,6 +735,7 @@
- 	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
- 	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
- 	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
-+	$(CP) $(RHINO_JAR) $(JRE_IMAGE_DIR)/lib/rhino.jar
- 	@# Generate meta-index to make boot and extension class loaders lazier
- 	$(CD) $(JRE_IMAGE_DIR)/lib && \
- 	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2010-07-29 21:55:35.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2011-04-21 22:36:31.443422475 +0100
-@@ -24,7 +24,7 @@
-  */
- 
- package com.sun.script.javascript;
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- import javax.script.*;
- import java.util.*;
- 
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2010-07-29 21:55:35.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2011-04-21 22:36:31.455422660 +0100
-@@ -26,7 +26,7 @@
- package com.sun.script.javascript;
- 
- import javax.script.Invocable;
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- 
- /**
-  * This class implements Rhino-like JavaAdapter to help implement a Java
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2010-07-29 21:55:35.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2011-04-21 22:36:31.455422660 +0100
-@@ -25,7 +25,7 @@
- 
- package com.sun.script.javascript;
- 
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- import java.util.*;
- 
- /**
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2010-07-29 21:55:35.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2011-04-21 22:36:31.455422660 +0100
-@@ -26,7 +26,7 @@
- package com.sun.script.javascript;
- 
- import java.util.*;
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- 
- /**
-  * This class prevents script access to certain sensitive classes.
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2010-07-29 21:55:35.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2011-04-21 22:36:31.455422660 +0100
-@@ -25,7 +25,7 @@
- 
- package com.sun.script.javascript;
- import javax.script.*;
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- 
- /**
-  * Represents compiled JavaScript code.
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2011-04-18 18:04:37.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2011-04-21 22:36:31.455422660 +0100
-@@ -26,7 +26,7 @@
- package com.sun.script.javascript;
- import javax.script.*;
- import java.util.*;
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- import com.sun.script.util.*;
- 
- /**
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2011-04-20 04:40:21.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2011-04-21 22:36:31.455422660 +0100
-@@ -26,7 +26,7 @@
- package com.sun.script.javascript;
- import com.sun.script.util.*;
- import javax.script.*;
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- import java.lang.reflect.Method;
- import java.io.*;
- import java.util.*;
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2011-04-11 12:34:30.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2011-04-21 22:36:31.455422660 +0100
-@@ -25,7 +25,7 @@
- 
- package com.sun.script.javascript;
- 
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- import javax.script.*;
- 
- /**
-diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2010-07-29 21:55:35.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2011-04-21 22:36:31.455422660 +0100
-@@ -27,7 +27,7 @@
- 
- import java.lang.reflect.*;
- import static sun.security.util.SecurityConstants.*;
--import sun.org.mozilla.javascript.internal.*;
-+import sun.org.mozilla.javascript.*;
- 
- /**
-  * This wrap factory is used for security reasons. JSR 223 script
--- a/patches/icedtea-rmi_amd64.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
---- ../openjdk/jdk/make/sun/rmi/rmi/Makefile	2007-08-16 03:17:52.000000000 -0400
-+++ openjdk/jdk/make/sun/rmi/rmi/Makefile	2007-08-30 12:36:07.000000000 -0400
-@@ -88,12 +88,8 @@
- ifeq ($(PLATFORM), windows)
- build: stubs
- else # PLATFORM
--ifneq ($(ARCH_DATA_MODEL), 32)
--build: stubs
--else # ARCH_DATA_MODEL
- build: stubs bin
- endif
--endif
- 
- clean clobber:: bin.clean
- 
--- a/patches/icedtea-samejvm-safe.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- openjdk.orig/jdk/test/TEST.ROOT	2008-11-06 09:44:52.000000000 +0100
-+++ openjdk/jdk/test/TEST.ROOT	2008-11-23 16:15:53.000000000 +0100
-@@ -4,3 +4,9 @@
- 
- # The list of keywords supported in the entire test suite
- keys=2d dnd i18n
-+
-+# List if directory (prefixes) that contain test that are safe to run in
-+# -samejvm mode. Only used if the test root (dir containing this file) is
-+# given to jtreg and the -samejvm argument is used, ignored otherwise
-+# (meaning all tests are assumed to be same jvm safe).
-+samejvmsafe=com/sun/crypto com/sun/management com/sun/media com/sun/security java/beans/beancontext java/beans/PropertyChangeSupport java/beans/Statement java/beans/VetoableChangeSupport java/lang/Boolean java/lang/Byte java/lang/Double java/lang/Float java/lang/Integer java/lang/Long java/lang/Short java/lang/Math java/lang/StrictMath java/lang/String java/lang/Throwable java/lang/instrument java/math java/net/URI java/net/URLDecoder java/net/URLEncoder java/nio/Buffer java/nio/ByteOrder java/nio/MappedByteBuffer java/nio/channels/Channels java/nio/channels/DatagramChannel java/nio/channels/spi java/security/cert java/security/Provider java/text java/util/jar java/util/zip java/util/Array java/util/BitSet java/util/Collection java/util/List javax/imageio javax/management/openmbean javax/rmi javax/sound sun/net/www/protocol sun/misc sun/nio sun/security/pkcs11 sun/security/rsa sun/util
--- a/patches/icedtea-security-updates.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-diff -Nru openjdk.orig/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java openjdk/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java
---- openjdk.orig/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java	2009-05-12 12:55:47.000000000 +0100
-@@ -0,0 +1,97 @@
-+/*
-+ * Copyright 2007 Sun Microsystems, Inc.  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
-+ * under the terms of the GNU General Public License version 2 only, as
-+ * published by the Free Software Foundation.
-+ *
-+ * This code is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * version 2 for more details (a copy is included in the LICENSE file that
-+ * accompanied this code).
-+ *
-+ * You should have received a copy of the GNU General Public License version
-+ * 2 along with this work; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+ *
-+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6685178
-+ * @summary Sanity check for local only option. In order to fully test this
-+ *          new local only option two different machines would be required.
-+ * @author Luis-Miguel Alventosa
-+ * @run main/othervm LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
-+ * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
-+ */
-+
-+import java.io.*;
-+import java.lang.management.*;
-+import java.util.*;
-+import javax.management.*;
-+import javax.management.remote.*;
-+import com.sun.tools.attach.*;
-+
-+public class LocalOnlyTest {
-+
-+    public static void main(String args[]) throws Exception {
-+        RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
-+        String name = rt.getName();
-+        System.out.println("name = " + name);
-+        String vmid = name.substring(0, name.indexOf("@"));
-+        System.out.println("vmid = " + vmid);
-+        VirtualMachine vm = VirtualMachine.attach(vmid);
-+        String addr = vm.getAgentProperties().getProperty(
-+                "com.sun.management.jmxremote.localConnectorAddress");
-+        System.out.println("connectorAddress = " + addr);
-+        if (addr == null) {
-+            // Normally in ${java.home}/jre/lib/management-agent.jar
-+            // but might be in ${java.home}/lib in build environments.
-+            String javaHome = System.getProperty("java.home");
-+            String agent = javaHome + File.separator + "jre" + File.separator +
-+                    "lib" + File.separator + "management-agent.jar";
-+            File f = new File(agent);
-+            if (!f.exists()) {
-+                agent = javaHome + File.separator + "lib" + File.separator +
-+                        "management-agent.jar";
-+                f = new File(agent);
-+                if (!f.exists()) {
-+                    throw new IOException("Management agent not found");
-+                }
-+            }
-+            agent = f.getCanonicalPath();
-+            try {
-+                vm.loadAgent(agent, "com.sun.management.jmxremote");
-+            } catch (AgentLoadException x) {
-+                IOException ioe = new IOException(x.getMessage());
-+                ioe.initCause(x);
-+                throw ioe;
-+            } catch (AgentInitializationException x) {
-+                IOException ioe = new IOException(x.getMessage());
-+                ioe.initCause(x);
-+                throw ioe;
-+            }
-+            addr = vm.getAgentProperties().getProperty(
-+                    "com.sun.management.jmxremote.localConnectorAddress");
-+            System.out.println("connectorAddress (after loading agent) = " + addr);
-+        }
-+        vm.detach();
-+        JMXServiceURL url = new JMXServiceURL(addr);
-+        JMXConnector c = JMXConnectorFactory.connect(url);
-+        System.out.println("connectionId  = " + c.getConnectionId());
-+        System.out.println("Bye! Bye!");
-+    }
-+}
--- a/patches/icedtea-signed-types.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp
---- openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp	2011-03-14 22:09:03.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp	2011-03-15 23:15:53.055192661 +0000
-@@ -93,7 +93,7 @@
-   address     _locs_point;      // last relocated position (grows upward)
-   bool        _locs_own;        // did I allocate the locs myself?
-   bool        _frozen;          // no more expansion of this section
--  char        _index;           // my section number (SECT_INST, etc.)
-+  signed char _index;           // my section number (SECT_INST, etc.)
-   CodeBuffer* _outer;           // enclosing CodeBuffer
- 
-   // (Note:  _locs_point used to be called _last_reloc_offset.)
-diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciTypeFlow.cpp openjdk/hotspot/src/share/vm/ci/ciTypeFlow.cpp
---- openjdk.orig/hotspot/src/share/vm/ci/ciTypeFlow.cpp	2011-03-14 22:09:03.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/ci/ciTypeFlow.cpp	2011-03-15 23:15:53.055192661 +0000
-@@ -403,7 +403,7 @@
-   // Set the rest of the locals to bottom.
-   Cell cell = state->next_cell(state->tos());
-   state->set_stack_size(0);
--  int limit = state->limit_cell();
-+  Cell limit = state->limit_cell();
-   for (; cell < limit; cell = state->next_cell(cell)) {
-     state->set_type_at(cell, state->bottom_type());
-   }
-diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/ostream.cpp openjdk/hotspot/src/share/vm/utilities/ostream.cpp
---- openjdk.orig/hotspot/src/share/vm/utilities/ostream.cpp	2011-03-14 22:09:03.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/utilities/ostream.cpp	2011-03-15 23:16:13.990549499 +0000
-@@ -915,7 +915,7 @@
-   server.sin_port = htons(port);
- 
-   server.sin_addr.s_addr = inet_addr(ip);
--  if (server.sin_addr.s_addr == (uint32_t)-1) {
-+  if (server.sin_addr.s_addr == (in_addr_t)-1) {
-     struct hostent* host = os::get_host_by_name((char*)ip);
-     if (host != NULL) {
-       memcpy(&server.sin_addr, host->h_addr_list[0], host->h_length);
--- a/patches/icedtea-sources.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
---- openjdk.orig/jdk/make/common/Release.gmk	2009-11-11 03:12:50.000000000 +0000
-+++ openjdk/jdk/make/common/Release.gmk	2009-11-11 03:16:17.000000000 +0000
-@@ -313,7 +313,12 @@
- 	org/omg				\
- 	org/w3c/dom			\
- 	org/xml/sax			\
--	sunw
-+	sunw				\
-+	sun/applet			\
-+	netscape			\
-+	net				\
-+	javax/jnlp
-+
- #
- # Directories where sources may be found.  If a file with the same path
- # name exists in more than one of these places, the one found last on this
--- a/patches/icedtea-sparc-trapsfix.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp.orig	2010-01-16 23:19:45.703450297 +0000
-+++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2010-01-16 23:21:23.942337146 +0000
-@@ -25,7 +25,8 @@
- #include "incls/_precompiled.incl"
- #include "incls/_assembler_linux_sparc.cpp.incl"
- 
--#include <asm-sparc/traps.h>
-+// always found in asm/ with merged sparc/sparc64 headers
-+#include <asm/traps.h>
- 
- void MacroAssembler::read_ccr_trap(Register ccr_save) {
-   // No implementation
--- a/patches/icedtea-sunsrc.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
---- openjdk.orig/jdk/make/common/Release.gmk	2010-08-27 19:16:10.000000000 +0100
-+++ openjdk/jdk/make/common/Release.gmk	2010-08-31 18:26:34.688231634 +0100
-@@ -345,8 +345,6 @@
- # Bug 5008685 - exclude jconsole from sun/tools
- #
- TOOLS = \
--	META-INF/services/com.sun.jdi.connect.Connector \
--	META-INF/services/com.sun.jdi.connect.spi.TransportService \
- 	sun/tools/asm		\
- 	sun/tools/jar		\
- 	sun/tools/java		\
-@@ -389,8 +387,6 @@
- 	com/sun/tools/corba     \
- 	com/sun/tools/internal/xjc       \
- 	com/sun/tools/internal/ws       \
--	META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
--	META-INF/services/com.sun.tools.xjc.Plugin \
- 	com/sun/istack/internal/tools       \
- 	com/sun/istack/internal/ws       \
-         com/sun/codemodel       \
-@@ -401,7 +397,6 @@
- 	com/sun/xml/internal/dtdparser \
- 	com/sun/tools/jdi	\
- 	com/sun/tools/script/shell	\
--	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
- 	com/sun/tools/attach	\
- 	sun/tools/attach	\
- 	sun/tools/jstack        \
-@@ -565,10 +560,6 @@
- 	$(ECHO) "com/sun/source/" >> $@
- 	$(ECHO) "com/sun/istack/internal/tools/" >> $@
- 	$(ECHO) "com/sun/istack/internal/ws/" >> $@
--	$(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@
--	$(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@
--	$(ECHO) "META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory" >> $@
--	$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
- 	$(ECHO) "com/sun/tools/" >> $@
- 	$(ECHO) "sun/jvmstat/" >> $@
- 	$(ECHO) "sun/nio/cs/ext/" >> $@
-@@ -611,7 +602,6 @@
- 	$(ECHO) "javax/crypto/" >> $@
- 	$(ECHO) "sun/security/internal/" >> $@
- 	$(ECHO) "com/sun/crypto/provider/" >> $@
--	$(ECHO) "META-INF/services/com.sun.tools.attach.spi.AttachProvider" >> $@
- 	$(ECHO) "com/sun/tools/attach/" >> $@
- 	$(ECHO) "org/relaxng/datatype/" >> $@
- 	$(ECHO) "com/sun/codemodel/" >> $@
-@@ -645,6 +635,10 @@
- 	    $(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
- 		-o  $@.temp $(ABS_LIBDIR)/classlist $(NOT_RT_JAR_LIST) . )
- 	$(MV) $@.temp $@
-+	$(CAT) $@ | $(GREP) "^sun" | $(GREP) "class" | $(GREP) -v '\$$' \
-+	  > $(ABS_TEMPDIR)/sun_classes_list
-+	sed 's/\.class/\.java/' < $(ABS_TEMPDIR)/sun_classes_list \
-+	  > $(ABS_TEMPDIR)/sun_sources_list
- 	@($(CD) $(CLASSBINDIR) && $(java-vm-cleanup))
- 
- # Create the rt.jar file list & non-class files list
--- a/patches/icedtea-systemtap.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/dtrace.make openjdk/hotspot/make/linux/makefiles/dtrace.make
---- openjdk.orig/hotspot/make/linux/makefiles/dtrace.make	2010-07-29 21:54:46.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/dtrace.make	2011-03-16 20:52:47.269527251 +0000
-@@ -25,3 +25,7 @@
- # Linux does not build jvm_db
- LIBJVM_DB =
- 
-+# But it does have a Systemtap dtrace compatible sys/sdt.h
-+CFLAGS += -DDTRACE_ENABLED
-+
-+# It doesn't support HAVE_DTRACE_H though.
-diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp
---- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp	2011-03-14 22:09:03.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/prims/jni.cpp	2011-03-16 20:52:47.277527381 +0000
-@@ -1817,10 +1817,7 @@
- JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \
-   JNIWrapper("Set" XSTR(Result) "Field"); \
- \
--  HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \
--    ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
--  HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \
--    ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
-+  FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \
- \
-   oop o = JNIHandles::resolve_non_null(obj); \
-   klassOop k = o->klass(); \
-@@ -1994,10 +1991,7 @@
- \
- JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \
-   JNIWrapper("SetStatic" XSTR(Result) "Field"); \
--  HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\
--    ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
--  HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \
--    ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
-+  FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \
- \
-   JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \
-   assert(id->is_static_field_id(), "invalid static field id"); \
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2011-03-16 20:51:33.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2011-03-16 20:52:47.277527381 +0000
-@@ -2634,16 +2634,16 @@
-       FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false);
-       FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true);
-     } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) {
--#ifdef SOLARIS
-+#ifdef DTRACE_ENABLED
-       FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true);
-       FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true);
-       FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true);
-       FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true);
--#else // ndef SOLARIS
-+#else // ndef DTRACE_ENABLED
-       jio_fprintf(defaultStream::error_stream(),
--                  "ExtendedDTraceProbes flag is only applicable on Solaris\n");
-+                  "ExtendedDTraceProbes flag is only applicable on dtrace enabled builds\n");
-       return JNI_EINVAL;
--#endif // ndef SOLARIS
-+#endif // ndef DTRACE_ENABLED
- #ifdef ASSERT
-     } else if (match_option(option, "-XX:+FullGCALot", &tail)) {
-       FLAG_SET_CMDLINE(bool, FullGCALot, true);
-diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp openjdk/hotspot/src/share/vm/utilities/dtrace.hpp
---- openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp	2011-03-14 22:09:03.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp	2011-03-16 20:53:58.314683506 +0000
-@@ -1,5 +1,6 @@
- /*
-  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
-+ * Copyright 2009 Red Hat, Inc.
-  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-  *
-  * This code is free software; you can redistribute it and/or modify it
-@@ -25,7 +26,7 @@
- #ifndef SHARE_VM_UTILITIES_DTRACE_HPP
- #define SHARE_VM_UTILITIES_DTRACE_HPP
- 
--#if defined(SOLARIS) && defined(DTRACE_ENABLED)
-+#if defined(DTRACE_ENABLED)
- 
- #include <sys/sdt.h>
- 
-@@ -36,7 +37,7 @@
- #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \
-   do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0)
- 
--#else // ndef SOLARIS || ndef DTRACE_ENABLED
-+#else // ndef DTRACE_ENABLED
- 
- #define DTRACE_ONLY(x)
- #define NOT_DTRACE(x) x
-@@ -47,11 +48,18 @@
- #define DTRACE_PROBE3(a,b,c,d,e) {;}
- #define DTRACE_PROBE4(a,b,c,d,e,f) {;}
- #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;}
-+#define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;}
-+#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;}
-+#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;}
-+#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;}
-+#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;}
- 
- #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
- 
- #endif
- 
-+#if defined(SOLARIS)
-+// Solaris dtrace needs actual extern function decls.
- #define HS_DTRACE_PROBE_FN(provider,name)\
-   __dtrace_##provider##___##name
- 
-@@ -59,6 +67,11 @@
-   DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args)
- #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \
-   DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args)
-+#else
-+// Systemtap dtrace compatible probes on GNU/Linux don't.
-+#define HS_DTRACE_PROBE_DECL_N(provider,name,args)
-+#define HS_DTRACE_PROBE_CDECL_N(provider,name,args)
-+#endif 
- 
- /* Dtrace probe declarations */
- #define HS_DTRACE_PROBE_DECL(provider,name) \
-@@ -97,6 +110,8 @@
-     uintptr_t,uintptr_t,uintptr_t))
- 
- /* Dtrace probe definitions */
-+#if defined(SOLARIS)
-+// Solaris dtrace uses actual function calls.
- #define HS_DTRACE_PROBE_N(provider,name, args) \
-   DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args)
- 
-@@ -132,5 +147,31 @@
-   HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
-     (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
-     (uintptr_t)a8,(uintptr_t)a9))
-+#else
-+// Systemtap dtrace compatible probes on GNU/Linux use direct macros.
-+#define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name)
-+#define HS_DTRACE_PROBE0(provider,name)\
-+  DTRACE_PROBE(provider,name)
-+#define HS_DTRACE_PROBE1(provider,name,a0)\
-+  DTRACE_PROBE1(provider,name,a0)
-+#define HS_DTRACE_PROBE2(provider,name,a0,a1)\
-+  DTRACE_PROBE2(provider,name,a0,a1)
-+#define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\
-+  DTRACE_PROBE3(provider,name,a0,a1,a2)
-+#define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\
-+  DTRACE_PROBE4(provider,name,a0,a1,a2,a3)
-+#define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\
-+  DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)
-+#define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\
-+  DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)
-+#define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\
-+  DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)
-+#define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\
-+  DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)
-+#define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
-+  DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
-+#define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
-+  DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
-+#endif
- 
- #endif // SHARE_VM_UTILITIES_DTRACE_HPP
--- a/patches/icedtea-testenv.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-diff -Nru openjdk.orig/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java openjdk/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java
---- openjdk.orig/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2010-07-29 21:56:30.000000000 +0100
-+++ openjdk/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2010-09-01 16:45:06.244592103 +0100
-@@ -39,7 +39,7 @@
-     static void test1() throws Exception {
-         InetAddress bogus = InetAddress.getByName("0.0.0.0");
-         InetSocketAddress saddr = new InetSocketAddress(
--            InetAddress.getByName(TestUtil.HOST), 23);
-+            InetAddress.getByName(TestUtil.HOST), 7);
- 
-         //Test1: connect only
-         SocketChannel sc = SocketChannel.open();
-diff -Nru openjdk.orig/jdk/test/java/nio/channels/TestUtil.java openjdk/jdk/test/java/nio/channels/TestUtil.java
---- openjdk.orig/jdk/test/java/nio/channels/TestUtil.java	2010-07-29 21:56:30.000000000 +0100
-+++ openjdk/jdk/test/java/nio/channels/TestUtil.java	2010-09-01 16:45:06.244592103 +0100
-@@ -36,9 +36,9 @@
- 
-     // Test hosts used by the channels tests - change these when
-     // executing in a different network.
--    public static final String HOST = "javaweb.sfbay.sun.com";
--    public static final String REFUSING_HOST = "jano1.sfbay.sun.com";
--    public static final String FAR_HOST = "irejano.ireland.sun.com";
-+    public static final String HOST = "icedtea.classpath.org";
-+    public static final String REFUSING_HOST = "ns1.gnu.org";
-+    public static final String FAR_HOST = "developer.classpath.org";
-     public static final String UNRESOLVABLE_HOST = "blah-blah.blah-blah.blah";
- 
-     private TestUtil() { }
-diff -Nru openjdk.orig/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh openjdk/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh
---- openjdk.orig/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2010-07-29 21:56:39.000000000 +0100
-+++ openjdk/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2010-09-01 16:45:06.252591410 +0100
-@@ -26,14 +26,14 @@
- 
- # @test
- # @bug 4763315
--# @build CanonicalName Lookup 
-+# @build CanonicalName Lookup
- # @run shell/timeout=120 cname.sh
- # @summary Test DNS provider's handling of CNAME records
- 
- 
- # The host that we try to resolve
- 
--HOST=webcache.sfbay.sun.com
-+HOST=developer.classpath.org
- 
- # fail gracefully if DNS is not configured or there 
- # isn't a CNAME record.
--- a/patches/icedtea-tests-jdk.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-diff -Nru openjdk.orig/jdk/test/sun/tools/native2ascii/NativeErrors.java openjdk/jdk/test/sun/tools/native2ascii/NativeErrors.java
---- openjdk.orig/jdk/test/sun/tools/native2ascii/NativeErrors.java	2009-05-12 23:26:50.000000000 +0100
-+++ openjdk/jdk/test/sun/tools/native2ascii/NativeErrors.java	2009-05-12 23:28:57.000000000 +0100
-@@ -89,8 +89,8 @@
-         }
-         //System.out.println("received: " + errorReceived);
-         //System.out.println("expected: " + errorExpected);
--        if (!errorReceived.endsWith(errorExpected))
--            throw new RuntimeException("Native2ascii bad arg error broken.");
-+        if (errorReceived == null || !errorReceived.endsWith(errorExpected))
-+            throw new RuntimeException("Native2ascii " + errorExpected + " broken.");
-     }
- 
-     private static String[] getComString(String arg2) {
--- a/patches/icedtea-text-relocations.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
---- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2008-07-17 08:40:27.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/gcc.make	2008-07-21 23:10:50.000000000 +0100
-@@ -46,7 +46,11 @@
- # Compiler flags
- 
- # position-independent code
-+ifneq ($(filter ppc ppc64 s390 s390x sparc sparc64 sparcv9,$(ZERO_LIBARCH)),)
- PICFLAG = -fPIC
-+else
-+PICFLAG = -fpic
-+endif
- 
- VM_PICFLAG/LIBJVM = $(PICFLAG)
- VM_PICFLAG/AOUT   =
--- a/patches/icedtea-update-bootclasspath.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/os.cpp openjdk/hotspot/src/share/vm/runtime/os.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/os.cpp	2011-04-20 04:39:42.000000000 +0100
-+++ openjdk/hotspot/src/share/vm/runtime/os.cpp	2011-04-21 20:50:09.475567200 +0100
-@@ -1079,6 +1079,9 @@
-         "%/lib/jsse.jar:"
-         "%/lib/jce.jar:"
-         "%/lib/charsets.jar:"
-+        "%/lib/netx.jar:"
-+        "%/lib/plugin.jar:"
-+        "%/lib/rhino.jar:"
-         "%/classes";
-     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
-     if (sysclasspath == NULL) return false;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/javafiles.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,164 @@
+diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_encoding.jmk	2011-03-16 20:45:33.914471077 +0000
+@@ -62,7 +62,6 @@
+ 	com/sun/corba/se/impl/encoding/TypeCodeInputStream.java \
+ 	com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java \
+ 	com/sun/corba/se/impl/encoding/TypeCodeReader.java \
+-	com/sun/corba/se/impl/encoding/WrapperInputStream.java
+-
+-
+-
++	com/sun/corba/se/impl/encoding/WrapperInputStream.java \
++	com/sun/corba/se/impl/encoding/IDLJavaSerializationInputStream.java \
++	com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java
+diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_ior.jmk	2011-03-16 20:45:33.922471207 +0000
+@@ -66,4 +66,5 @@
+ 	com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java \
+ 	com/sun/corba/se/impl/ior/iiop/MaxStreamFormatVersionComponentImpl.java \
+ 	com/sun/corba/se/impl/ior/iiop/RequestPartitioningComponentImpl.java \
+-	com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java
++	com/sun/corba/se/impl/ior/iiop/ORBTypeComponentImpl.java \
++	com/sun/corba/se/impl/ior/iiop/JavaSerializationComponent.java
+diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk	2011-03-16 20:45:33.922471207 +0000
+@@ -81,4 +81,5 @@
+ 	com/sun/corba/se/impl/orbutil/graph/Node.java \
+ 	com/sun/corba/se/impl/orbutil/graph/NodeData.java \
+ 	com/sun/corba/se/impl/orbutil/graph/Graph.java \
+-	com/sun/corba/se/impl/orbutil/graph/GraphImpl.java 
++	com/sun/corba/se/impl/orbutil/graph/GraphImpl.java \
++	com/sun/corba/se/impl/orbutil/GetPropertyAction.java
+diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_protocol.jmk	2011-03-16 20:45:33.922471207 +0000
+@@ -81,5 +81,5 @@
+ 	com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_1.java \
+ 	com/sun/corba/se/impl/protocol/giopmsgheaders/RequestMessage_1_2.java \
+ 	com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddress.java \
+-	com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java
+-
++	com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java \
++	com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyOrReplyMessage.java
+diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_monitoring.jmk	2011-03-16 20:45:33.922471207 +0000
+@@ -30,6 +30,7 @@
+ 	com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java \
+ 	com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java \
+ 	com/sun/corba/se/spi/monitoring/MonitoringFactories.java \
++	com/sun/corba/se/spi/monitoring/MonitoringConstants.java \
+ 	com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java \
+ 	com/sun/corba/se/spi/monitoring/MonitoredObject.java \
+ 	com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java \
+diff -Nru openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk
+--- openjdk.orig/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2010-07-29 21:54:09.000000000 +0100
++++ openjdk/corba/make/com/sun/corba/minclude/com_sun_corba_se_spi_presentation_rmi.jmk	2011-03-16 20:45:33.922471207 +0000
+@@ -29,5 +29,6 @@
+ 	com/sun/corba/se/spi/presentation/rmi/IDLNameTranslator.java \
+ 	com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java \
+ 	com/sun/corba/se/spi/presentation/rmi/PresentationManager.java \
++	com/sun/corba/se/spi/presentation/rmi/PresentationDefaults.java \
+ 	com/sun/corba/se/spi/presentation/rmi/StubAdapter.java
+ 
+diff -Nru openjdk.orig/jdk/make/java/java/FILES_java.gmk openjdk/jdk/make/java/java/FILES_java.gmk
+--- openjdk.orig/jdk/make/java/java/FILES_java.gmk	2011-03-14 22:10:30.000000000 +0000
++++ openjdk/jdk/make/java/java/FILES_java.gmk	2011-03-16 20:45:33.922471207 +0000
+@@ -29,6 +29,80 @@
+ # will generate header files
+ #
+ JAVA_JAVA_java = \
++    java/lang/reflect/AccessibleObject.java \
++    java/lang/reflect/AnnotatedElement.java \
++    java/lang/reflect/Array.java \
++    java/lang/reflect/Constructor.java \
++    java/lang/reflect/Field.java \
++    java/lang/reflect/GenericArrayType.java \
++    java/lang/reflect/GenericDeclaration.java \
++    java/lang/reflect/GenericSignatureFormatError.java \
++    java/lang/reflect/InvocationHandler.java \
++    java/lang/reflect/InvocationTargetException.java \
++    java/lang/reflect/MalformedParameterizedTypeException.java \
++    java/lang/reflect/Member.java \
++    java/lang/reflect/Method.java \
++    java/lang/reflect/Modifier.java \
++    java/lang/reflect/package-info.java \
++    java/lang/reflect/ParameterizedType.java \
++    java/lang/reflect/Proxy.java \
++    java/lang/reflect/ReflectAccess.java \
++    java/lang/reflect/ReflectPermission.java \
++    java/lang/reflect/Type.java \
++    java/lang/reflect/TypeVariable.java \
++    java/lang/reflect/UndeclaredThrowableException.java \
++    java/lang/reflect/WildcardType.java \
++    java/lang/ref/Finalizer.java \
++    java/lang/ref/FinalReference.java \
++    java/lang/ref/PhantomReference.java \
++    java/lang/ref/Reference.java \
++    java/lang/ref/ReferenceQueue.java \
++    java/lang/ref/SoftReference.java \
++    java/lang/ref/WeakReference.java \
++    java/lang/management/ClassLoadingMXBean.java \
++    java/lang/management/CompilationMXBean.java \
++    java/lang/management/GarbageCollectorMXBean.java \
++    java/lang/management/LockInfo.java \
++    java/lang/management/ManagementFactory.java \
++    java/lang/management/ManagementPermission.java \
++    java/lang/management/MemoryManagerMXBean.java \
++    java/lang/management/MemoryMXBean.java \
++    java/lang/management/MemoryNotificationInfo.java \
++    java/lang/management/MemoryPoolMXBean.java \
++    java/lang/management/MemoryType.java \
++    java/lang/management/MemoryUsage.java \
++    java/lang/management/MonitorInfo.java \
++    java/lang/management/OperatingSystemMXBean.java \
++    java/lang/management/RuntimeMXBean.java \
++    java/lang/management/ThreadInfo.java \
++    java/lang/management/ThreadMXBean.java \
++    java/lang/instrument/ClassDefinition.java \
++    java/lang/instrument/ClassFileTransformer.java \
++    java/lang/instrument/IllegalClassFormatException.java \
++    java/lang/instrument/Instrumentation.java \
++    java/lang/instrument/UnmodifiableClassException.java \
++    java/lang/annotation/AnnotationFormatError.java \
++    java/lang/annotation/Annotation.java \
++    java/lang/annotation/AnnotationTypeMismatchException.java \
++    java/lang/annotation/Documented.java \
++    java/lang/annotation/ElementType.java \
++    java/lang/annotation/IncompleteAnnotationException.java \
++    java/lang/annotation/Inherited.java \
++    java/lang/annotation/package-info.java \
++    java/lang/annotation/Retention.java \
++    java/lang/annotation/RetentionPolicy.java \
++    java/lang/annotation/Target.java \
++    java/io/IOError.java \
++    java/lang/Deprecated.java \
++    java/lang/Iterable.java \
++    java/util/RandomAccess.java \
++    java/lang/CharacterData00.java \
++    java/lang/CharacterData01.java \
++    java/lang/CharacterData02.java \
++    java/lang/CharacterData0E.java \
++    java/lang/CharacterDataLatin1.java \
++    java/lang/CharacterDataPrivateUse.java \
++    java/lang/CharacterDataUndefined.java \
+     java/lang/Object.java \
+     java/lang/AutoCloseable.java \
+     java/lang/Class.java \
+@@ -139,13 +213,6 @@
+     java/lang/Override.java \
+     java/lang/SafeVarargs.java \
+     java/lang/SuppressWarnings.java \
+-    java/lang/ref/Reference.java \
+-        java/lang/ref/SoftReference.java \
+-	java/lang/ref/WeakReference.java \
+-	java/lang/ref/FinalReference.java \
+-	java/lang/ref/PhantomReference.java \
+-    java/lang/ref/ReferenceQueue.java \
+-    java/lang/ref/Finalizer.java \
+     java/util/BitSet.java \
+     java/util/Calendar.java \
+         java/util/GregorianCalendar.java \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/jpegclasses.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,647 @@
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java	2008-03-31 18:04:57.000000000 -0400
+@@ -0,0 +1,51 @@
++/* ImageFormatException.java
++   Copyright (C) 2007 Matthew Flaschen
++
++   This file is part of IcedTea
++
++   IcedTea is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   IcedTea is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++package com.sun.image.codec.jpeg;
++
++public class ImageFormatException extends RuntimeException
++{
++	public ImageFormatException()
++	{
++		this("");
++	}
++
++	public ImageFormatException(String s)
++	{
++		super(s);
++	}
++}
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java	2008-03-31 18:04:57.000000000 -0400
+@@ -0,0 +1,146 @@
++/* JPEGCodec.java -- 
++   Copyright (C) 2007 Free Software Foundation, Inc.
++   Copyright (C) 2007 Matthew Flaschen
++
++   This file is part of GNU Classpath.
++
++   GNU Classpath is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   GNU Classpath is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++package com.sun.image.codec.jpeg;
++
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.io.IOException;
++
++import java.awt.image.BufferedImage;
++import java.awt.image.Raster;
++
++import javax.imageio.*;
++import javax.imageio.stream.*;
++import javax.imageio.plugins.jpeg.*;
++
++import java.util.Iterator;
++
++public class JPEGCodec
++{
++
++	public static JPEGImageDecoder createJPEGDecoder(InputStream is)
++	{
++		return new ImageIOJPEGImageDecoder(is);
++	}
++
++	public static JPEGImageEncoder createJPEGEncoder(OutputStream os)
++	{
++		return null;
++	}
++
++	public static JPEGImageDecoder createJPEGDecoder(InputStream src, JPEGDecodeParam jdp)
++	{
++		return null; 
++	}
++        
++	public static JPEGImageEncoder createJPEGEncoder(OutputStream dest, JPEGEncodeParam jep)
++	{
++		return null;
++	}
++        
++	public static JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi)
++	{
++		return null;
++	}
++        
++	public static JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands, int colorID)
++	{
++		return null;
++	}
++		
++	public static JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam jdp)
++	{
++		return null;
++	}
++        
++	public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras, int colorID)
++	{
++		return null;
++	}
++        
++
++	private static class ImageIOJPEGImageDecoder implements JPEGImageDecoder
++	{
++		
++		private static final String JPGMime = "image/jpeg";
++    
++		private ImageReader JPGReader;
++		
++		private InputStream in;
++		
++		private ImageIOJPEGImageDecoder (InputStream newIs)
++		{
++			in = newIs;
++			
++			Iterator<ImageReader> JPGReaderIter = ImageIO.getImageReadersByMIMEType(JPGMime);
++			if(JPGReaderIter.hasNext())
++			{
++				JPGReader  = JPGReaderIter.next();
++			}
++			
++			JPGReader.setInput(new MemoryCacheImageInputStream(in));
++		}
++
++		public BufferedImage decodeAsBufferedImage() throws IOException, ImageFormatException
++		{
++			return JPGReader.read(0);
++		}
++		
++		public Raster decodeAsRaster() throws IOException, ImageFormatException
++		{
++			return JPGReader.readRaster(0, null);
++		}
++		
++		public InputStream getInputStream()
++		{
++			return in;
++		}
++		
++		public JPEGDecodeParam getJPEGDecodeParam()
++		{
++			return null;
++		}
++
++		public void setJPEGDecodeParam(JPEGDecodeParam jdp)
++		{
++			return;
++		}
++
++	}
++}
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java	2008-03-31 18:04:57.000000000 -0400
+@@ -0,0 +1,50 @@
++/* JPEGImageDecoder.java -- 
++   Copyright (C) 2007 Free Software Foundation, Inc.
++   Copyright (C) 2007 Matthew Flaschen
++
++   This file is part of GNU Classpath.
++
++   GNU Classpath is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   GNU Classpath is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++package com.sun.image.codec.jpeg;
++
++public interface JPEGDecodeParam
++{
++
++  public static final int COLOR_ID_UNKNOWN = 0;
++  public static final int COLOR_ID_RGBA = 1;
++  public static final int COLOR_ID_RGB = 2;
++  public static final int COLOR_ID_GRAY = 3;
++  public static final int COLOR_ID_YCbCrA = 4;
++  public static final int COLOR_ID_YCbCr = 5;
++}
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java	2008-03-31 18:04:57.000000000 -0400
+@@ -0,0 +1,139 @@
++/* JPEGEncodeParam.java -- 
++   Copyright (C) 2007 Free Software Foundation, Inc.
++
++   This file is part of GNU Classpath.
++
++   GNU Classpath is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   GNU Classpath is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++package com.sun.image.codec.jpeg;
++
++public class JPEGEncodeParam
++{
++	public static final int COLOR_ID_UNKNOWN = 0;
++	public static final int COLOR_ID_RGBA = 1;
++	public static final int COLOR_ID_RGB = 2;
++	public static final int COLOR_ID_GRAY = 3;
++	public static final int COLOR_ID_YCbCrA = 4;
++	public static final int COLOR_ID_CMYK = 5;
++	public static final int COLOR_ID_YCbCr = 6;
++
++	public JPEGEncodeParam()
++	{
++	}
++
++	public void setQuality(float i, boolean b)
++        {
++        }	
++
++	public void setQuality(int i, boolean b)
++	{
++	}
++
++	public JPEGEncodeParam clone()
++	{
++	  return null;
++	}
++
++	public void setTableInfoValid(boolean b)
++	{
++	}
++
++	public void setImageInfoValid(boolean b)
++	{
++	}
++
++	public int getHorizontalSubsampling(int i)
++	{
++	  return 0;
++	}
++
++	public int getVerticalSubsampling(int i)
++        {
++          return 0;
++        }
++
++	public int getWidth()
++	{
++	  return 0;
++	}
++
++	public int getHeight()
++	{
++	  return 0;
++	}
++
++	public int getDensityUnit()
++        {
++          return 0;
++        }
++
++        public int getXDensity()
++        {
++          return 0;
++        }
++
++        public int getYDensity()
++        {
++          return 0;
++        }
++
++        public int getRestartInterval()
++        {
++          return 0;
++        }
++
++        public JPEGQTable getQTable(int i)
++        {
++          return new JPEGQTable();
++        }	
++
++	public void setDensityUnit(int i)
++	{
++	}
++
++	public void setXDensity(int i)
++	{
++	}
++
++	public void setYDensity(int i)
++	{
++	}
++
++	public void setRestartInterval(int i)
++	{
++	}
++
++	public void setQTable(int i, JPEGQTable jqt)
++	{
++	}
++}
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java	2008-03-31 18:04:57.000000000 -0400
+@@ -0,0 +1,60 @@
++/* JPEGImageDecoder.java -- 
++   Copyright (C) 2007 Free Software Foundation, Inc.
++   Copyright (C) 2007 Matthew Flaschen
++
++   This file is part of GNU Classpath.
++
++   GNU Classpath is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   GNU Classpath is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++
++package com.sun.image.codec.jpeg;
++import java.awt.image.BufferedImage;
++import java.awt.image.Raster;
++
++import java.io.InputStream;
++import java.io.IOException;
++
++
++public interface JPEGImageDecoder
++{
++
++	public BufferedImage decodeAsBufferedImage() throws IOException, ImageFormatException;
++	
++	public Raster decodeAsRaster() throws IOException, ImageFormatException;
++	
++	public InputStream getInputStream();
++
++	public JPEGDecodeParam getJPEGDecodeParam();
++
++	public void setJPEGDecodeParam(JPEGDecodeParam jdp);
++}
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java	2008-03-31 18:04:57.000000000 -0400
+@@ -0,0 +1,67 @@
++/* JPEGImageEncoder.java -- 
++   Copyright (C) 2007 Free Software Foundation, Inc.
++
++   This file is part of GNU Classpath.
++
++   GNU Classpath is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   GNU Classpath is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++package com.sun.image.codec.jpeg;
++
++import com.sun.image.codec.jpeg.*;
++import java.awt.image.BufferedImage;
++import java.awt.image.Raster;
++
++public class JPEGImageEncoder
++{
++	public JPEGImageEncoder()
++	{
++	}
++	
++	public JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi)
++	{
++		return null;
++	}
++
++	public void encode(BufferedImage bi, JPEGEncodeParam p)
++	{
++	}
++
++	public void encode(Raster bi)
++        {
++        }
++
++	public void encode(BufferedImage bi)
++        {
++        }
++
++}
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java	2008-03-31 18:04:57.000000000 -0400
+@@ -0,0 +1,44 @@
++/* JPEGQTable.java -- 
++   Copyright (C) 2007 Free Software Foundation, Inc.
++   Copyright (C) 2007 Matthew Flaschen
++
++   This file is part of GNU Classpath.
++
++   GNU Classpath is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   GNU Classpath is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++package com.sun.image.codec.jpeg;
++
++public class JPEGQTable
++{
++
++}
+diff -ruN openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java
+--- openjdkold/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java	1969-12-31 19:00:00.000000000 -0500
++++ openjdk/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java	2008-03-31 19:38:37.000000000 -0400
+@@ -0,0 +1,58 @@
++/* TruncatedFileException.java
++   Copyright (C) 2007 Matthew Flaschen
++
++   This file is part of IcedTea
++
++   IcedTea is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   IcedTea is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with GNU Classpath; see the file COPYING.  If not, write to the
++   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.
++
++   Linking this library statically or dynamically with other modules is
++   making a combined work based on this library.  Thus, the terms and
++   conditions of the GNU General Public License cover the whole
++   combination.
++
++   As a special exception, the copyright holders of this library give you
++   permission to link this library with independent modules to produce an
++   executable, regardless of the license terms of these independent
++   modules, and to copy and distribute the resulting executable under
++   terms of your choice, provided that you also meet, for each linked
++   independent module, the terms and conditions of the license of that
++   module.  An independent module is a module which is not derived from
++   or based on this library.  If you modify this library, you may extend
++   this exception to your version of the library, but you are not
++   obligated to do so.  If you do not wish to do so, delete this
++   exception statement from your version. */
++
++package com.sun.image.codec.jpeg;
++
++import java.awt.image.BufferedImage;
++
++public class TruncatedFileException extends RuntimeException
++{
++	public TruncatedFileException()
++	{
++		this("");
++	}
++
++	public TruncatedFileException(String s)
++	{
++		super(s);
++	}
++
++	public BufferedImage getBufferedImage()
++	{
++	  return null;
++	}
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/jvmtiEnv.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,12 @@
+--- openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp.old	2009-02-26 17:18:35.000000000 +0000
++++ openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp	2009-02-26 17:16:59.000000000 +0000
+@@ -2702,6 +2702,9 @@
+   (*entry_count_ptr) = num_entries;
+   (*table_ptr) = jvmti_table;
+ 
++  if (num_entries == 0)
++    return JVMTI_ERROR_ABSENT_INFORMATION;
++
+   return JVMTI_ERROR_NONE;
+ } /* end GetLineNumberTable */
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/lc_ctype.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,31 @@
+diff -Nru openjdk.orig/jdk/src/solaris/native/java/lang/java_props_md.c openjdk/jdk/src/solaris/native/java/lang/java_props_md.c
+--- openjdk.orig/jdk/src/solaris/native/java/lang/java_props_md.c	2011-03-14 22:10:33.000000000 +0000
++++ openjdk/jdk/src/solaris/native/java/lang/java_props_md.c	2011-03-15 23:40:55.950143541 +0000
+@@ -119,7 +119,7 @@
+ 
+ static int ParseLocale(int cat, char ** std_language, char ** std_script,
+                        char ** std_country, char ** std_variant, char ** std_encoding) {
+-    char temp[64];
++    char *temp;
+     char *language = NULL, *country = NULL, *variant = NULL,
+          *encoding = NULL;
+     char *p, encoding_variant[64];
+@@ -163,6 +163,7 @@
+      * <country name>, <encoding name>, and <variant name> are optional.
+      */
+ 
++    temp = (char*) malloc(strlen(lc)+1);
+     strcpy(temp, lc);
+ 
+     /* Parse the language, country, encoding, and variant from the
+@@ -301,6 +302,10 @@
+ #endif
+     }
+ 
++	
++    /* Free temp */
++    free(temp);
++
+     return 1;
+ }
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/libraries.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,1277 @@
+diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
+--- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2011-04-20 04:40:20.000000000 +0100
++++ openjdk/jdk/make/com/sun/java/pack/Makefile	2011-04-21 09:00:44.681761082 +0100
+@@ -74,12 +74,10 @@
+ 	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
+ 	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
+ 
+-  ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+-  OTHER_CXXFLAGS += $(ZINCLUDE)
+-  LDDFLAGS += $(ZIPOBJS)
++  OTHER_LDLIBS += -lz
+ else
+   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
+-  OTHER_LDLIBS += $(JVMLIB)
++  OTHER_LDLIBS += -lz $(JVMLIB)
+ endif
+ 
+ CXXFLAGS_DBG += -DFULL
+@@ -98,12 +96,12 @@
+   RES = $(OBJDIR)/$(PGRM).res
+ else
+   LDOUTPUT = -o #Have a space 
+-  LDDFLAGS += -lc
++  LDDFLAGS += -lz -lc
+   OTHER_LDLIBS  += $(LIBCXX)
+ # setup the list of libraries to link in...
+ ifeq ($(PLATFORM), linux)
+ ifeq ("$(CC_VER_MAJOR)", "3")
+-  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
++  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
+ endif
+ endif #LINUX
+ endif #PLATFORM
+diff -Nru openjdk.orig/jdk/make/common/Program.gmk openjdk/jdk/make/common/Program.gmk
+--- openjdk.orig/jdk/make/common/Program.gmk	2011-04-20 04:40:20.000000000 +0100
++++ openjdk/jdk/make/common/Program.gmk	2011-04-21 09:02:42.995660993 +0100
+@@ -83,6 +83,7 @@
+ 	endif
+     endif
+     ifeq ($(PLATFORM), linux)
++        LDFLAGS += -lz
+ 	LDFLAGS += $(LDFLAG_Z_ORIGIN)
+ 	LDFLAGS += -Wl,--allow-shlib-undefined
+ 	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
+@@ -239,7 +240,6 @@
+ endif
+ 
+ OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
+-OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
+ 
+ OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
+ VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
+diff -Nru openjdk.orig/jdk/make/java/jli/Makefile openjdk/jdk/make/java/jli/Makefile
+--- openjdk.orig/jdk/make/java/jli/Makefile	2011-04-20 04:40:20.000000000 +0100
++++ openjdk/jdk/make/java/jli/Makefile	2011-04-21 09:00:44.681761082 +0100
+@@ -44,7 +44,6 @@
+ 
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+-ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+ LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
+ LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
+ 
+@@ -69,13 +68,7 @@
+ 	parse_manifest.c \
+ 	version_comp.c \
+ 	wildcard.c \
+-	jli_util.c \
+-	inflate.c \
+-	inftrees.c \
+-	inffast.c \
+-	zadler32.c \
+-	zcrc32.c \
+-	zutil.c
++	jli_util.c
+ 
+ ifneq ($(PLATFORM), windows)
+   FILES_c += ergo.c 
+@@ -105,7 +98,7 @@
+ 	# Note: its important to keep this order meaning -lc is the
+ 	# last library otherwise it could cause compatibility issues
+ 	# by pulling in SUNW_private symbols from libc
+-	LDLIBS = -ldl -lc
++	LDLIBS = -ldl -lz -lc
+ ifeq ($(USE_PTHREADS),true)
+ 	LDLIBS += -lpthread
+ endif # USE_PTHREADS 
+@@ -129,7 +122,6 @@
+ 
+ OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
+ OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
+-OTHER_INCLUDES += -I$(ZIP_SRC)
+ 
+ #
+ # Library to compile.
+@@ -164,4 +156,4 @@
+ #
+ # Add to ambient vpath so we pick up the library files
+ #
+-vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
++vpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC)
+diff -Nru openjdk.orig/jdk/make/java/zip/FILES_c.gmk openjdk/jdk/make/java/zip/FILES_c.gmk
+--- openjdk.orig/jdk/make/java/zip/FILES_c.gmk	2010-07-29 21:55:27.000000000 +0100
++++ openjdk/jdk/make/java/zip/FILES_c.gmk	2011-04-21 09:00:44.681761082 +0100
+@@ -29,16 +29,4 @@
+ 	Deflater.c \
+ 	Inflater.c \
+ 	ZipFile.c \
+-	zip_util.c \
+-	compress.c \
+-	deflate.c \
+-	gzio.c \
+-	infback.c \
+-	inffast.c \
+-	inflate.c \
+-	inftrees.c \
+-	trees.c \
+-	uncompr.c \
+-	zadler32.c \
+-	zcrc32.c \
+-	zutil.c 
++	zip_util.c
+diff -Nru openjdk.orig/jdk/make/java/zip/Makefile openjdk/jdk/make/java/zip/Makefile
+--- openjdk.orig/jdk/make/java/zip/Makefile	2011-04-20 04:40:20.000000000 +0100
++++ openjdk/jdk/make/java/zip/Makefile	2011-04-21 09:00:44.697761341 +0100
+@@ -71,16 +71,10 @@
+ CPPFLAGS += -UDEBUG 
+ endif
+ 
+-CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+ CPPFLAGS += -I$(SHARE_SRC)/native/java/io
+ CPPFLAGS += -I$(PLATFORM_SRC)/native/java/io
+ 
+ #
+-# Add to ambient vpath so we pick up the library files
+-#
+-vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/zlib-$(ZLIB_VERSION)
+-
+-#
+ # Link to JVM library for JVM_Zip* functions
+ #
+-OTHER_LDLIBS = $(JVMLIB)
++OTHER_LDLIBS = $(JVMLIB) -lz
+diff -Nru openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk openjdk/jdk/make/sun/jpeg/FILES_c.gmk
+--- openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk	2010-07-29 21:55:29.000000000 +0100
++++ openjdk/jdk/make/sun/jpeg/FILES_c.gmk	2011-04-21 09:00:44.697761341 +0100
+@@ -25,51 +25,7 @@
+ 
+ FILES_c = \
+ 	imageioJPEG.c \
+-	jpegdecoder.c \
+-	jcomapi.c \
+-	jdapimin.c \
+-	jdapistd.c \
+-	jdcoefct.c \
+-	jdcolor.c \
+-	jddctmgr.c \
+-	jdhuff.c \
+-	jdinput.c \
+-	jdmainct.c \
+-	jdmarker.c \
+-	jdmaster.c \
+-	jdmerge.c \
+-	jdphuff.c \
+-	jdpostct.c \
+-	jdsample.c \
+-	jerror.c \
+-	jidctflt.c \
+-	jidctfst.c \
+-	jidctint.c \
+-	jidctred.c \
+-	jmemmgr.c \
+-	jmemnobs.c \
+-	jquant1.c \
+-	jquant2.c \
+-	jutils.c \
+-	jcapimin.c \
+-	jcapistd.c \
+-	jccoefct.c \
+-	jccolor.c \
+-	jcdctmgr.c \
+-	jchuff.c \
+-	jcinit.c \
+-	jcmainct.c \
+-	jcmarker.c \
+-	jcmaster.c \
+-	jcparam.c \
+-	jcphuff.c \
+-	jcprepct.c \
+-	jcsample.c \
+-	jctrans.c \
+-	jdtrans.c \
+-	jfdctflt.c \
+-	jfdctfst.c \
+-	jfdctint.c
++	jpegdecoder.c
+ 
+ ifndef OPENJDK
+ FILES_c += \
+diff -Nru openjdk.orig/jdk/make/sun/jpeg/Makefile openjdk/jdk/make/sun/jpeg/Makefile
+--- openjdk.orig/jdk/make/sun/jpeg/Makefile	2011-04-20 04:40:21.000000000 +0100
++++ openjdk/jdk/make/sun/jpeg/Makefile	2011-04-21 09:00:44.697761341 +0100
+@@ -80,6 +80,8 @@
+ include $(BUILDDIR)/common/Mapfile-vers.gmk
+ include $(BUILDDIR)/common/Library.gmk
+ 
++LDLIBS += -ldl 
++
+ #
+ # Add to ambient vpath to get files in a subdirectory
+ #
+diff -Nru openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk openjdk/jdk/make/sun/splashscreen/FILES_c.gmk
+--- openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk	2010-07-29 21:55:29.000000000 +0100
++++ openjdk/jdk/make/sun/splashscreen/FILES_c.gmk	2011-04-21 09:00:44.697761341 +0100
+@@ -30,79 +30,5 @@
+ 	splashscreen_impl.c \
+ 	splashscreen_jpeg.c \
+ 	splashscreen_png.c \
+-	splashscreen_sys.c \
+-	png.c \
+-	pngerror.c \
+-	pngget.c \
+-	pngmem.c  \
+-	pngpread.c \
+-	pngread.c \
+-	pngrio.c \
+-	pngrtran.c \
+-	pngrutil.c \
+-	pngset.c \
+-	pngtrans.c \
+-	pngwio.c \
+-	pngwrite.c \
+-	pngwtran.c \
+-	pngwutil.c \
+-	dgif_lib.c \
+-	gif_err.c \
+-	gifalloc.c \
+-	compress.c \
+-	deflate.c \
+-	gzio.c \
+-	infback.c \
+-	inffast.c \
+-	inflate.c \
+-	inftrees.c \
+-	trees.c \
+-	uncompr.c \
+-	zadler32.c \
+-	zcrc32.c \
+-	zutil.c \
+-	jcomapi.c \
+-	jdapimin.c \
+-	jdapistd.c \
+-	jdcoefct.c \
+-	jdcolor.c \
+-	jddctmgr.c \
+-	jdhuff.c \
+-	jdinput.c \
+-	jdmainct.c \
+-	jdmarker.c \
+-	jdmaster.c \
+-	jdmerge.c \
+-	jdphuff.c \
+-	jdpostct.c \
+-	jdsample.c \
+-	jerror.c \
+-	jidctflt.c \
+-	jidctfst.c \
+-	jidctint.c \
+-	jidctred.c \
+-	jmemmgr.c \
+-	jmemnobs.c \
+-	jquant1.c \
+-	jquant2.c \
+-	jutils.c \
+-	jcapimin.c \
+-	jcapistd.c \
+-	jccoefct.c \
+-	jccolor.c \
+-	jcdctmgr.c \
+-	jchuff.c \
+-	jcinit.c \
+-	jcmainct.c \
+-	jcmarker.c \
+-	jcmaster.c \
+-	jcparam.c \
+-	jcphuff.c \
+-	jcprepct.c \
+-	jcsample.c \
+-	jctrans.c \
+-	jdtrans.c \
+-	jfdctflt.c \
+-	jfdctfst.c \
+-	jfdctint.c
++	splashscreen_sys.c
+ 
+diff -Nru openjdk.orig/jdk/make/sun/splashscreen/Makefile openjdk/jdk/make/sun/splashscreen/Makefile
+--- openjdk.orig/jdk/make/sun/splashscreen/Makefile	2011-04-20 04:40:21.000000000 +0100
++++ openjdk/jdk/make/sun/splashscreen/Makefile	2011-04-21 09:00:44.697761341 +0100
+@@ -59,12 +59,12 @@
+ # C Flags
+ #
+ 
+-CFLAGS += -DSPLASHSCREEN
++CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE
+ 
+ ifneq ($(PLATFORM), windows)
+   CFLAGS += -DWITH_X11
+   CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
+-  OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread
++  OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpng -ljpeg -lgif -lz -lpthread
+ else # PLATFORM
+   CFLAGS += -DWITH_WIN32
+   OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll
+@@ -76,14 +76,10 @@
+ #
+ vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/splashscreen
+ vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)
+-vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/giflib
+-vpath %.c   $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+-vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/libpng
+ vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg
+ vpath %.c   $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen
+ 
+ CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen
+-CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+ 
+ # Shun the less than portable MMX assembly code in pnggccrd.c,
+ # and use alternative implementations in C.
+diff -Nru openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
+--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2010-07-29 21:56:11.000000000 +0100
++++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2011-04-21 09:00:44.697761341 +0100
+@@ -89,11 +89,7 @@
+ // bytes and byte arrays
+ 
+ typedef unsigned int uint;
+-#ifdef _LP64
+-typedef unsigned int uLong; // Historical zlib, should be 32-bit.
+-#else
+ typedef unsigned long uLong;
+-#endif
+ #ifdef _MSC_VER
+ typedef LONGLONG        jlong;
+ typedef DWORDLONG       julong;
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c openjdk/jdk/src/share/native/java/util/zip/Adler32.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c	2010-07-29 21:56:11.000000000 +0100
++++ openjdk/jdk/src/share/native/java/util/zip/Adler32.c	2011-04-21 09:00:44.697761341 +0100
+@@ -29,7 +29,7 @@
+ 
+ #include "jni.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ 
+ #include "java_util_zip_Adler32.h"
+ 
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c openjdk/jdk/src/share/native/java/util/zip/CRC32.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c	2010-07-29 21:56:11.000000000 +0100
++++ openjdk/jdk/src/share/native/java/util/zip/CRC32.c	2011-04-21 09:00:44.697761341 +0100
+@@ -29,7 +29,7 @@
+ 
+ #include "jni.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ 
+ #include "java_util_zip_CRC32.h"
+ 
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c openjdk/jdk/src/share/native/java/util/zip/Deflater.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c	2011-03-14 22:10:33.000000000 +0000
++++ openjdk/jdk/src/share/native/java/util/zip/Deflater.c	2011-04-21 09:00:44.697761341 +0100
+@@ -32,7 +32,7 @@
+ #include "jlong.h"
+ #include "jni.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ 
+ #include "java_util_zip_Deflater.h"
+ 
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c openjdk/jdk/src/share/native/java/util/zip/Inflater.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c	2011-03-14 22:10:33.000000000 +0000
++++ openjdk/jdk/src/share/native/java/util/zip/Inflater.c	2011-04-21 09:00:44.697761341 +0100
+@@ -35,7 +35,7 @@
+ #include "jni.h"
+ #include "jvm.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ #include "java_util_zip_Inflater.h"
+ 
+ #define MIN2(x, y)  ((x) < (y) ? (x) : (y))
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c openjdk/jdk/src/share/native/java/util/zip/zip_util.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c	2011-03-14 22:10:33.000000000 +0000
++++ openjdk/jdk/src/share/native/java/util/zip/zip_util.c	2011-04-21 09:00:44.697761341 +0100
+@@ -44,7 +44,8 @@
+ #include "io_util.h"
+ #include "io_util_md.h"
+ #include "zip_util.h"
+-#include "zlib.h"
++
++#include <zlib.h>
+ 
+ /* USE_MMAP means mmap the CEN & ENDHDR part of the zip file. */
+ #ifdef USE_MMAP
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2011-04-20 04:40:22.000000000 +0100
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2011-04-21 09:00:44.697761341 +0100
+@@ -51,7 +51,9 @@
+ 
+ /* headers from the JPEG library */
+ #include <jpeglib.h>
+-#include "jerror.h"
++#include <jerror.h>
++
++#include <dlfcn.h>
+ 
+ #undef MAX
+ #define MAX(a,b)        ((a) > (b) ? (a) : (b))
+@@ -75,6 +77,62 @@
+ static jfieldID JPEGHuffmanTable_lengthsID;
+ static jfieldID JPEGHuffmanTable_valuesID;
+ 
++static void initIDs();
++
++typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
++typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
++typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
++typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
++typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
++typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
++typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
++typedef void (*fn_jpegabort)(j_common_ptr);
++typedef void (*fn_jpegabortdecompress)(j_decompress_ptr);
++typedef JHUFF_TBL * (*fn_jpegallochufftable)(j_common_ptr);
++typedef JQUANT_TBL * (*fn_jpegallocquanttable)(j_common_ptr);
++typedef void (*fn_jpegcreatecompress)(j_compress_ptr, int, size_t);
++typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
++typedef void (*fn_jpegdestroy)(j_common_ptr);
++typedef void (*fn_jpegfinishcompress)(j_compress_ptr);
++typedef boolean (*fn_jpeginputcomplete)(j_decompress_ptr);
++typedef void (*fn_jpegsavemarkers)(j_decompress_ptr, int, unsigned int);
++typedef void (*fn_jpegsetcolorspace)(j_compress_ptr, J_COLOR_SPACE);
++typedef void (*fn_jpegsetdefaults)(j_compress_ptr);
++typedef void (*fn_jpegsimpleprogression)(j_compress_ptr);
++typedef void (*fn_jpegstartcompress)(j_compress_ptr, boolean);
++typedef void (*fn_jpegsuppresstables)(j_compress_ptr, boolean);
++typedef JDIMENSION (*fn_jpegwritescanlines)(j_compress_ptr, JSAMPARRAY, JDIMENSION);
++typedef void (*fn_jpegwritetables)(j_compress_ptr);
++
++fn_jpegabort jpegabort;
++fn_jpegabortdecompress jpegabortdecompress;
++fn_jpegallochufftable jpegallochufftable;
++fn_jpegallocquanttable jpegallocquanttable;
++fn_jpegcreatecompress jpegcreatecompress;
++fn_jpegcreatedecompress jpegcreatedecompress;
++fn_jpegdestroy jpegdestroy;
++fn_jpegfinishcompress jpegfinishcompress;
++fn_jpeginputcomplete jpeginputcomplete;
++fn_jpegsavemarkers jpegsavemarkers;
++fn_jpegsetcolorspace jpegsetcolorspace;
++fn_jpegsetdefaults jpegsetdefaults;
++fn_jpegsimpleprogression jpegsimpleprogression;
++fn_jpegstartcompress jpegstartcompress;
++fn_jpegsuppresstables jpegsuppresstables;
++fn_jpegwritescanlines jpegwritescanlines;
++fn_jpegwritetables jpegwritetables;
++fn_jpegstderror jpegstderror;
++fn_jpegstartoutput jpegstartoutput;
++fn_jpegfinishdecompress jpegfinishdecompress;
++fn_jpeghasmultiplescans jpeghasmultiplescans;
++fn_jpegstartdecompress jpegstartdecompress;
++fn_jpegreadheader jpegreadheader;
++fn_jpegfinishoutput jpegfinishoutput;
++fn_jpegreadscanlines jpegreadscanlines;
++fn_jpegresynctorestart jpegresynctorestart;
++
+ /*
+  * Defined in jpegdecoder.c.  Copy code from there if and
+  * when that disappears. */
+@@ -608,7 +666,7 @@
+         return;
+     }
+ 
+-    jpeg_abort(cinfo);  // Frees any markers, but not tables
++    jpegabort(cinfo);  // Frees any markers, but not tables
+ 
+ }
+ 
+@@ -633,7 +691,7 @@
+         return;
+     }
+ 
+-    jpeg_abort(cinfo);  // Does not reset tables
++    jpegabort(cinfo);  // Does not reset tables
+ 
+ }
+ 
+@@ -651,7 +709,7 @@
+             free(cinfo->dest);
+             cinfo->dest = NULL;
+         }
+-        jpeg_destroy(info);
++        jpegdestroy(info);
+         free(info);
+     }
+ }
+@@ -691,14 +749,14 @@
+             decomp = (j_decompress_ptr) cinfo;
+             if (decomp->quant_tbl_ptrs[i] == NULL) {
+                 decomp->quant_tbl_ptrs[i] =
+-                    jpeg_alloc_quant_table(cinfo);
++                    jpegallocquanttable(cinfo);
+             }
+             quant_ptr = decomp->quant_tbl_ptrs[i];
+         } else {
+             comp = (j_compress_ptr) cinfo;
+             if (comp->quant_tbl_ptrs[i] == NULL) {
+                 comp->quant_tbl_ptrs[i] =
+-                    jpeg_alloc_quant_table(cinfo);
++                    jpegallocquanttable(cinfo);
+             }
+             quant_ptr = comp->quant_tbl_ptrs[i];
+         }
+@@ -789,14 +847,14 @@
+             decomp = (j_decompress_ptr) cinfo;
+             if (decomp->dc_huff_tbl_ptrs[i] == NULL) {
+                 decomp->dc_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = decomp->dc_huff_tbl_ptrs[i];
+         } else {
+             comp = (j_compress_ptr) cinfo;
+             if (comp->dc_huff_tbl_ptrs[i] == NULL) {
+                 comp->dc_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = comp->dc_huff_tbl_ptrs[i];
+         }
+@@ -814,14 +872,14 @@
+             decomp = (j_decompress_ptr) cinfo;
+             if (decomp->ac_huff_tbl_ptrs[i] == NULL) {
+                 decomp->ac_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = decomp->ac_huff_tbl_ptrs[i];
+         } else {
+             comp = (j_compress_ptr) cinfo;
+             if (comp->ac_huff_tbl_ptrs[i] == NULL) {
+                 comp->ac_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = comp->ac_huff_tbl_ptrs[i];
+         }
+@@ -1381,6 +1439,8 @@
+      jclass ImageInputStreamClass,
+      jclass qTableClass,
+      jclass huffClass) {
++   
++    initIDs();
+ 
+     ImageInputStream_readID = (*env)->GetMethodID(env,
+                                                   ImageInputStreamClass,
+@@ -1467,7 +1527,7 @@
+     }
+ 
+     /* We set up the normal JPEG error routines, then override error_exit. */
+-    cinfo->err = jpeg_std_error(&(jerr->pub));
++    cinfo->err = jpegstderror(&(jerr->pub));
+     jerr->pub.error_exit = sun_jpeg_error_exit;
+     /* We need to setup our own print routines */
+     jerr->pub.output_message = sun_jpeg_output_message;
+@@ -1484,11 +1544,11 @@
+     }
+ 
+     /* Perform library initialization */
+-    jpeg_create_decompress(cinfo);
++    jpegcreatedecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
+ 
+     // Set up to keep any APP2 markers, as these might contain ICC profile
+     // data
+-    jpeg_save_markers(cinfo, ICC_MARKER, 0xFFFF);
++    jpegsavemarkers(cinfo, ICC_MARKER, 0xFFFF);
+ 
+     /*
+      * Now set up our source.
+@@ -1507,7 +1567,7 @@
+     cinfo->src->init_source = imageio_init_source;
+     cinfo->src->fill_input_buffer = imageio_fill_input_buffer;
+     cinfo->src->skip_input_data = imageio_skip_input_data;
+-    cinfo->src->resync_to_restart = jpeg_resync_to_restart; // use default
++    cinfo->src->resync_to_restart = jpegresynctorestart; // use default
+     cinfo->src->term_source = imageio_term_source;
+ 
+     /* set up the association to persist for future calls */
+@@ -1627,7 +1687,7 @@
+         src->bytes_in_buffer = 0;
+     }
+ 
+-    ret = jpeg_read_header(cinfo, FALSE);
++    ret = jpegreadheader(cinfo, FALSE);
+ 
+     if (ret == JPEG_HEADER_TABLES_ONLY) {
+         retval = JNI_TRUE;
+@@ -1756,7 +1816,7 @@
+                                cinfo->num_components,
+                                profileData);
+         if (reset) {
+-            jpeg_abort_decompress(cinfo);
++            jpegabortdecompress(cinfo);
+         }
+     }
+ 
+@@ -1951,7 +2011,7 @@
+                    TRUE);
+     }
+ 
+-    progressive = jpeg_has_multiple_scans(cinfo);
++    progressive = jpeghasmultiplescans(cinfo);
+     if (progressive) {
+         cinfo->buffered_image = TRUE;
+         cinfo->input_scan_number = minProgressivePass+1; // Java count from 0
+@@ -1963,7 +2023,7 @@
+ 
+     data->streamBuf.suspendable = FALSE;
+ 
+-    jpeg_start_decompress(cinfo);
++    jpegstartdecompress(cinfo);
+ 
+     if (numBands !=  cinfo->output_components) {
+         JNU_ThrowByName(env, "javax/imageio/IIOException",
+@@ -1988,7 +2048,7 @@
+         if (progressive) {
+             // initialize the next pass.  Note that this skips up to
+             // the first interesting pass.
+-            jpeg_start_output(cinfo, cinfo->input_scan_number);
++            jpegstartoutput(cinfo, cinfo->input_scan_number);
+             if (wantUpdates) {
+                 (*env)->CallVoidMethod(env, this,
+                                        JPEGImageReader_passStartedID,
+@@ -2004,7 +2064,7 @@
+         // Skip until the first interesting line
+         while ((data->abortFlag == JNI_FALSE)
+                && ((jint)cinfo->output_scanline < sourceYStart)) {
+-            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
++            jpegreadscanlines(cinfo, &scanLinePtr, 1);
+         }
+ 
+         scanlineLimit = sourceYStart+sourceHeight;
+@@ -2017,7 +2077,7 @@
+         while ((data->abortFlag == JNI_FALSE)
+                && ((jint)cinfo->output_scanline < scanlineLimit)) {
+ 
+-            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
++            jpegreadscanlines(cinfo, &scanLinePtr, 1);
+ 
+             // Now mangle it into our buffer
+             out = data->pixelBuf.buf.bp;
+@@ -2072,13 +2132,13 @@
+                 skipLines = linesLeft;
+             }
+             for(i = 0; i < skipLines; i++) {
+-                jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
++                jpegreadscanlines(cinfo, &scanLinePtr, 1);
+             }
+         }
+         if (progressive) {
+-            jpeg_finish_output(cinfo); // Increments pass counter
++            jpegfinishoutput(cinfo); // Increments pass counter
+             // Call Java to notify pass complete
+-            if (jpeg_input_complete(cinfo)
++            if (jpeginputcomplete(cinfo)
+                 || (cinfo->input_scan_number > maxProgressivePass)) {
+                 done = TRUE;
+             }
+@@ -2098,9 +2158,9 @@
+     if (cinfo->output_scanline == cinfo->output_height) {
+         //    if ((cinfo->output_scanline == cinfo->output_height) &&
+         //(jpeg_input_complete(cinfo))) {  // We read the whole file
+-        jpeg_finish_decompress(cinfo);
++        jpegfinishdecompress(cinfo);
+     } else {
+-        jpeg_abort_decompress(cinfo);
++        jpegabortdecompress(cinfo);
+     }
+ 
+     free(scanLinePtr);
+@@ -2146,7 +2206,7 @@
+ 
+     cinfo = (j_decompress_ptr) data->jpegObj;
+ 
+-    jpeg_abort_decompress(cinfo);
++    jpegabortdecompress(cinfo);
+ }
+ 
+ 
+@@ -2352,6 +2412,150 @@
+ 
+ /********************** end of destination manager ************/
+ 
++METHODDEF(void)
++initIDs()
++{
++#if JPEG_LIB_VERSION >= 80
++    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
++#else
++#if JPEG_LIB_VERSION >= 70
++    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
++#else
++    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
++#endif
++#endif
++    
++    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
++    if (jpegstderror == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
++    if (jpegreadheader == NULL) {
++       dlclose(handle);
++    }
++
++    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
++    if (jpeghasmultiplescans == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
++    if (jpegstartdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
++    if (jpegstartoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
++    if (jpegfinishdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
++    if (jpegreadscanlines == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
++    if (jpegfinishoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
++    if (jpegresynctorestart == NULL) {
++       dlclose(handle);
++    }
++
++    jpegabort = (fn_jpegabort)dlsym(handle, "jpeg_abort");
++    if (jpegabort == NULL) {
++       dlclose(handle);
++    }
++ 
++    jpegabortdecompress = (fn_jpegabortdecompress)dlsym(handle, "jpeg_abort_decompress");
++    if (jpegabortdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegallochufftable = (fn_jpegallochufftable)dlsym(handle, "jpeg_alloc_huff_table");
++    if (jpegallochufftable == NULL) {
++       dlclose(handle);
++    }
++
++    jpegallocquanttable = (fn_jpegallocquanttable)dlsym(handle, "jpeg_alloc_quant_table");
++    if (jpegallocquanttable == NULL) {
++       dlclose(handle);
++    }
++
++    jpegcreatecompress = (fn_jpegcreatecompress)dlsym(handle, "jpeg_CreateCompress");
++    if (jpegcreatecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
++    if (jpegcreatedecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegdestroy = (fn_jpegdestroy)dlsym(handle, "jpeg_destroy");
++    if (jpegdestroy == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishcompress = (fn_jpegfinishcompress)dlsym(handle, "jpeg_finish_compress");
++    if (jpegfinishcompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpeginputcomplete = (fn_jpeginputcomplete)dlsym(handle, "jpeg_input_complete");
++    if (jpeginputcomplete == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsavemarkers = (fn_jpegsavemarkers)dlsym(handle, "jpeg_save_markers");
++    if (jpegsavemarkers == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsetcolorspace = (fn_jpegsetcolorspace)dlsym(handle, "jpeg_set_colorspace");
++    if (jpegsetcolorspace == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsetdefaults = (fn_jpegsetdefaults)dlsym(handle, "jpeg_set_defaults");
++    if (jpegsetdefaults == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsimpleprogression = (fn_jpegsimpleprogression)dlsym(handle, "jpeg_simple_progression");
++    if (jpegsimpleprogression == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartcompress = (fn_jpegstartcompress)dlsym(handle, "jpeg_start_compress");
++    if (jpegstartcompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsuppresstables = (fn_jpegsuppresstables)dlsym(handle, "jpeg_suppress_tables");
++    if (jpegsuppresstables == NULL) {
++       dlclose(handle);
++    }
++
++    jpegwritescanlines = (fn_jpegwritescanlines)dlsym(handle, "jpeg_write_scanlines");
++    if (jpegwritescanlines == NULL) {
++       dlclose(handle);
++    }
++
++    jpegwritetables = (fn_jpegwritetables)dlsym(handle, "jpeg_write_tables");
++    if (jpegwritetables == NULL) {
++       dlclose(handle);
++    }
++}
++
+ /********************** Writer JNI calls **********************/
+ 
+ 
+@@ -2363,6 +2567,8 @@
+      jclass qTableClass,
+      jclass huffClass) {
+ 
++    initIDs();
++
+     ImageOutputStream_writeID = (*env)->GetMethodID(env,
+                                                     IOSClass,
+                                                     "write",
+@@ -2436,7 +2642,7 @@
+     }
+ 
+     /* We set up the normal JPEG error routines, then override error_exit. */
+-    cinfo->err = jpeg_std_error(&(jerr->pub));
++    cinfo->err = jpegstderror(&(jerr->pub));
+     jerr->pub.error_exit = sun_jpeg_error_exit;
+     /* We need to setup our own print routines */
+     jerr->pub.output_message = sun_jpeg_output_message;
+@@ -2453,7 +2659,7 @@
+     }
+ 
+     /* Perform library initialization */
+-    jpeg_create_compress(cinfo);
++    jpegcreatecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_compress_struct));
+ 
+     /* Now set up the destination  */
+     dest = malloc(sizeof(struct jpeg_destination_mgr));
+@@ -2560,7 +2766,7 @@
+         return;
+     }
+ 
+-    jpeg_suppress_tables(cinfo, TRUE);  // Suppress writing of any current
++    jpegsuppresstables(cinfo, TRUE);  // Suppress writing of any current
+ 
+     data->streamBuf.suspendable = FALSE;
+     if (qtables != NULL) {
+@@ -2575,7 +2781,7 @@
+                    DCHuffmanTables, ACHuffmanTables, TRUE);
+     }
+ 
+-    jpeg_write_tables(cinfo); // Flushes the buffer for you
++    jpegwritetables(cinfo); // Flushes the buffer for you
+     RELEASE_ARRAYS(env, data, NULL);
+ }
+ 
+@@ -2758,9 +2964,9 @@
+     cinfo->input_components = numBands;
+     cinfo->in_color_space = inCs;
+ 
+-    jpeg_set_defaults(cinfo);
++    jpegsetdefaults(cinfo);
+ 
+-    jpeg_set_colorspace(cinfo, outCs);
++    jpegsetcolorspace(cinfo, outCs);
+ 
+     cinfo->optimize_coding = optimize;
+ 
+@@ -2797,7 +3003,7 @@
+     (*env)->ReleaseIntArrayElements(env, QtableSelectors,
+                                     qsels, JNI_ABORT);
+ 
+-    jpeg_suppress_tables(cinfo, TRUE);  // Disable writing any current
++    jpegsuppresstables(cinfo, TRUE);  // Disable writing any current
+ 
+     qlen = setQTables(env, (j_common_ptr) cinfo, qtables, writeDQT);
+ 
+@@ -2822,7 +3028,7 @@
+ 
+     if (progressive) {
+         if (numScans == 0) { // then use default scans
+-            jpeg_simple_progression(cinfo);
++            jpegsimpleprogression(cinfo);
+         } else {
+             cinfo->num_scans = numScans;
+             // Copy the scanInfo to a local array
+@@ -2864,7 +3070,7 @@
+ #endif
+ 
+     // start the compressor; tables must already be set
+-    jpeg_start_compress(cinfo, FALSE); // Leaves sent_table alone
++    jpegstartcompress(cinfo, FALSE); // Leaves sent_table alone
+ 
+     if (haveMetadata) {
+         // Flush the buffer
+@@ -2927,7 +3133,7 @@
+             }
+         }
+         // write it out
+-        jpeg_write_scanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
++        jpegwritescanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
+         targetLine += stepY;
+     }
+ 
+@@ -2936,9 +3142,9 @@
+      * so use jpeg_abort instead of jpeg_finish_compress.
+      */
+     if (cinfo->next_scanline == cinfo->image_height) {
+-        jpeg_finish_compress(cinfo);  // Flushes buffer with term_dest
++        jpegfinishcompress(cinfo);  // Flushes buffer with term_dest
+     } else {
+-        jpeg_abort((j_common_ptr)cinfo);
++        jpegabort((j_common_ptr)cinfo);
+     }
+ 
+     if (scale != NULL) {
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2011-04-20 04:40:22.000000000 +0100
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2011-04-21 09:00:44.697761341 +0100
+@@ -45,7 +45,9 @@
+ #undef boolean
+ #undef FAR
+ #include <jpeglib.h>
+-#include "jerror.h"
++#include <jerror.h>
++#include <dlfcn.h>
++
+ 
+ /* The method IDs we cache. Note that the last two belongs to the
+  * java.io.InputStream class.
+@@ -56,6 +58,32 @@
+ static jmethodID InputStream_readID;
+ static jmethodID InputStream_availableID;
+ 
++typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
++typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
++typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
++typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
++typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
++typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
++typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
++typedef void (*fn_jpegdestroydecompress)(j_decompress_ptr);
++typedef int (*fn_jpegconsumeinput)(j_decompress_ptr);
++typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
++
++fn_jpegstderror jpegstderror;
++fn_jpegstartoutput jpegstartoutput;
++fn_jpegfinishdecompress jpegfinishdecompress;
++fn_jpegconsumeinput jpegconsumeinput;
++fn_jpegdestroydecompress jpegdestroydecompress; 
++fn_jpeghasmultiplescans jpeghasmultiplescans;
++fn_jpegstartdecompress jpegstartdecompress;
++fn_jpegreadheader jpegreadheader;
++fn_jpegfinishoutput jpegfinishoutput;
++fn_jpegreadscanlines jpegreadscanlines;
++fn_jpegresynctorestart jpegresynctorestart;
++fn_jpegcreatedecompress jpegcreatedecompress;
++
+ /* Initialize the Java VM instance variable when the library is
+    first loaded */
+ JavaVM *jvm;
+@@ -462,6 +490,76 @@
+ Java_sun_awt_image_JPEGImageDecoder_initIDs(JNIEnv *env, jclass cls,
+                                             jclass InputStreamClass)
+ {
++#if JPEG_LIB_VERSION >= 80
++    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
++#else
++#if JPEG_LIB_VERSION >= 70
++    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
++#else
++    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
++#endif
++#endif
++ 
++    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
++    if (jpegstderror == NULL) {
++       dlclose(handle);
++    }
++
++    jpegdestroydecompress = (fn_jpegdestroydecompress)dlsym(handle, "jpeg_destroy_decompress");
++    if (jpegdestroydecompress == NULL) {
++       dlclose(handle);
++    }  
++
++    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
++    if (jpegcreatedecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
++    if (jpegreadheader == NULL) {
++       dlclose(handle);
++    }
++
++    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
++    if (jpeghasmultiplescans == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
++    if (jpegstartdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegconsumeinput = (fn_jpegconsumeinput)dlsym(handle, "jpeg_consume_input");
++    if (jpegconsumeinput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
++    if (jpegstartoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
++    if (jpegfinishdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
++    if (jpegreadscanlines == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
++    if (jpegfinishoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
++    if (jpegresynctorestart == NULL) {
++       dlclose(handle);
++    }
++
+     sendHeaderInfoID = (*env)->GetMethodID(env, cls, "sendHeaderInfo",
+                                            "(IIZZZ)Z");
+     sendPixelsByteID = (*env)->GetMethodID(env, cls, "sendPixels", "([BI)Z");
+@@ -519,7 +617,7 @@
+   /* Step 1: allocate and initialize JPEG decompression object */
+ 
+   /* We set up the normal JPEG error routines, then override error_exit. */
+-  cinfo.err = jpeg_std_error(&jerr.pub);
++  cinfo.err = jpegstderror(&jerr.pub);
+   jerr.pub.error_exit = sun_jpeg_error_exit;
+ 
+   /* We need to setup our own print routines */
+@@ -530,7 +628,7 @@
+     /* If we get here, the JPEG code has signaled an error.
+      * We need to clean up the JPEG object, close the input file, and return.
+      */
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     RELEASE_ARRAYS(env, &jsrc);
+     if (!(*env)->ExceptionOccurred(env)) {
+         char buffer[JMSG_LENGTH_MAX];
+@@ -541,7 +639,7 @@
+     return;
+   }
+   /* Now we can initialize the JPEG decompression object. */
+-  jpeg_create_decompress(&cinfo);
++  jpegcreatedecompress(&cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
+ 
+   /* Step 2: specify data source (eg, a file) */
+ 
+@@ -555,17 +653,17 @@
+   jsrc.pub.init_source = sun_jpeg_init_source;
+   jsrc.pub.fill_input_buffer = sun_jpeg_fill_input_buffer;
+   jsrc.pub.skip_input_data = sun_jpeg_skip_input_data;
+-  jsrc.pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
++  jsrc.pub.resync_to_restart = jpegresynctorestart; /* use default method */
+   jsrc.pub.term_source = sun_jpeg_term_source;
+   if (!GET_ARRAYS(env, &jsrc)) {
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     return;
+   }
+   /* Step 3: read file parameters with jpeg_read_header() */
+ 
+-  (void) jpeg_read_header(&cinfo, TRUE);
++  (void) jpegreadheader(&cinfo, TRUE);
+   /* select buffered-image mode if it is a progressive JPEG only */
+-  buffered_mode = cinfo.buffered_image = jpeg_has_multiple_scans(&cinfo);
++  buffered_mode = cinfo.buffered_image = jpeghasmultiplescans(&cinfo);
+   grayscale = (cinfo.out_color_space == JCS_GRAYSCALE);
+ #ifdef YCCALPHA
+   hasalpha = (cinfo.out_color_space == JCS_RGBA);
+@@ -584,7 +682,7 @@
+                                   grayscale, hasalpha, buffered_mode);
+   if ((*env)->ExceptionOccurred(env) || !ret) {
+     /* No more interest in this image... */
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     return;
+   }
+   /* Make a one-row-high sample array with enough room to expand to ints */
+@@ -595,7 +693,7 @@
+   }
+ 
+   if (jsrc.hOutputBuffer == 0 || !GET_ARRAYS(env, &jsrc)) {
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     return;
+   }
+ 
+@@ -613,7 +711,7 @@
+ 
+   /* Step 5: Start decompressor */
+ 
+-  jpeg_start_decompress(&cinfo);
++  jpegstartdecompress(&cinfo);
+ 
+   /* We may need to do some setup of our own at this point before reading
+    * the data.  After jpeg_start_decompress() we have the correct scaled
+@@ -638,28 +736,28 @@
+           do {
+               sun_jpeg_fill_suspended_buffer(&cinfo);
+               jsrc.suspendable = TRUE;
+-              ret = jpeg_consume_input(&cinfo);
++	      ret = jpegconsumeinput(&cinfo);
+               jsrc.suspendable = FALSE;
+           } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
+           if (ret == JPEG_REACHED_EOI) {
+               final_pass = TRUE;
+               cinfo.dct_method = JDCT_ISLOW;
+           }
+-          jpeg_start_output(&cinfo, cinfo.input_scan_number);
++	  jpegstartoutput(&cinfo, cinfo.input_scan_number);
+       }
+       while (cinfo.output_scanline < cinfo.output_height) {
+           if (! final_pass) {
+               do {
+                   sun_jpeg_fill_suspended_buffer(&cinfo);
+                   jsrc.suspendable = TRUE;
+-                  ret = jpeg_consume_input(&cinfo);
++		  ret = jpegconsumeinput(&cinfo);
+                   jsrc.suspendable = FALSE;
+               } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
+               if (ret == JPEG_REACHED_EOI) {
+                   break;
+               }
+           }
+-          (void) jpeg_read_scanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
++	  (void) jpegreadscanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
+ 
+           if (grayscale) {
+               RELEASE_ARRAYS(env, &jsrc);
+@@ -695,18 +793,18 @@
+           if ((*env)->ExceptionOccurred(env) || !ret ||
+               !GET_ARRAYS(env, &jsrc)) {
+               /* No more interest in this image... */
+-              jpeg_destroy_decompress(&cinfo);
++	      jpegdestroydecompress(&cinfo);
+               return;
+           }
+       }
+       if (buffered_mode) {
+-          jpeg_finish_output(&cinfo);
++	  jpegfinishoutput(&cinfo);
+       }
+   } while (! final_pass);
+ 
+   /* Step 7: Finish decompression */
+ 
+-  (void) jpeg_finish_decompress(&cinfo);
++  (void) jpegfinishdecompress(&cinfo);
+   /* We can ignore the return value since suspension is not possible
+    * with the stdio data source.
+    * (nor with the Java data source)
+@@ -715,7 +813,7 @@
+   /* Step 8: Release JPEG decompression object */
+ 
+   /* This is an important step since it will release a good deal of memory. */
+-  jpeg_destroy_decompress(&cinfo);
++  jpegdestroydecompress(&cinfo);
+ 
+   /* After finish_decompress, we can close the input file.
+    * Here we postpone it until after no more JPEG errors are possible,
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2011-03-14 22:10:33.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2011-04-21 09:00:44.701761405 +0100
+@@ -26,7 +26,7 @@
+ #include "splashscreen_impl.h"
+ #include "splashscreen_gfx.h"
+ 
+-#include "../giflib/gif_lib.h"
++#include <gif_lib.h>
+ 
+ #define GIF_TRANSPARENT     0x01
+ #define GIF_USER_INPUT      0x02
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2010-07-29 21:56:12.000000000 +0100
++++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2011-04-21 09:00:44.701761405 +0100
+@@ -25,9 +25,8 @@
+ 
+ #include "splashscreen_impl.h"
+ 
+-#include "jinclude.h"
+-#include "jpeglib.h"
+-#include "jerror.h"
++#include <jpeglib.h>
++#include <jerror.h>
+ 
+ #include <setjmp.h>
+ 
+@@ -105,13 +104,9 @@
+     stream_src_ptr src;
+ 
+     if (cinfo->src == NULL) {   /* first time for this JPEG object? */
+-        cinfo->src = (struct jpeg_source_mgr *)
+-            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
+-            JPOOL_PERMANENT, SIZEOF(stream_source_mgr));
+-        src = (stream_src_ptr) cinfo->src;
+-        src->buffer = (JOCTET *)
+-            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
+-            JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
++        cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(stream_source_mgr));
++	src = (stream_src_ptr) cinfo->src;
++    	src->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof(JOCTET));
+     }
+ 
+     src = (stream_src_ptr) cinfo->src;
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2011-03-14 22:10:33.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2011-04-21 09:00:44.701761405 +0100
+@@ -25,7 +25,7 @@
+ 
+ #include "splashscreen_impl.h"
+ 
+-#include "../libpng/png.h"
++#include <png.h>
+ 
+ #include <setjmp.h>
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/linker-libs-order.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,54 @@
+diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
+--- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2010-09-01 10:55:50.000000000 +0100
++++ openjdk/jdk/make/com/sun/java/pack/Makefile	2010-09-01 15:54:07.312808721 +0100
+@@ -75,12 +75,12 @@
+ 	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
+ 	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
+ 
+-  OTHER_LDLIBS += -lz
+ else
+   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
+-  OTHER_LDLIBS += -lz $(JVMLIB)
++  OTHER_LDLIBS += $(JVMLIB)
+ endif
+ 
++OTHER_LDLIBS += -lz
+ CXXFLAGS_DBG += -DFULL
+ CXXFLAGS_OPT += -DPRODUCT
+ CXXFLAGS_COMMON += -DFULL
+@@ -97,12 +97,11 @@
+   RES = $(OBJDIR)/$(PGRM).res
+ else
+   LDOUTPUT = -o #Have a space 
+-  LDDFLAGS += -lz -lc
+-  OTHER_LDLIBS  += $(LIBCXX)
++  OTHER_LDLIBS += $(LIBCXX) -lc
+ # setup the list of libraries to link in...
+ ifeq ($(PLATFORM), linux)
+ ifeq ("$(CC_VER_MAJOR)", "3")
+-  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
++  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
+ endif
+ endif #LINUX
+ endif #PLATFORM
+@@ -148,7 +147,7 @@
+ 
+ $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) updatefiles winres
+ 	$(prep-target)
+-	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
++	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(OTHER_LDLIBS) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
+ ifdef MT
+ 	$(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
+ endif
+diff -Nru openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile openjdk/jdk/make/javax/sound/jsoundalsa/Makefile
+--- openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile	2010-07-29 21:55:27.000000000 +0100
++++ openjdk/jdk/make/javax/sound/jsoundalsa/Makefile	2010-09-01 15:54:07.312808721 +0100
+@@ -66,7 +66,7 @@
+ 	$(MIDIFILES_export) \
+ 	$(PORTFILES_export)
+ 
+-LDFLAGS += -lasound
++OTHER_LDLIBS += -lasound
+ 
+ CPPFLAGS += \
+ 	-DUSE_DAUDIO=TRUE \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nss-config.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,10 @@
+--- openjdk.orig/jdk/src/share/lib/security/java.security	2009-08-25 11:43:59.000000000 +0100
++++ openjdk/jdk/src/share/lib/security/java.security		2009-08-27 14:23:54.000000000 +0100
+@@ -51,6 +51,7 @@
+ security.provider.6=com.sun.security.sasl.Provider
+ security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
+ security.provider.8=sun.security.smartcardio.SunPCSC
++security.provider.9=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
+ 
+ #
+ # Select the source of seed data for SecureRandom. By default an
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nss-not-enabled-config.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,13 @@
+--- openjdk.orig/jdk/src/share/lib/security/java.security	2009-08-25 11:43:59.000000000 +0100
++++ openjdk/jdk/src/share/lib/security/java.security		2009-08-27 14:23:54.000000000 +0100
+@@ -51,6 +51,10 @@
+ security.provider.6=com.sun.security.sasl.Provider
+ security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
+ security.provider.8=sun.security.smartcardio.SunPCSC
++# the NSS security provider was not enabled for this build; it can be enabled
++# if NSS (libnss3) is available on the machine. The nss.cfg file may need
++# editing to reflect the location of the NSS installation.
++#security.provider.9=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
+ 
+ #
+ # Select the source of seed data for SecureRandom. By default an
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/override-redirect-metacity.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,11 @@
+diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2010-01-04 16:57:29.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2010-01-04 19:47:57.000000000 +0000
+@@ -1142,6 +1142,7 @@
+ 
+     boolean isOverrideRedirect() {
+         return XWM.getWMID() == XWM.OPENLOOK_WM ||
++            XWM.getWMID() == XWM.METACITY_WM ||
+             Window.Type.POPUP.equals(getWindowType());
+     }
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/pr261.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,40 @@
+diff -Nru openjdk.orig/jdk/make/java/nio/FILES_java.gmk openjdk/jdk/make/java/nio/FILES_java.gmk
+--- openjdk.orig/jdk/make/java/nio/FILES_java.gmk	2009-03-05 08:28:24.000000000 +0000
++++ openjdk/jdk/make/java/nio/FILES_java.gmk	2009-03-06 17:57:56.000000000 +0000
+@@ -39,6 +39,7 @@
+ 	java/nio/channels/AsynchronousServerSocketChannel.java \
+ 	java/nio/channels/AsynchronousSocketChannel.java \
+ 	java/nio/channels/ByteChannel.java \
++	java/nio/channels/CancelledKeyException.java \
+ 	java/nio/channels/Channel.java \
+ 	java/nio/channels/Channels.java \
+ 	java/nio/channels/CompletionHandler.java \
+@@ -51,6 +52,7 @@
+ 	java/nio/channels/MembershipKey.java \
+ 	java/nio/channels/MulticastChannel.java \
+ 	java/nio/channels/NetworkChannel.java \
++	java/nio/channels/Pipe.java \
+ 	java/nio/channels/ReadableByteChannel.java \
+ 	java/nio/channels/ScatteringByteChannel.java \
+ 	java/nio/channels/SeekableByteChannel.java \
+diff -Nru openjdk.orig/jdk/make/java/nio/Makefile openjdk/jdk/make/java/nio/Makefile
+--- openjdk.orig/jdk/make/java/nio/Makefile	2009-03-05 08:28:24.000000000 +0000
++++ openjdk/jdk/make/java/nio/Makefile	2009-03-06 18:00:27.000000000 +0000
+@@ -183,6 +183,9 @@
+ ifeq ($(PLATFORM), linux)
+ FILES_java += \
+         sun/nio/ch/AbstractPollSelectorImpl.java \
++	sun/nio/ch/DevPollArrayWrapper.java \
++	sun/nio/ch/DevPollSelectorImpl.java \
++	sun/nio/ch/DevPollSelectorProvider.java \
+ 	sun/nio/ch/EPoll.java \
+ 	sun/nio/ch/EPollArrayWrapper.java \
+ 	sun/nio/ch/EPollPort.java \
+@@ -242,6 +245,7 @@
+ 	UnixNativeDispatcher.c
+ 
+ FILES_export += \
++ 	sun/nio/ch/DevPollArrayWrapper.java \
+ 	sun/nio/ch/EPoll.java \
+         sun/nio/ch/EPollArrayWrapper.java \
+ 	sun/nio/ch/EPollPort.java \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/print-lsb-release.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,49 @@
+diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2010-08-27 19:15:27.000000000 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2010-08-31 18:50:26.191830872 +0100
+@@ -1888,6 +1888,37 @@
+   return true;
+ }
+ 
++bool _print_lsb_file(const char* filename, outputStream* st) {
++  int fd = open(filename, O_RDONLY);
++  if (fd == -1) {
++     return false;
++  }
++
++  char buf[512], *d_i, *d_r, *d_c;
++  int bytes;
++
++  if ((bytes = read(fd, buf, sizeof(buf)-1)) == sizeof(buf)-1) {
++     close(fd);
++     return false;
++  }
++  close(fd);
++
++  buf[bytes] = '\n';
++  buf[bytes+1] = '\0';
++  d_i = strstr(buf, "DISTRIB_ID=");
++  d_r = strstr(buf, "DISTRIB_RELEASE=");
++  d_c = strstr(buf, "DISTRIB_CODENAME=");
++  if (!d_i || !d_r || !d_c) {
++     return false;
++  }
++  d_i = strchr(d_i, '=') + 1;  *strchrnul(d_i, '\n') = '\0';
++  d_r = strchr(d_r, '=') + 1;  *strchrnul(d_r, '\n') = '\0';
++  d_c = strchr(d_c, '=') + 1;  *strchrnul(d_c, '\n') = '\0';
++  st->print("%s %s (%s)", d_i, d_r, d_c);
++
++  return true;
++}
++
+ void os::print_dll_info(outputStream *st) {
+    st->print_cr("Dynamic libraries:");
+ 
+@@ -1916,6 +1947,7 @@
+       !_print_ascii_file("/etc/SuSE-release", st) &&
+       !_print_ascii_file("/etc/turbolinux-release", st) &&
+       !_print_ascii_file("/etc/gentoo-release", st) &&
++      !_print_lsb_file("/etc/lsb-release", st) &&
+       !_print_ascii_file("/etc/debian_version", st) &&
+       !_print_ascii_file("/etc/ltib-release", st) &&
+       !_print_ascii_file("/etc/angstrom-version", st)) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/pulse-soundproperties.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,16 @@
+--- openjdk/jdk/src/share/lib/sound.properties	2008-08-28 04:15:18.000000000 -0400
++++ openjdk/jdk/src/share/lib/sound.properties	2008-10-03 16:59:21.000000000 -0400
+@@ -37,3 +37,13 @@
+ # Specify the default Receiver by provider and name:
+ # javax.sound.midi.Receiver=com.sun.media.sound.MidiProvider#SunMIDI1
+ #
++
++# javax.sound.sampled.Clip=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
++# javax.sound.sampled.Port=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
++# javax.sound.sampled.SourceDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
++# javax.sound.sampled.TargetDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
++
++javax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider
++javax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider
++javax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider
++javax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/rhino.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,148 @@
+diff -Nru openjdk.orig/jdk/make/com/sun/Makefile openjdk/jdk/make/com/sun/Makefile
+--- openjdk.orig/jdk/make/com/sun/Makefile	2011-04-20 04:40:20.000000000 +0100
++++ openjdk/jdk/make/com/sun/Makefile	2011-04-21 22:36:31.443422475 +0100
+@@ -31,13 +31,6 @@
+ PRODUCT = sun
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+-ifndef OPENJDK
+-  ORG_EXISTS := $(call DirExists,$(CLOSED_SRC)/share/classes/sun/org,,)
+-  ifneq ("$(ORG_EXISTS)", "") 
+-    SCRIPT_SUBDIR = script
+-  endif
+-endif
+-
+ # jarsigner is part of JRE
+ SUBDIRS = java security net/ssl jarsigner
+ 
+diff -Nru openjdk.orig/jdk/make/com/sun/script/Makefile openjdk/jdk/make/com/sun/script/Makefile
+--- openjdk.orig/jdk/make/com/sun/script/Makefile	2011-04-20 04:40:20.000000000 +0100
++++ openjdk/jdk/make/com/sun/script/Makefile	2011-04-21 22:36:31.443422475 +0100
+@@ -31,6 +31,8 @@
+ 
+ AUTO_FILES_JAVA_DIRS = com/sun/script
+ 
++OTHER_JAVACFLAGS = -classpath $(RHINO_JAR)
++
+ #
+ # Files that need to be copied
+ #
+diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
+--- openjdk.orig/jdk/make/common/Release.gmk	2011-04-21 20:56:37.000000000 +0100
++++ openjdk/jdk/make/common/Release.gmk	2011-04-21 22:36:31.443422475 +0100
+@@ -735,6 +735,7 @@
+ 	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
+ 	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
+ 	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
++	$(CP) $(RHINO_JAR) $(JRE_IMAGE_DIR)/lib/rhino.jar
+ 	@# Generate meta-index to make boot and extension class loaders lazier
+ 	$(CD) $(JRE_IMAGE_DIR)/lib && \
+ 	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2011-04-21 22:36:31.443422475 +0100
+@@ -24,7 +24,7 @@
+  */
+ 
+ package com.sun.script.javascript;
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ import javax.script.*;
+ import java.util.*;
+ 
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2011-04-21 22:36:31.455422660 +0100
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ 
+ import javax.script.Invocable;
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ 
+ /**
+  * This class implements Rhino-like JavaAdapter to help implement a Java
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2011-04-21 22:36:31.455422660 +0100
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.script.javascript;
+ 
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ import java.util.*;
+ 
+ /**
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2011-04-21 22:36:31.455422660 +0100
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ 
+ import java.util.*;
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ 
+ /**
+  * This class prevents script access to certain sensitive classes.
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2011-04-21 22:36:31.455422660 +0100
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.script.javascript;
+ import javax.script.*;
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ 
+ /**
+  * Represents compiled JavaScript code.
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2011-04-18 18:04:37.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2011-04-21 22:36:31.455422660 +0100
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ import javax.script.*;
+ import java.util.*;
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ import com.sun.script.util.*;
+ 
+ /**
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2011-04-20 04:40:21.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2011-04-21 22:36:31.455422660 +0100
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ import com.sun.script.util.*;
+ import javax.script.*;
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ import java.lang.reflect.Method;
+ import java.io.*;
+ import java.util.*;
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2011-04-11 12:34:30.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2011-04-21 22:36:31.455422660 +0100
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.script.javascript;
+ 
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ import javax.script.*;
+ 
+ /**
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2010-07-29 21:55:35.000000000 +0100
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2011-04-21 22:36:31.455422660 +0100
+@@ -27,7 +27,7 @@
+ 
+ import java.lang.reflect.*;
+ import static sun.security.util.SecurityConstants.*;
+-import sun.org.mozilla.javascript.internal.*;
++import sun.org.mozilla.javascript.*;
+ 
+ /**
+  * This wrap factory is used for security reasons. JSR 223 script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/rmi_amd64.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,15 @@
+--- ../openjdk/jdk/make/sun/rmi/rmi/Makefile	2007-08-16 03:17:52.000000000 -0400
++++ openjdk/jdk/make/sun/rmi/rmi/Makefile	2007-08-30 12:36:07.000000000 -0400
+@@ -88,12 +88,8 @@
+ ifeq ($(PLATFORM), windows)
+ build: stubs
+ else # PLATFORM
+-ifneq ($(ARCH_DATA_MODEL), 32)
+-build: stubs
+-else # ARCH_DATA_MODEL
+ build: stubs bin
+ endif
+-endif
+ 
+ clean clobber:: bin.clean
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/samejvm-safe.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,12 @@
+--- openjdk.orig/jdk/test/TEST.ROOT	2008-11-06 09:44:52.000000000 +0100
++++ openjdk/jdk/test/TEST.ROOT	2008-11-23 16:15:53.000000000 +0100
+@@ -4,3 +4,9 @@
+ 
+ # The list of keywords supported in the entire test suite
+ keys=2d dnd i18n
++
++# List if directory (prefixes) that contain test that are safe to run in
++# -samejvm mode. Only used if the test root (dir containing this file) is
++# given to jtreg and the -samejvm argument is used, ignored otherwise
++# (meaning all tests are assumed to be same jvm safe).
++samejvmsafe=com/sun/crypto com/sun/management com/sun/media com/sun/security java/beans/beancontext java/beans/PropertyChangeSupport java/beans/Statement java/beans/VetoableChangeSupport java/lang/Boolean java/lang/Byte java/lang/Double java/lang/Float java/lang/Integer java/lang/Long java/lang/Short java/lang/Math java/lang/StrictMath java/lang/String java/lang/Throwable java/lang/instrument java/math java/net/URI java/net/URLDecoder java/net/URLEncoder java/nio/Buffer java/nio/ByteOrder java/nio/MappedByteBuffer java/nio/channels/Channels java/nio/channels/DatagramChannel java/nio/channels/spi java/security/cert java/security/Provider java/text java/util/jar java/util/zip java/util/Array java/util/BitSet java/util/Collection java/util/List javax/imageio javax/management/openmbean javax/rmi javax/sound sun/net/www/protocol sun/misc sun/nio sun/security/pkcs11 sun/security/rsa sun/util
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security-updates.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,101 @@
+diff -Nru openjdk.orig/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java openjdk/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java
+--- openjdk.orig/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java	2009-05-12 12:55:47.000000000 +0100
+@@ -0,0 +1,97 @@
++/*
++ * Copyright 2007 Sun Microsystems, Inc.  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
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * @test
++ * @bug 6685178
++ * @summary Sanity check for local only option. In order to fully test this
++ *          new local only option two different machines would be required.
++ * @author Luis-Miguel Alventosa
++ * @run main/othervm LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
++ * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
++ */
++
++import java.io.*;
++import java.lang.management.*;
++import java.util.*;
++import javax.management.*;
++import javax.management.remote.*;
++import com.sun.tools.attach.*;
++
++public class LocalOnlyTest {
++
++    public static void main(String args[]) throws Exception {
++        RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
++        String name = rt.getName();
++        System.out.println("name = " + name);
++        String vmid = name.substring(0, name.indexOf("@"));
++        System.out.println("vmid = " + vmid);
++        VirtualMachine vm = VirtualMachine.attach(vmid);
++        String addr = vm.getAgentProperties().getProperty(
++                "com.sun.management.jmxremote.localConnectorAddress");
++        System.out.println("connectorAddress = " + addr);
++        if (addr == null) {
++            // Normally in ${java.home}/jre/lib/management-agent.jar
++            // but might be in ${java.home}/lib in build environments.
++            String javaHome = System.getProperty("java.home");
++            String agent = javaHome + File.separator + "jre" + File.separator +
++                    "lib" + File.separator + "management-agent.jar";
++            File f = new File(agent);
++            if (!f.exists()) {
++                agent = javaHome + File.separator + "lib" + File.separator +
++                        "management-agent.jar";
++                f = new File(agent);
++                if (!f.exists()) {
++                    throw new IOException("Management agent not found");
++                }
++            }
++            agent = f.getCanonicalPath();
++            try {
++                vm.loadAgent(agent, "com.sun.management.jmxremote");
++            } catch (AgentLoadException x) {
++                IOException ioe = new IOException(x.getMessage());
++                ioe.initCause(x);
++                throw ioe;
++            } catch (AgentInitializationException x) {
++                IOException ioe = new IOException(x.getMessage());
++                ioe.initCause(x);
++                throw ioe;
++            }
++            addr = vm.getAgentProperties().getProperty(
++                    "com.sun.management.jmxremote.localConnectorAddress");
++            System.out.println("connectorAddress (after loading agent) = " + addr);
++        }
++        vm.detach();
++        JMXServiceURL url = new JMXServiceURL(addr);
++        JMXConnector c = JMXConnectorFactory.connect(url);
++        System.out.println("connectionId  = " + c.getConnectionId());
++        System.out.println("Bye! Bye!");
++    }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/6592792.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,69 @@
+diff -Nru openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java
+--- openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	2009-05-12 23:41:24.000000000 +0100
+@@ -0,0 +1,65 @@
++/*
++ *  @test
++ *  @bug 6592792
++ *  @summary Add com.sun.xml.internal to the "package.access" property in $JAVA_HOME/lib/security/java.security
++ *  @run shell Test6592792.sh
++ */
++
++import java.lang.*;
++import java.lang.reflect.*;
++import com.sun.xml.internal.ws.server.*;
++import com.sun.xml.internal.ws.server.SingletonResolver;
++import com.sun.xml.internal.ws.api.server.*;
++
++public class Test {
++
++  public static void main(String[] args) throws Exception{
++      // Enable the security manager
++      SecurityManager sm = new SecurityManager();
++      System.setSecurityManager(sm);
++      new Test();
++  }
++
++  Object invokeMethod(Object target,Method m,Object args[]) throws Exception {
++      SingletonResolver r = new SingletonResolver(target);
++      Invoker invoker = r.createInvoker();
++      return invoker.invoke(null, m, args);
++  }
++
++  public Test() throws Exception{
++      try {
++          Class c=Class.forName("java.lang.Class");
++
++          Class ctab[]=new Class[1];
++          ctab[0]=Class.forName("java.lang.String");
++          Method forName=c.getMethod("forName",ctab);
++
++          Class gtab[]=new Class[2];
++          gtab[0]=Class.forName("java.lang.String");
++          gtab[1]=Class[].class;
++          Method getMethod=c.getMethod("getMethod",gtab);
++
++          Method newInstance=c.getMethod("newInstance",(Class[])null);
++
++          Object otab[]=new Object[1];
++          otab[0]="sun.misc.Unsafe";
++
++          Object o=invokeMethod(null,forName,otab);
++          c = (Class)o;		// sun.misc.Unsafe class
++          // Test FAILED: Should n't have got the reference.   
++          throw new RuntimeException("Test Failed: Got reference to: "+o);
++
++
++          //o=invokeMethod(c,getMethod, new Object[]{"getUnsafe", (Class[])null});
++          //System.out.println("Got reference to: "+o);
++          //throw new RuntimeException("Got reference to: "+o);
++          //o=invokeMethod(c,(Method)o,null);
++          //System.out.println("Got reference to: "+o);
++          //throw new RuntimeException("Got reference to: "+o);
++   
++      } catch(java.security.AccessControlException e) {
++          System.out.println("Test passed");
++          //e.printStackTrace();
++      } 
++   }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/6733959.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,19 @@
+diff -Nru openjdk.orig/jdk/src/share/bin/java.c openjdk/jdk/src/share/bin/java.c
+--- openjdk.orig/jdk/src/share/bin/java.c	2009-05-12 23:35:16.000000000 +0100
++++ openjdk/jdk/src/share/bin/java.c	2009-05-12 23:43:56.000000000 +0100
+@@ -885,8 +885,14 @@
+      * "Valid" returns (other than unrecoverable errors) follow.  Set
+      * main_class as a side-effect of this routine.
+      */
+-    if (info.main_class != NULL)
++    if (info.main_class != NULL) {
++      if (strlen(info.main_class) <= MAXNAMELEN) {
+         *main_class = JLI_StringDup(info.main_class);
++      } else {
++        JLI_ReportErrorMessage("Error: main-class: attribute exceeds system limits\n", JNI_TRUE);
++	exit(1);
++      }
++    }
+ 
+     /*
+      * If no version selection information is found either on the command
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/6755943.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,373 @@
+diff -Nru openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java
+--- openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java	2008-12-02 15:42:47.000000000 +0000
+@@ -0,0 +1,369 @@
++/*
++ * Copyright 2008 Sun Microsystems, Inc.  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
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * @test
++ * @bug 6755943
++ * @summary Checks any memory overruns in archive length.
++ * @run main/timeout=1200 MemoryAllocatorTest
++ */
++import java.io.BufferedReader;
++import java.io.DataOutputStream;
++import java.io.File;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.io.InputStreamReader;
++import java.io.OutputStream;
++import java.io.RandomAccessFile;
++import java.nio.MappedByteBuffer;
++import java.nio.channels.FileChannel;
++import java.util.ArrayList;
++import java.util.List;
++import java.util.Map;
++
++public class MemoryAllocatorTest {
++
++    /*
++     * The smallest possible pack file with 1 empty resource
++     */
++    static int[] magic = {
++        0xCA, 0xFE, 0xD0, 0x0D
++    };
++    static int[] version_info = {
++        0x07, // minor
++        0x96  // major
++    };
++    static int[] option = {
++        0x10
++    };
++    static int[] size_hi = {
++        0x00
++    };
++    static int[] size_lo_ulong = {
++        0xFF, 0xFC, 0xFC, 0xFC, 0xFC // ULONG_MAX 0xFFFFFFFF
++    };
++    static int[] size_lo_correct = {
++        0x17
++    };
++    static int[] data = {
++        0x00, 0xEC, 0xDA, 0xDE, 0xF8, 0x45, 0x01, 0x02,
++        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++        0x00, 0x00, 0x00, 0x01, 0x31, 0x01, 0x00
++    };
++    // End of pack file data
++
++    static final String JAVA_HOME = System.getProperty("java.home");
++
++    static final boolean debug = Boolean.getBoolean("MemoryAllocatorTest.Debug");
++    static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows");
++    static final boolean LINUX = System.getProperty("os.name").startsWith("Linux");
++    static final boolean SIXTYFOUR_BIT = System.getProperty("sun.arch.data.model", "32").equals("64");
++    static final private int EXPECTED_EXIT_CODE = (WINDOWS) ? -1 : 255;
++
++    static int testExitValue = 0;
++    
++    static byte[] bytes(int[] a) {
++        byte[] b = new byte[a.length];
++        for (int i = 0; i < b.length; i++) {
++            b[i] = (byte) a[i];
++        }
++        return b;
++    }
++    
++    static void createPackFile(boolean good, File packFile) throws IOException {
++        FileOutputStream fos = new FileOutputStream(packFile);
++        fos.write(bytes(magic));
++        fos.write(bytes(version_info));
++        fos.write(bytes(option));
++        fos.write(bytes(size_hi));
++        if (good) {
++            fos.write(bytes(size_lo_correct));
++        } else {
++            fos.write(bytes(size_lo_ulong));
++        }
++        fos.write(bytes(data));
++    }
++
++    /*
++     * This method modifies the LSB of the size_lo for various wicked
++     * values between MAXINT-0x3F and MAXINT.
++     */
++    static int modifyPackFile(File packFile) throws IOException {
++        RandomAccessFile raf = new RandomAccessFile(packFile, "rws");
++        long len = packFile.length();
++        FileChannel fc = raf.getChannel();
++        MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_WRITE, 0, len);
++        int pos = magic.length + version_info.length + option.length +
++                size_hi.length;
++        byte value = bb.get(pos);
++        value--;
++        bb.position(pos);
++        bb.put(value);
++        bb.force();
++        fc.truncate(len);
++        fc.close();
++        return value & 0xFF;
++    }
++
++    static String getUnpack200Cmd() throws Exception {
++        File binDir = new File(JAVA_HOME, "bin");
++        File unpack200File = WINDOWS
++                ? new File(binDir, "unpack200.exe")
++                : new File(binDir, "unpack200");
++
++        String cmd = unpack200File.getAbsolutePath();
++        if (!unpack200File.canExecute()) {
++            throw new Exception("please check" +
++                    cmd + " exists and is executable");
++        }
++        return cmd;
++    }
++
++    static TestResult runUnpacker(File packFile) throws Exception {
++        if (!packFile.exists()) {
++            throw new Exception("please check" + packFile + " exists");
++        }
++        ArrayList<String> alist = new ArrayList<String>();
++        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(),
++                packFile.getName(), "testout.jar");
++        Map<String, String> env = pb.environment();
++        pb.directory(new File("."));
++        int retval = 0;
++        try {
++            pb.redirectErrorStream(true);
++            Process p = pb.start();
++            BufferedReader rd = new BufferedReader(
++                    new InputStreamReader(p.getInputStream()), 8192);
++            String in = rd.readLine();
++            while (in != null) {
++                alist.add(in);
++                System.out.println(in);
++                in = rd.readLine();
++            }
++            retval = p.waitFor();
++            p.destroy();
++        } catch (Exception ex) {
++            ex.printStackTrace();
++            throw new RuntimeException(ex.getMessage());
++        }
++        return new TestResult("", retval, alist);
++    }
++
++    /*
++     * The debug version builds of unpack200 call abort(3) which might set
++     * an unexpected return value, therefore this test is to determine
++     * if we are using a product or non-product build and check the
++     * return value appropriately.
++     */
++    static boolean isNonProductVersion() throws Exception {
++        ArrayList<String> alist = new ArrayList<String>();
++        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(), "--version");
++        Map<String, String> env = pb.environment();
++        pb.directory(new File("."));
++        int retval = 0;
++        try {
++            pb.redirectErrorStream(true);
++            Process p = pb.start();
++            BufferedReader rd = new BufferedReader(
++                    new InputStreamReader(p.getInputStream()), 8192);
++            String in = rd.readLine();
++            while (in != null) {
++                alist.add(in);
++                System.out.println(in);
++                in = rd.readLine();
++            }
++            retval = p.waitFor();
++            p.destroy();
++        } catch (Exception ex) {
++            ex.printStackTrace();
++            throw new RuntimeException(ex.getMessage());
++        }
++        for (String x : alist) {
++            if (x.contains("non-product")) {
++                return true;
++            }
++        }
++        return false;
++    }
++
++    /**
++     * @param args the command line arguments
++     * @throws java.lang.Exception 
++     */
++    public static void main(String[] args) throws Exception {
++
++        File packFile = new File("tiny.pack");
++        boolean isNPVersion = isNonProductVersion();
++
++        // Create a good pack file and test if everything is ok
++        createPackFile(true, packFile);
++        TestResult tr = runUnpacker(packFile);
++        tr.setDescription("a good pack file");
++        tr.checkPositive();
++        tr.isOK();
++        System.out.println(tr);
++
++        /*
++         * jprt systems on windows and linux seem to have abundant memory
++         * therefore can take a very long time to run, and even if it does
++         * the error message is not accurate for us to discern if the test
++         * passes successfully.
++         */
++        if (SIXTYFOUR_BIT && (LINUX || WINDOWS)) {
++            System.out.println("Warning: Windows/Linux 64bit tests passes vacuously");
++            return;
++        }
++        
++        /*
++         * debug builds call abort, the exit code under these conditions
++         * are not really relevant.
++         */
++        if (isNPVersion) {
++            System.out.println("Warning: non-product build: exit values not checked");
++        }
++    
++        // create a bad pack file
++        createPackFile(false, packFile);
++        tr = runUnpacker(packFile);
++        tr.setDescription("a wicked pack file");
++        tr.contains("Native allocation failed");
++        if(!isNPVersion) {
++            tr.checkValue(EXPECTED_EXIT_CODE);
++        }
++        System.out.println(tr);
++        int value = modifyPackFile(packFile);
++        tr.setDescription("value=" + value);
++
++        // continue creating bad pack files by modifying the specimen pack file.
++        while (value >= 0xc0) {
++            tr = runUnpacker(packFile);
++            tr.contains("Native allocation failed");
++            if (!isNPVersion) {
++                tr.checkValue(EXPECTED_EXIT_CODE);
++            }
++            tr.setDescription("wicked value=0x" +
++                    Integer.toHexString(value & 0xFF));
++            System.out.println(tr);
++            value = modifyPackFile(packFile);
++        }
++        if (testExitValue != 0) {
++            throw new Exception("Pack200 archive length tests(" +
++                    testExitValue + ") failed ");
++        } else {
++            System.out.println("All tests pass");
++        }
++    }
++
++    /*
++     * A class to encapsulate the test results and stuff, with some ease
++     * of use methods to check the test results.
++     */
++    static class TestResult {
++
++        StringBuilder status;
++        int exitValue;
++        List<String> testOutput;
++        String description;
++
++        public TestResult(String str, int rv, List<String> oList) {
++            status = new StringBuilder(str);
++            exitValue = rv;
++            testOutput = oList;
++        }
++
++        void setDescription(String description) {
++            this.description = description;
++        }
++
++        void checkValue(int value) {
++            if (exitValue != value) {
++                status =
++                        status.append("  Error: test expected exit value " +
++                        value + "got " + exitValue);
++                testExitValue++;
++            }
++        }
++
++        void checkNegative() {
++            if (exitValue == 0) {
++                status = status.append(
++                        "  Error: test did not expect 0 exit value");
++
++                testExitValue++;
++            }
++        }
++
++        void checkPositive() {
++            if (exitValue != 0) {
++                status = status.append(
++                        "  Error: test did not return 0 exit value");
++                testExitValue++;
++            }
++        }
++
++        boolean isOK() {
++            return exitValue == 0;
++        }
++
++        boolean isZeroOutput() {
++            if (!testOutput.isEmpty()) {
++                status = status.append("  Error: No message from cmd please");
++                testExitValue++;
++                return false;
++            }
++            return true;
++        }
++
++        boolean isNotZeroOutput() {
++            if (testOutput.isEmpty()) {
++                status = status.append("  Error: Missing message");
++                testExitValue++;
++                return false;
++            }
++            return true;
++        }
++
++        public String toString() {
++            if (debug) {
++                for (String x : testOutput) {
++                    status = status.append(x + "\n");
++                }
++            }
++            if (description != null) {
++                status.insert(0, description);
++            }
++            return status.append("\nexitValue = " + exitValue).toString();
++        }
++
++        boolean contains(String str) {
++            for (String x : testOutput) {
++                if (x.contains(str)) {
++                    return true;
++                }
++            }
++            status = status.append("   Error: string <" + str + "> not found ");
++            testExitValue++;
++            return false;
++        }
++    }
++}
--- a/patches/security/icedtea-6592792.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-diff -Nru openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java
---- openjdk.orig/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/com/sun/org/apache/xml/internal/ws/server/Test.java	2009-05-12 23:41:24.000000000 +0100
-@@ -0,0 +1,65 @@
-+/*
-+ *  @test
-+ *  @bug 6592792
-+ *  @summary Add com.sun.xml.internal to the "package.access" property in $JAVA_HOME/lib/security/java.security
-+ *  @run shell Test6592792.sh
-+ */
-+
-+import java.lang.*;
-+import java.lang.reflect.*;
-+import com.sun.xml.internal.ws.server.*;
-+import com.sun.xml.internal.ws.server.SingletonResolver;
-+import com.sun.xml.internal.ws.api.server.*;
-+
-+public class Test {
-+
-+  public static void main(String[] args) throws Exception{
-+      // Enable the security manager
-+      SecurityManager sm = new SecurityManager();
-+      System.setSecurityManager(sm);
-+      new Test();
-+  }
-+
-+  Object invokeMethod(Object target,Method m,Object args[]) throws Exception {
-+      SingletonResolver r = new SingletonResolver(target);
-+      Invoker invoker = r.createInvoker();
-+      return invoker.invoke(null, m, args);
-+  }
-+
-+  public Test() throws Exception{
-+      try {
-+          Class c=Class.forName("java.lang.Class");
-+
-+          Class ctab[]=new Class[1];
-+          ctab[0]=Class.forName("java.lang.String");
-+          Method forName=c.getMethod("forName",ctab);
-+
-+          Class gtab[]=new Class[2];
-+          gtab[0]=Class.forName("java.lang.String");
-+          gtab[1]=Class[].class;
-+          Method getMethod=c.getMethod("getMethod",gtab);
-+
-+          Method newInstance=c.getMethod("newInstance",(Class[])null);
-+
-+          Object otab[]=new Object[1];
-+          otab[0]="sun.misc.Unsafe";
-+
-+          Object o=invokeMethod(null,forName,otab);
-+          c = (Class)o;		// sun.misc.Unsafe class
-+          // Test FAILED: Should n't have got the reference.   
-+          throw new RuntimeException("Test Failed: Got reference to: "+o);
-+
-+
-+          //o=invokeMethod(c,getMethod, new Object[]{"getUnsafe", (Class[])null});
-+          //System.out.println("Got reference to: "+o);
-+          //throw new RuntimeException("Got reference to: "+o);
-+          //o=invokeMethod(c,(Method)o,null);
-+          //System.out.println("Got reference to: "+o);
-+          //throw new RuntimeException("Got reference to: "+o);
-+   
-+      } catch(java.security.AccessControlException e) {
-+          System.out.println("Test passed");
-+          //e.printStackTrace();
-+      } 
-+   }
-+}
--- a/patches/security/icedtea-6733959.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/share/bin/java.c openjdk/jdk/src/share/bin/java.c
---- openjdk.orig/jdk/src/share/bin/java.c	2009-05-12 23:35:16.000000000 +0100
-+++ openjdk/jdk/src/share/bin/java.c	2009-05-12 23:43:56.000000000 +0100
-@@ -885,8 +885,14 @@
-      * "Valid" returns (other than unrecoverable errors) follow.  Set
-      * main_class as a side-effect of this routine.
-      */
--    if (info.main_class != NULL)
-+    if (info.main_class != NULL) {
-+      if (strlen(info.main_class) <= MAXNAMELEN) {
-         *main_class = JLI_StringDup(info.main_class);
-+      } else {
-+        JLI_ReportErrorMessage("Error: main-class: attribute exceeds system limits\n", JNI_TRUE);
-+	exit(1);
-+      }
-+    }
- 
-     /*
-      * If no version selection information is found either on the command
--- a/patches/security/icedtea-6755943.patch	Tue May 03 14:44:49 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,373 +0,0 @@
-diff -Nru openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java
---- openjdk.orig/jdk/test/tools/pack200/MemoryAllocatorTest.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/tools/pack200/MemoryAllocatorTest.java	2008-12-02 15:42:47.000000000 +0000
-@@ -0,0 +1,369 @@
-+/*
-+ * Copyright 2008 Sun Microsystems, Inc.  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
-+ * under the terms of the GNU General Public License version 2 only, as
-+ * published by the Free Software Foundation.
-+ *
-+ * This code is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * version 2 for more details (a copy is included in the LICENSE file that
-+ * accompanied this code).
-+ *
-+ * You should have received a copy of the GNU General Public License version
-+ * 2 along with this work; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+ *
-+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+ * CA 95054 USA or visit www.sun.com if you need additional information or
-+ * have any questions.
-+ */
-+
-+/*
-+ * @test
-+ * @bug 6755943
-+ * @summary Checks any memory overruns in archive length.
-+ * @run main/timeout=1200 MemoryAllocatorTest
-+ */
-+import java.io.BufferedReader;
-+import java.io.DataOutputStream;
-+import java.io.File;
-+import java.io.FileOutputStream;
-+import java.io.IOException;
-+import java.io.InputStreamReader;
-+import java.io.OutputStream;
-+import java.io.RandomAccessFile;
-+import java.nio.MappedByteBuffer;
-+import java.nio.channels.FileChannel;
-+import java.util.ArrayList;
-+import java.util.List;
-+import java.util.Map;
-+
-+public class MemoryAllocatorTest {
-+
-+    /*
-+     * The smallest possible pack file with 1 empty resource
-+     */
-+    static int[] magic = {
-+        0xCA, 0xFE, 0xD0, 0x0D
-+    };
-+    static int[] version_info = {
-+        0x07, // minor
-+        0x96  // major
-+    };
-+    static int[] option = {
-+        0x10
-+    };
-+    static int[] size_hi = {
-+        0x00
-+    };
-+    static int[] size_lo_ulong = {
-+        0xFF, 0xFC, 0xFC, 0xFC, 0xFC // ULONG_MAX 0xFFFFFFFF
-+    };
-+    static int[] size_lo_correct = {
-+        0x17
-+    };
-+    static int[] data = {
-+        0x00, 0xEC, 0xDA, 0xDE, 0xF8, 0x45, 0x01, 0x02,
-+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+        0x00, 0x00, 0x00, 0x01, 0x31, 0x01, 0x00
-+    };
-+    // End of pack file data
-+
-+    static final String JAVA_HOME = System.getProperty("java.home");
-+
-+    static final boolean debug = Boolean.getBoolean("MemoryAllocatorTest.Debug");
-+    static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows");
-+    static final boolean LINUX = System.getProperty("os.name").startsWith("Linux");
-+    static final boolean SIXTYFOUR_BIT = System.getProperty("sun.arch.data.model", "32").equals("64");
-+    static final private int EXPECTED_EXIT_CODE = (WINDOWS) ? -1 : 255;
-+
-+    static int testExitValue = 0;
-+    
-+    static byte[] bytes(int[] a) {
-+        byte[] b = new byte[a.length];
-+        for (int i = 0; i < b.length; i++) {
-+            b[i] = (byte) a[i];
-+        }
-+        return b;
-+    }
-+    
-+    static void createPackFile(boolean good, File packFile) throws IOException {
-+        FileOutputStream fos = new FileOutputStream(packFile);
-+        fos.write(bytes(magic));
-+        fos.write(bytes(version_info));
-+        fos.write(bytes(option));
-+        fos.write(bytes(size_hi));
-+        if (good) {
-+            fos.write(bytes(size_lo_correct));
-+        } else {
-+            fos.write(bytes(size_lo_ulong));
-+        }
-+        fos.write(bytes(data));
-+    }
-+
-+    /*
-+     * This method modifies the LSB of the size_lo for various wicked
-+     * values between MAXINT-0x3F and MAXINT.
-+     */
-+    static int modifyPackFile(File packFile) throws IOException {
-+        RandomAccessFile raf = new RandomAccessFile(packFile, "rws");
-+        long len = packFile.length();
-+        FileChannel fc = raf.getChannel();
-+        MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_WRITE, 0, len);
-+        int pos = magic.length + version_info.length + option.length +
-+                size_hi.length;
-+        byte value = bb.get(pos);
-+        value--;
-+        bb.position(pos);
-+        bb.put(value);
-+        bb.force();
-+        fc.truncate(len);
-+        fc.close();
-+        return value & 0xFF;
-+    }
-+
-+    static String getUnpack200Cmd() throws Exception {
-+        File binDir = new File(JAVA_HOME, "bin");
-+        File unpack200File = WINDOWS
-+                ? new File(binDir, "unpack200.exe")
-+                : new File(binDir, "unpack200");
-+
-+        String cmd = unpack200File.getAbsolutePath();
-+        if (!unpack200File.canExecute()) {
-+            throw new Exception("please check" +
-+                    cmd + " exists and is executable");
-+        }
-+        return cmd;
-+    }
-+
-+    static TestResult runUnpacker(File packFile) throws Exception {
-+        if (!packFile.exists()) {
-+            throw new Exception("please check" + packFile + " exists");
-+        }
-+        ArrayList<String> alist = new ArrayList<String>();
-+        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(),
-+                packFile.getName(), "testout.jar");
-+        Map<String, String> env = pb.environment();
-+        pb.directory(new File("."));
-+        int retval = 0;
-+        try {
-+            pb.redirectErrorStream(true);
-+            Process p = pb.start();
-+            BufferedReader rd = new BufferedReader(
-+                    new InputStreamReader(p.getInputStream()), 8192);
-+            String in = rd.readLine();
-+            while (in != null) {
-+                alist.add(in);
-+                System.out.println(in);
-+                in = rd.readLine();
-+            }
-+            retval = p.waitFor();
-+            p.destroy();
-+        } catch (Exception ex) {
-+            ex.printStackTrace();
-+            throw new RuntimeException(ex.getMessage());
-+        }
-+        return new TestResult("", retval, alist);
-+    }
-+
-+    /*
-+     * The debug version builds of unpack200 call abort(3) which might set
-+     * an unexpected return value, therefore this test is to determine
-+     * if we are using a product or non-product build and check the
-+     * return value appropriately.
-+     */
-+    static boolean isNonProductVersion() throws Exception {
-+        ArrayList<String> alist = new ArrayList<String>();
-+        ProcessBuilder pb = new ProcessBuilder(getUnpack200Cmd(), "--version");
-+        Map<String, String> env = pb.environment();
-+        pb.directory(new File("."));
-+        int retval = 0;
-+        try {
-+            pb.redirectErrorStream(true);
-+            Process p = pb.start();
-+            BufferedReader rd = new BufferedReader(
-+                    new InputStreamReader(p.getInputStream()), 8192);
-+            String in = rd.readLine();
-+            while (in != null) {
-+                alist.add(in);
-+                System.out.println(in);
-+                in = rd.readLine();
-+            }
-+            retval = p.waitFor();
-+            p.destroy();
-+        } catch (Exception ex) {
-+            ex.printStackTrace();
-+            throw new RuntimeException(ex.getMessage());
-+        }
-+        for (String x : alist) {
-+            if (x.contains("non-product")) {
-+                return true;
-+            }
-+        }
-+        return false;
-+    }
-+
-+    /**
-+     * @param args the command line arguments
-+     * @throws java.lang.Exception 
-+     */
-+    public static void main(String[] args) throws Exception {
-+
-+        File packFile = new File("tiny.pack");
-+        boolean isNPVersion = isNonProductVersion();
-+
-+        // Create a good pack file and test if everything is ok
-+        createPackFile(true, packFile);
-+        TestResult tr = runUnpacker(packFile);
-+        tr.setDescription("a good pack file");
-+        tr.checkPositive();
-+        tr.isOK();
-+        System.out.println(tr);
-+
-+        /*
-+         * jprt systems on windows and linux seem to have abundant memory
-+         * therefore can take a very long time to run, and even if it does
-+         * the error message is not accurate for us to discern if the test
-+         * passes successfully.
-+         */
-+        if (SIXTYFOUR_BIT && (LINUX || WINDOWS)) {
-+            System.out.println("Warning: Windows/Linux 64bit tests passes vacuously");
-+            return;
-+        }
-+        
-+        /*
-+         * debug builds call abort, the exit code under these conditions
-+         * are not really relevant.
-+         */
-+        if (isNPVersion) {
-+            System.out.println("Warning: non-product build: exit values not checked");
-+        }
-+    
-+        // create a bad pack file
-+        createPackFile(false, packFile);
-+        tr = runUnpacker(packFile);
-+        tr.setDescription("a wicked pack file");
-+        tr.contains("Native allocation failed");
-+        if(!isNPVersion) {
-+            tr.checkValue(EXPECTED_EXIT_CODE);
-+        }
-+        System.out.println(tr);
-+        int value = modifyPackFile(packFile);
-+        tr.setDescription("value=" + value);
-+
-+        // continue creating bad pack files by modifying the specimen pack file.
-+        while (value >= 0xc0) {
-+            tr = runUnpacker(packFile);
-+            tr.contains("Native allocation failed");
-+            if (!isNPVersion) {
-+                tr.checkValue(EXPECTED_EXIT_CODE);
-+            }
-+            tr.setDescription("wicked value=0x" +
-+                    Integer.toHexString(value & 0xFF));
-+            System.out.println(tr);
-+            value = modifyPackFile(packFile);
-+        }
-+        if (testExitValue != 0) {
-+            throw new Exception("Pack200 archive length tests(" +
-+                    testExitValue + ") failed ");
-+        } else {
-+            System.out.println("All tests pass");
-+        }
-+    }
-+
-+    /*
-+     * A class to encapsulate the test results and stuff, with some ease
-+     * of use methods to check the test results.
-+     */
-+    static class TestResult {
-+
-+        StringBuilder status;
-+        int exitValue;
-+        List<String> testOutput;
-+        String description;
-+
-+        public TestResult(String str, int rv, List<String> oList) {
-+            status = new StringBuilder(str);
-+            exitValue = rv;
-+            testOutput = oList;
-+        }
-+
-+        void setDescription(String description) {
-+            this.description = description;
-+        }
-+
-+        void checkValue(int value) {
-+            if (exitValue != value) {
-+                status =
-+                        status.append("  Error: test expected exit value " +
-+                        value + "got " + exitValue);
-+                testExitValue++;
-+            }
-+        }
-+
-+        void checkNegative() {
-+            if (exitValue == 0) {
-+                status = status.append(
-+                        "  Error: test did not expect 0 exit value");
-+
-+                testExitValue++;
-+            }
-+        }
-+
-+        void checkPositive() {
-+            if (exitValue != 0) {
-+                status = status.append(
-+                        "  Error: test did not return 0 exit value");
-+                testExitValue++;
-+            }
-+        }
-+
-+        boolean isOK() {
-+            return exitValue == 0;
-+        }
-+
-+        boolean isZeroOutput() {
-+            if (!testOutput.isEmpty()) {
-+                status = status.append("  Error: No message from cmd please");
-+                testExitValue++;
-+                return false;
-+            }
-+            return true;
-+        }
-+
-+        boolean isNotZeroOutput() {
-+            if (testOutput.isEmpty()) {
-+                status = status.append("  Error: Missing message");
-+                testExitValue++;
-+                return false;
-+            }
-+            return true;
-+        }
-+
-+        public String toString() {
-+            if (debug) {
-+                for (String x : testOutput) {
-+                    status = status.append(x + "\n");
-+                }
-+            }
-+            if (description != null) {
-+                status.insert(0, description);
-+            }
-+            return status.append("\nexitValue = " + exitValue).toString();
-+        }
-+
-+        boolean contains(String str) {
-+            for (String x : testOutput) {
-+                if (x.contains(str)) {
-+                    return true;
-+                }
-+            }
-+            status = status.append("   Error: string <" + str + "> not found ");
-+            testExitValue++;
-+            return false;
-+        }
-+    }
-+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/signed-types.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,36 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp
+--- openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp	2011-03-14 22:09:03.000000000 +0000
++++ openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp	2011-03-15 23:15:53.055192661 +0000
+@@ -93,7 +93,7 @@
+   address     _locs_point;      // last relocated position (grows upward)
+   bool        _locs_own;        // did I allocate the locs myself?
+   bool        _frozen;          // no more expansion of this section
+-  char        _index;           // my section number (SECT_INST, etc.)
++  signed char _index;           // my section number (SECT_INST, etc.)
+   CodeBuffer* _outer;           // enclosing CodeBuffer
+ 
+   // (Note:  _locs_point used to be called _last_reloc_offset.)
+diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciTypeFlow.cpp openjdk/hotspot/src/share/vm/ci/ciTypeFlow.cpp
+--- openjdk.orig/hotspot/src/share/vm/ci/ciTypeFlow.cpp	2011-03-14 22:09:03.000000000 +0000
++++ openjdk/hotspot/src/share/vm/ci/ciTypeFlow.cpp	2011-03-15 23:15:53.055192661 +0000
+@@ -403,7 +403,7 @@
+   // Set the rest of the locals to bottom.
+   Cell cell = state->next_cell(state->tos());
+   state->set_stack_size(0);
+-  int limit = state->limit_cell();
++  Cell limit = state->limit_cell();
+   for (; cell < limit; cell = state->next_cell(cell)) {
+     state->set_type_at(cell, state->bottom_type());
+   }
+diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/ostream.cpp openjdk/hotspot/src/share/vm/utilities/ostream.cpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/ostream.cpp	2011-03-14 22:09:03.000000000 +0000
++++ openjdk/hotspot/src/share/vm/utilities/ostream.cpp	2011-03-15 23:16:13.990549499 +0000
+@@ -915,7 +915,7 @@
+   server.sin_port = htons(port);
+ 
+   server.sin_addr.s_addr = inet_addr(ip);
+-  if (server.sin_addr.s_addr == (uint32_t)-1) {
++  if (server.sin_addr.s_addr == (in_addr_t)-1) {
+     struct hostent* host = os::get_host_by_name((char*)ip);
+     if (host != NULL) {
+       memcpy(&server.sin_addr, host->h_addr_list[0], host->h_length);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/sources.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,17 @@
+diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
+--- openjdk.orig/jdk/make/common/Release.gmk	2009-11-11 03:12:50.000000000 +0000
++++ openjdk/jdk/make/common/Release.gmk	2009-11-11 03:16:17.000000000 +0000
+@@ -313,7 +313,12 @@
+ 	org/omg				\
+ 	org/w3c/dom			\
+ 	org/xml/sax			\
+-	sunw
++	sunw				\
++	sun/applet			\
++	netscape			\
++	net				\
++	javax/jnlp
++
+ #
+ # Directories where sources may be found.  If a file with the same path
+ # name exists in more than one of these places, the one found last on this
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/sparc-trapsfix.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,12 @@
+--- openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp.orig	2010-01-16 23:19:45.703450297 +0000
++++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2010-01-16 23:21:23.942337146 +0000
+@@ -25,7 +25,8 @@
+ #include "incls/_precompiled.incl"
+ #include "incls/_assembler_linux_sparc.cpp.incl"
+ 
+-#include <asm-sparc/traps.h>
++// always found in asm/ with merged sparc/sparc64 headers
++#include <asm/traps.h>
+ 
+ void MacroAssembler::read_ccr_trap(Register ccr_save) {
+   // No implementation
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/sunsrc.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,59 @@
+diff -Nru openjdk.orig/jdk/make/common/Release.gmk openjdk/jdk/make/common/Release.gmk
+--- openjdk.orig/jdk/make/common/Release.gmk	2010-08-27 19:16:10.000000000 +0100
++++ openjdk/jdk/make/common/Release.gmk	2010-08-31 18:26:34.688231634 +0100
+@@ -345,8 +345,6 @@
+ # Bug 5008685 - exclude jconsole from sun/tools
+ #
+ TOOLS = \
+-	META-INF/services/com.sun.jdi.connect.Connector \
+-	META-INF/services/com.sun.jdi.connect.spi.TransportService \
+ 	sun/tools/asm		\
+ 	sun/tools/jar		\
+ 	sun/tools/java		\
+@@ -389,8 +387,6 @@
+ 	com/sun/tools/corba     \
+ 	com/sun/tools/internal/xjc       \
+ 	com/sun/tools/internal/ws       \
+-	META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
+-	META-INF/services/com.sun.tools.xjc.Plugin \
+ 	com/sun/istack/internal/tools       \
+ 	com/sun/istack/internal/ws       \
+         com/sun/codemodel       \
+@@ -401,7 +397,6 @@
+ 	com/sun/xml/internal/dtdparser \
+ 	com/sun/tools/jdi	\
+ 	com/sun/tools/script/shell	\
+-	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
+ 	com/sun/tools/attach	\
+ 	sun/tools/attach	\
+ 	sun/tools/jstack        \
+@@ -565,10 +560,6 @@
+ 	$(ECHO) "com/sun/source/" >> $@
+ 	$(ECHO) "com/sun/istack/internal/tools/" >> $@
+ 	$(ECHO) "com/sun/istack/internal/ws/" >> $@
+-	$(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@
+-	$(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@
+-	$(ECHO) "META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory" >> $@
+-	$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
+ 	$(ECHO) "com/sun/tools/" >> $@
+ 	$(ECHO) "sun/jvmstat/" >> $@
+ 	$(ECHO) "sun/nio/cs/ext/" >> $@
+@@ -611,7 +602,6 @@
+ 	$(ECHO) "javax/crypto/" >> $@
+ 	$(ECHO) "sun/security/internal/" >> $@
+ 	$(ECHO) "com/sun/crypto/provider/" >> $@
+-	$(ECHO) "META-INF/services/com.sun.tools.attach.spi.AttachProvider" >> $@
+ 	$(ECHO) "com/sun/tools/attach/" >> $@
+ 	$(ECHO) "org/relaxng/datatype/" >> $@
+ 	$(ECHO) "com/sun/codemodel/" >> $@
+@@ -645,6 +635,10 @@
+ 	    $(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
+ 		-o  $@.temp $(ABS_LIBDIR)/classlist $(NOT_RT_JAR_LIST) . )
+ 	$(MV) $@.temp $@
++	$(CAT) $@ | $(GREP) "^sun" | $(GREP) "class" | $(GREP) -v '\$$' \
++	  > $(ABS_TEMPDIR)/sun_classes_list
++	sed 's/\.class/\.java/' < $(ABS_TEMPDIR)/sun_classes_list \
++	  > $(ABS_TEMPDIR)/sun_sources_list
+ 	@($(CD) $(CLASSBINDIR) && $(java-vm-cleanup))
+ 
+ # Create the rt.jar file list & non-class files list
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/systemtap.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,162 @@
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/dtrace.make openjdk/hotspot/make/linux/makefiles/dtrace.make
+--- openjdk.orig/hotspot/make/linux/makefiles/dtrace.make	2010-07-29 21:54:46.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/dtrace.make	2011-03-16 20:52:47.269527251 +0000
+@@ -25,3 +25,7 @@
+ # Linux does not build jvm_db
+ LIBJVM_DB =
+ 
++# But it does have a Systemtap dtrace compatible sys/sdt.h
++CFLAGS += -DDTRACE_ENABLED
++
++# It doesn't support HAVE_DTRACE_H though.
+diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp
+--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp	2011-03-14 22:09:03.000000000 +0000
++++ openjdk/hotspot/src/share/vm/prims/jni.cpp	2011-03-16 20:52:47.277527381 +0000
+@@ -1817,10 +1817,7 @@
+ JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \
+   JNIWrapper("Set" XSTR(Result) "Field"); \
+ \
+-  HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \
+-    ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
+-  HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \
+-    ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
++  FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \
+ \
+   oop o = JNIHandles::resolve_non_null(obj); \
+   klassOop k = o->klass(); \
+@@ -1994,10 +1991,7 @@
+ \
+ JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \
+   JNIWrapper("SetStatic" XSTR(Result) "Field"); \
+-  HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\
+-    ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
+-  HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \
+-    ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
++  FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \
+ \
+   JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \
+   assert(id->is_static_field_id(), "invalid static field id"); \
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2011-03-16 20:51:33.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2011-03-16 20:52:47.277527381 +0000
+@@ -2634,16 +2634,16 @@
+       FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false);
+       FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true);
+     } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) {
+-#ifdef SOLARIS
++#ifdef DTRACE_ENABLED
+       FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true);
+       FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true);
+       FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true);
+       FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true);
+-#else // ndef SOLARIS
++#else // ndef DTRACE_ENABLED
+       jio_fprintf(defaultStream::error_stream(),
+-                  "ExtendedDTraceProbes flag is only applicable on Solaris\n");
++                  "ExtendedDTraceProbes flag is only applicable on dtrace enabled builds\n");
+       return JNI_EINVAL;
+-#endif // ndef SOLARIS
++#endif // ndef DTRACE_ENABLED
+ #ifdef ASSERT
+     } else if (match_option(option, "-XX:+FullGCALot", &tail)) {
+       FLAG_SET_CMDLINE(bool, FullGCALot, true);
+diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp openjdk/hotspot/src/share/vm/utilities/dtrace.hpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp	2011-03-14 22:09:03.000000000 +0000
++++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp	2011-03-16 20:53:58.314683506 +0000
+@@ -1,5 +1,6 @@
+ /*
+  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright 2009 Red Hat, Inc.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -25,7 +26,7 @@
+ #ifndef SHARE_VM_UTILITIES_DTRACE_HPP
+ #define SHARE_VM_UTILITIES_DTRACE_HPP
+ 
+-#if defined(SOLARIS) && defined(DTRACE_ENABLED)
++#if defined(DTRACE_ENABLED)
+ 
+ #include <sys/sdt.h>
+ 
+@@ -36,7 +37,7 @@
+ #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \
+   do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0)
+ 
+-#else // ndef SOLARIS || ndef DTRACE_ENABLED
++#else // ndef DTRACE_ENABLED
+ 
+ #define DTRACE_ONLY(x)
+ #define NOT_DTRACE(x) x
+@@ -47,11 +48,18 @@
+ #define DTRACE_PROBE3(a,b,c,d,e) {;}
+ #define DTRACE_PROBE4(a,b,c,d,e,f) {;}
+ #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;}
++#define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;}
++#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;}
++#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;}
++#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;}
++#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;}
+ 
+ #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
+ 
+ #endif
+ 
++#if defined(SOLARIS)
++// Solaris dtrace needs actual extern function decls.
+ #define HS_DTRACE_PROBE_FN(provider,name)\
+   __dtrace_##provider##___##name
+ 
+@@ -59,6 +67,11 @@
+   DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args)
+ #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \
+   DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args)
++#else
++// Systemtap dtrace compatible probes on GNU/Linux don't.
++#define HS_DTRACE_PROBE_DECL_N(provider,name,args)
++#define HS_DTRACE_PROBE_CDECL_N(provider,name,args)
++#endif 
+ 
+ /* Dtrace probe declarations */
+ #define HS_DTRACE_PROBE_DECL(provider,name) \
+@@ -97,6 +110,8 @@
+     uintptr_t,uintptr_t,uintptr_t))
+ 
+ /* Dtrace probe definitions */
++#if defined(SOLARIS)
++// Solaris dtrace uses actual function calls.
+ #define HS_DTRACE_PROBE_N(provider,name, args) \
+   DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args)
+ 
+@@ -132,5 +147,31 @@
+   HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
+     (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
+     (uintptr_t)a8,(uintptr_t)a9))
++#else
++// Systemtap dtrace compatible probes on GNU/Linux use direct macros.
++#define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name)
++#define HS_DTRACE_PROBE0(provider,name)\
++  DTRACE_PROBE(provider,name)
++#define HS_DTRACE_PROBE1(provider,name,a0)\
++  DTRACE_PROBE1(provider,name,a0)
++#define HS_DTRACE_PROBE2(provider,name,a0,a1)\
++  DTRACE_PROBE2(provider,name,a0,a1)
++#define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\
++  DTRACE_PROBE3(provider,name,a0,a1,a2)
++#define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\
++  DTRACE_PROBE4(provider,name,a0,a1,a2,a3)
++#define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\
++  DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)
++#define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\
++  DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)
++#define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\
++  DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)
++#define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\
++  DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)
++#define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
++  DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
++#define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
++  DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
++#endif
+ 
+ #endif // SHARE_VM_UTILITIES_DTRACE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/testenv.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,48 @@
+diff -Nru openjdk.orig/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java openjdk/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java
+--- openjdk.orig/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2010-07-29 21:56:30.000000000 +0100
++++ openjdk/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	2010-09-01 16:45:06.244592103 +0100
+@@ -39,7 +39,7 @@
+     static void test1() throws Exception {
+         InetAddress bogus = InetAddress.getByName("0.0.0.0");
+         InetSocketAddress saddr = new InetSocketAddress(
+-            InetAddress.getByName(TestUtil.HOST), 23);
++            InetAddress.getByName(TestUtil.HOST), 7);
+ 
+         //Test1: connect only
+         SocketChannel sc = SocketChannel.open();
+diff -Nru openjdk.orig/jdk/test/java/nio/channels/TestUtil.java openjdk/jdk/test/java/nio/channels/TestUtil.java
+--- openjdk.orig/jdk/test/java/nio/channels/TestUtil.java	2010-07-29 21:56:30.000000000 +0100
++++ openjdk/jdk/test/java/nio/channels/TestUtil.java	2010-09-01 16:45:06.244592103 +0100
+@@ -36,9 +36,9 @@
+ 
+     // Test hosts used by the channels tests - change these when
+     // executing in a different network.
+-    public static final String HOST = "javaweb.sfbay.sun.com";
+-    public static final String REFUSING_HOST = "jano1.sfbay.sun.com";
+-    public static final String FAR_HOST = "irejano.ireland.sun.com";
++    public static final String HOST = "icedtea.classpath.org";
++    public static final String REFUSING_HOST = "ns1.gnu.org";
++    public static final String FAR_HOST = "developer.classpath.org";
+     public static final String UNRESOLVABLE_HOST = "blah-blah.blah-blah.blah";
+ 
+     private TestUtil() { }
+diff -Nru openjdk.orig/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh openjdk/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh
+--- openjdk.orig/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2010-07-29 21:56:39.000000000 +0100
++++ openjdk/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh	2010-09-01 16:45:06.252591410 +0100
+@@ -26,14 +26,14 @@
+ 
+ # @test
+ # @bug 4763315
+-# @build CanonicalName Lookup 
++# @build CanonicalName Lookup
+ # @run shell/timeout=120 cname.sh
+ # @summary Test DNS provider's handling of CNAME records
+ 
+ 
+ # The host that we try to resolve
+ 
+-HOST=webcache.sfbay.sun.com
++HOST=developer.classpath.org
+ 
+ # fail gracefully if DNS is not configured or there 
+ # isn't a CNAME record.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/tests-jdk.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,14 @@
+diff -Nru openjdk.orig/jdk/test/sun/tools/native2ascii/NativeErrors.java openjdk/jdk/test/sun/tools/native2ascii/NativeErrors.java
+--- openjdk.orig/jdk/test/sun/tools/native2ascii/NativeErrors.java	2009-05-12 23:26:50.000000000 +0100
++++ openjdk/jdk/test/sun/tools/native2ascii/NativeErrors.java	2009-05-12 23:28:57.000000000 +0100
+@@ -89,8 +89,8 @@
+         }
+         //System.out.println("received: " + errorReceived);
+         //System.out.println("expected: " + errorExpected);
+-        if (!errorReceived.endsWith(errorExpected))
+-            throw new RuntimeException("Native2ascii bad arg error broken.");
++        if (errorReceived == null || !errorReceived.endsWith(errorExpected))
++            throw new RuntimeException("Native2ascii " + errorExpected + " broken.");
+     }
+ 
+     private static String[] getComString(String arg2) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/text-relocations.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,15 @@
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
+--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make	2008-07-17 08:40:27.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/gcc.make	2008-07-21 23:10:50.000000000 +0100
+@@ -46,7 +46,11 @@
+ # Compiler flags
+ 
+ # position-independent code
++ifneq ($(filter ppc ppc64 s390 s390x sparc sparc64 sparcv9,$(ZERO_LIBARCH)),)
+ PICFLAG = -fPIC
++else
++PICFLAG = -fpic
++endif
+ 
+ VM_PICFLAG/LIBJVM = $(PICFLAG)
+ VM_PICFLAG/AOUT   =
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/update-bootclasspath.patch	Tue May 03 22:38:46 2011 +0100
@@ -0,0 +1,13 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/os.cpp openjdk/hotspot/src/share/vm/runtime/os.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/os.cpp	2011-04-20 04:39:42.000000000 +0100
++++ openjdk/hotspot/src/share/vm/runtime/os.cpp	2011-04-21 20:50:09.475567200 +0100
+@@ -1079,6 +1079,9 @@
+         "%/lib/jsse.jar:"
+         "%/lib/jce.jar:"
+         "%/lib/charsets.jar:"
++        "%/lib/netx.jar:"
++        "%/lib/plugin.jar:"
++        "%/lib/rhino.jar:"
+         "%/classes";
+     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
+     if (sysclasspath == NULL) return false;