summaryrefslogtreecommitdiff
path: root/lang/openjdk7/patches
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2013-06-15 09:31:05 +0000
committerjperkin <jperkin@pkgsrc.org>2013-06-15 09:31:05 +0000
commita8cd756c6657cea958c00f6126e6d8a047352811 (patch)
tree2ba0b813caff7ebda73df046147dc9ecf55df1c3 /lang/openjdk7/patches
parent8ed4570a835d3b6d17d2385c4f9668d0b864a51f (diff)
downloadpkgsrc-a8cd756c6657cea958c00f6126e6d8a047352811.tar.gz
Add SunOS/GCC support. With huge thanks to "jesse" from #SmartOS who did the
bulk of the porting work. Tested on SmartOS 32-bit. 64-bit builds currently fail, they should hopefully be fixed soon.
Diffstat (limited to 'lang/openjdk7/patches')
-rw-r--r--lang/openjdk7/patches/patch-aa4
-rw-r--r--lang/openjdk7/patches/patch-ab4
-rw-r--r--lang/openjdk7/patches/patch-ac4
-rw-r--r--lang/openjdk7/patches/patch-ad4
-rw-r--r--lang/openjdk7/patches/patch-ae4
-rw-r--r--lang/openjdk7/patches/patch-af4
-rw-r--r--lang/openjdk7/patches/patch-ag4
-rw-r--r--lang/openjdk7/patches/patch-ah4
-rw-r--r--lang/openjdk7/patches/patch-ai4
-rw-r--r--lang/openjdk7/patches/patch-aj4
-rw-r--r--lang/openjdk7/patches/patch-ak4
-rw-r--r--lang/openjdk7/patches/patch-al4
-rw-r--r--lang/openjdk7/patches/patch-am4
-rw-r--r--lang/openjdk7/patches/patch-an4
-rw-r--r--lang/openjdk7/patches/patch-ao4
-rw-r--r--lang/openjdk7/patches/patch-ap4
-rw-r--r--lang/openjdk7/patches/patch-aq4
-rw-r--r--lang/openjdk7/patches/patch-ar4
-rw-r--r--lang/openjdk7/patches/patch-ba4
-rw-r--r--lang/openjdk7/patches/patch-bd4
-rw-r--r--lang/openjdk7/patches/patch-bg4
-rw-r--r--lang/openjdk7/patches/patch-bh4
-rw-r--r--lang/openjdk7/patches/patch-bi4
-rw-r--r--lang/openjdk7/patches/patch-bj4
-rw-r--r--lang/openjdk7/patches/patch-bk4
-rw-r--r--lang/openjdk7/patches/patch-bl4
-rw-r--r--lang/openjdk7/patches/patch-bn4
-rw-r--r--lang/openjdk7/patches/patch-corba_make_common_shared_Defs-utils.gmk15
-rw-r--r--lang/openjdk7/patches/patch-corba_make_common_shared_Platform.gmk15
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_bsd_makefiles_defs.make4
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_adlc.make18
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_build__vm__def.sh14
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_debug.make19
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_dtrace.make56
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_fastdebug.make19
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_gcc.make120
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jsig.make34
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jvmg.make19
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER1.gcc50
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER2.gcc53
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-TIERED.gcc52
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_optimized.make19
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_product.make25
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_saproc.make23
-rw-r--r--lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_vm.make50
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_atomic__solaris__x86.inline.hpp92
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_orderAccess__solaris__x86.inline.hpp18
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_os__solaris__x86.cpp41
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_prefetch__solaris__x86.inline.hpp35
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_threadLS__solaris__x86.hpp18
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os_posix_vm_os__posix.cpp39
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os_solaris_dtrace_jhelper.d89
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_decoder__solaris.cpp18
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_os__solaris.cpp124
-rw-r--r--lang/openjdk7/patches/patch-hotspot_src_share_vm_utilities_globalDefinitions__gcc.hpp17
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_com_sun_java_pack_Makefile31
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris-gcc.gmk511
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris.gmk23
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_common_Mapfile-vers.gmk42
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_common_Program.gmk36
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_common_shared_Compiler-gcc.gmk15
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-utils.gmk14
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-versions.gmk19
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_java_instrument_Makefile16
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_java_nio_Makefile16
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_java_npt_Makefile19
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_sun_awt_Makefile70
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_sun_awt_mawt.gmk31
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_sun_security_ec_Makefile22
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_sun_splashscreen_Makefile18
-rw-r--r--lang/openjdk7/patches/patch-jdk_make_sun_xawt_Makefile25
-rw-r--r--lang/openjdk7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_defines.h15
-rw-r--r--lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_imageioJPEG.c15
-rw-r--r--lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_jpegdecoder.c15
-rw-r--r--lang/openjdk7/patches/patch-jdk_src_share_native_sun_security_ec_impl_ecc__impl.h33
-rw-r--r--lang/openjdk7/patches/patch-jdk_src_solaris_bin_ergo__i586.c50
-rw-r--r--lang/openjdk7/patches/patch-jdk_src_solaris_native_java_net_NetworkInterface.c45
-rw-r--r--lang/openjdk7/patches/patch-jdk_src_solaris_native_sun_awt_X11Color.c15
-rw-r--r--lang/openjdk7/patches/patch-jdk_test_Makefile28
-rw-r--r--lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4168475_Test4168475.java15
-rw-r--r--lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4520754_Test4520754.java15
-rw-r--r--lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_Test4144543.java16
-rw-r--r--lang/openjdk7/patches/patch-jdk_test_java_lang_management_OperatingSystemMXBean_GetSystemLoadAverage.java15
-rw-r--r--lang/openjdk7/patches/patch-jdk_test_sun_security_ec_TestEC.java15
84 files changed, 2376 insertions, 28 deletions
diff --git a/lang/openjdk7/patches/patch-aa b/lang/openjdk7/patches/patch-aa
index afd68e00a07..a97c6079e79 100644
--- a/lang/openjdk7/patches/patch-aa
+++ b/lang/openjdk7/patches/patch-aa
@@ -1,4 +1,6 @@
-$NetBSD: patch-aa,v 1.8 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-aa,v 1.9 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig 2013-05-29 03:57:57.000000000 +0000
+++ hotspot/src/os/bsd/vm/os_bsd.cpp
diff --git a/lang/openjdk7/patches/patch-ab b/lang/openjdk7/patches/patch-ab
index c78c3b33b0d..81f90cafebf 100644
--- a/lang/openjdk7/patches/patch-ab
+++ b/lang/openjdk7/patches/patch-ab
@@ -1,4 +1,6 @@
-$NetBSD: patch-ab,v 1.5 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ab,v 1.6 2013/06/15 09:31:05 jperkin Exp $
+
+We use LD_LIBRARY_PATH.
--- jdk/make/common/shared/Sanity.gmk.orig 2012-08-10 17:21:34.000000000 +0000
+++ jdk/make/common/shared/Sanity.gmk
diff --git a/lang/openjdk7/patches/patch-ac b/lang/openjdk7/patches/patch-ac
index cbd0b6a2886..5efe91ae4a1 100644
--- a/lang/openjdk7/patches/patch-ac
+++ b/lang/openjdk7/patches/patch-ac
@@ -1,4 +1,6 @@
-$NetBSD: patch-ac,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ac,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+__progname support.
--- jdk/make/java/main/java/mapfile-i586.orig 2012-08-10 17:21:36.000000000 +0000
+++ jdk/make/java/main/java/mapfile-i586
diff --git a/lang/openjdk7/patches/patch-ad b/lang/openjdk7/patches/patch-ad
index 53b687c6139..7daca0a5394 100644
--- a/lang/openjdk7/patches/patch-ad
+++ b/lang/openjdk7/patches/patch-ad
@@ -1,4 +1,6 @@
-$NetBSD: patch-ad,v 1.4 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ad,v 1.5 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- corba/make/common/shared/Platform.gmk.orig 2012-08-10 16:10:07.000000000 +0000
+++ corba/make/common/shared/Platform.gmk
diff --git a/lang/openjdk7/patches/patch-ae b/lang/openjdk7/patches/patch-ae
index 66623556689..9279333af06 100644
--- a/lang/openjdk7/patches/patch-ae
+++ b/lang/openjdk7/patches/patch-ae
@@ -1,4 +1,6 @@
-$NetBSD: patch-ae,v 1.4 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ae,v 1.5 2013/06/15 09:31:05 jperkin Exp $
+
+Additional BSD support.
--- hotspot/make/bsd/makefiles/gcc.make.orig 2013-05-29 03:57:57.000000000 +0000
+++ hotspot/make/bsd/makefiles/gcc.make
diff --git a/lang/openjdk7/patches/patch-af b/lang/openjdk7/patches/patch-af
index 6e9d084ae50..adfd8f66143 100644
--- a/lang/openjdk7/patches/patch-af
+++ b/lang/openjdk7/patches/patch-af
@@ -1,4 +1,6 @@
-$NetBSD: patch-af,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-af,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+Use tools from pkgsrc.
--- jdk/make/common/shared/Defs-utils.gmk.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/common/shared/Defs-utils.gmk
diff --git a/lang/openjdk7/patches/patch-ag b/lang/openjdk7/patches/patch-ag
index 1e6ea758165..c319cbd292e 100644
--- a/lang/openjdk7/patches/patch-ag
+++ b/lang/openjdk7/patches/patch-ag
@@ -1,4 +1,6 @@
-$NetBSD: patch-ag,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ag,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+X rpath.
--- jdk/make/launchers/Makefile.launcher.orig 2012-08-10 17:21:41.000000000 +0000
+++ jdk/make/launchers/Makefile.launcher
diff --git a/lang/openjdk7/patches/patch-ah b/lang/openjdk7/patches/patch-ah
index f0e34315f52..bfd3a7a39cd 100644
--- a/lang/openjdk7/patches/patch-ah
+++ b/lang/openjdk7/patches/patch-ah
@@ -1,4 +1,6 @@
-$NetBSD: patch-ah,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ah,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- jdk/make/common/shared/Platform.gmk.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/common/shared/Platform.gmk
diff --git a/lang/openjdk7/patches/patch-ai b/lang/openjdk7/patches/patch-ai
index 7f726387782..4bceaa7e433 100644
--- a/lang/openjdk7/patches/patch-ai
+++ b/lang/openjdk7/patches/patch-ai
@@ -1,4 +1,6 @@
-$NetBSD: patch-ai,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ai,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+Support older NetBSD.
--- hotspot/src/os/bsd/vm/attachListener_bsd.cpp.orig 2012-08-10 16:24:15.000000000 +0000
+++ hotspot/src/os/bsd/vm/attachListener_bsd.cpp
diff --git a/lang/openjdk7/patches/patch-aj b/lang/openjdk7/patches/patch-aj
index 2e8b7e72e65..c511e3a1736 100644
--- a/lang/openjdk7/patches/patch-aj
+++ b/lang/openjdk7/patches/patch-aj
@@ -1,4 +1,6 @@
-$NetBSD: patch-aj,v 1.4 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-aj,v 1.5 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- jdk/src/solaris/native/java/net/NetworkInterface.c.orig 2013-05-29 03:57:58.000000000 +0000
+++ jdk/src/solaris/native/java/net/NetworkInterface.c
diff --git a/lang/openjdk7/patches/patch-ak b/lang/openjdk7/patches/patch-ak
index 0e59e9815b3..d5aab951bef 100644
--- a/lang/openjdk7/patches/patch-ak
+++ b/lang/openjdk7/patches/patch-ak
@@ -1,4 +1,6 @@
-$NetBSD: patch-ak,v 1.5 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ak,v 1.6 2013/06/15 09:31:05 jperkin Exp $
+
+Additional rpaths.
--- jdk/make/common/Defs-bsd.gmk.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/common/Defs-bsd.gmk
diff --git a/lang/openjdk7/patches/patch-al b/lang/openjdk7/patches/patch-al
index 239fe377c77..44558c8f689 100644
--- a/lang/openjdk7/patches/patch-al
+++ b/lang/openjdk7/patches/patch-al
@@ -1,4 +1,6 @@
-$NetBSD: patch-al,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-al,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java.orig 2013-06-01 14:10:31.000000000 +0000
+++ jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java
diff --git a/lang/openjdk7/patches/patch-am b/lang/openjdk7/patches/patch-am
index c0650f34c9a..a8626b667f3 100644
--- a/lang/openjdk7/patches/patch-am
+++ b/lang/openjdk7/patches/patch-am
@@ -1,4 +1,6 @@
-$NetBSD: patch-am,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-am,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+Set username to pkgsrc.
--- jdk/make/common/shared/Defs.gmk.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/common/shared/Defs.gmk
diff --git a/lang/openjdk7/patches/patch-an b/lang/openjdk7/patches/patch-an
index 771aff7280c..967f9f02e60 100644
--- a/lang/openjdk7/patches/patch-an
+++ b/lang/openjdk7/patches/patch-an
@@ -1,4 +1,6 @@
-$NetBSD: patch-an,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-an,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+NetBSD fix.
--- hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp.orig 2012-08-10 16:24:31.000000000 +0000
+++ hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp
diff --git a/lang/openjdk7/patches/patch-ao b/lang/openjdk7/patches/patch-ao
index c04e99ba3c3..85679e0f284 100644
--- a/lang/openjdk7/patches/patch-ao
+++ b/lang/openjdk7/patches/patch-ao
@@ -1,4 +1,6 @@
-$NetBSD: patch-ao,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ao,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+Support rhino.
--- jdk/make/common/Release.gmk.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/common/Release.gmk
diff --git a/lang/openjdk7/patches/patch-ap b/lang/openjdk7/patches/patch-ap
index f2836da1fa8..9507de022eb 100644
--- a/lang/openjdk7/patches/patch-ap
+++ b/lang/openjdk7/patches/patch-ap
@@ -1,4 +1,6 @@
-$NetBSD: patch-ap,v 1.4 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ap,v 1.5 2013/06/15 09:31:05 jperkin Exp $
+
+Use pkgsrc fontconfig.
--- jdk/src/solaris/native/sun/awt/fontpath.c.orig 2013-05-29 03:57:58.000000000 +0000
+++ jdk/src/solaris/native/sun/awt/fontpath.c
diff --git a/lang/openjdk7/patches/patch-aq b/lang/openjdk7/patches/patch-aq
index 695abb520f4..90452511112 100644
--- a/lang/openjdk7/patches/patch-aq
+++ b/lang/openjdk7/patches/patch-aq
@@ -1,4 +1,6 @@
-$NetBSD: patch-aq,v 1.5 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-aq,v 1.6 2013/06/15 09:31:05 jperkin Exp $
+
+Support __progname.
--- jdk/make/java/main/java/mapfile-amd64.orig 2012-08-10 17:21:36.000000000 +0000
+++ jdk/make/java/main/java/mapfile-amd64
diff --git a/lang/openjdk7/patches/patch-ar b/lang/openjdk7/patches/patch-ar
index b27295fdf30..5b831b7c8c5 100644
--- a/lang/openjdk7/patches/patch-ar
+++ b/lang/openjdk7/patches/patch-ar
@@ -1,4 +1,6 @@
-$NetBSD: patch-ar,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ar,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+freetype rpath.
--- jdk/make/sun/font/Makefile.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/sun/font/Makefile
diff --git a/lang/openjdk7/patches/patch-ba b/lang/openjdk7/patches/patch-ba
index 26c7d927d60..d211aacd963 100644
--- a/lang/openjdk7/patches/patch-ba
+++ b/lang/openjdk7/patches/patch-ba
@@ -1,4 +1,6 @@
-$NetBSD: patch-ba,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-ba,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- hotspot/src/share/vm/utilities/macros.hpp.orig 2012-08-10 16:28:55.000000000 +0000
+++ hotspot/src/share/vm/utilities/macros.hpp
diff --git a/lang/openjdk7/patches/patch-bd b/lang/openjdk7/patches/patch-bd
index 1e0e1c18aa6..fb63c6c686a 100644
--- a/lang/openjdk7/patches/patch-bd
+++ b/lang/openjdk7/patches/patch-bd
@@ -1,4 +1,6 @@
-$NetBSD: patch-bd,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bd,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+Support __progname and environ.
--- jdk/make/com/sun/java/pack/mapfile-vers.orig 2012-08-10 17:21:30.000000000 +0000
+++ jdk/make/com/sun/java/pack/mapfile-vers
diff --git a/lang/openjdk7/patches/patch-bg b/lang/openjdk7/patches/patch-bg
index 9119cb00b4d..cf03ffe023c 100644
--- a/lang/openjdk7/patches/patch-bg
+++ b/lang/openjdk7/patches/patch-bg
@@ -1,4 +1,6 @@
-$NetBSD: patch-bg,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bg,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c.orig 2013-05-29 03:57:58.000000000 +0000
+++ jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
diff --git a/lang/openjdk7/patches/patch-bh b/lang/openjdk7/patches/patch-bh
index 9105bebfbc8..2591b6ff8db 100644
--- a/lang/openjdk7/patches/patch-bh
+++ b/lang/openjdk7/patches/patch-bh
@@ -1,4 +1,6 @@
-$NetBSD: patch-bh,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bh,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- hotspot/make/defs.make.orig 2012-08-10 16:23:01.000000000 +0000
+++ hotspot/make/defs.make
diff --git a/lang/openjdk7/patches/patch-bi b/lang/openjdk7/patches/patch-bi
index e874eca0b23..114328ea931 100644
--- a/lang/openjdk7/patches/patch-bi
+++ b/lang/openjdk7/patches/patch-bi
@@ -1,4 +1,6 @@
-$NetBSD: patch-bi,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bi,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp.orig 2012-08-10 16:24:31.000000000 +0000
+++ hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
diff --git a/lang/openjdk7/patches/patch-bj b/lang/openjdk7/patches/patch-bj
index 953530c7fa9..eddf9120c6e 100644
--- a/lang/openjdk7/patches/patch-bj
+++ b/lang/openjdk7/patches/patch-bj
@@ -1,4 +1,6 @@
-$NetBSD: patch-bj,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bj,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp.orig 2012-08-10 16:28:55.000000000 +0000
+++ hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
diff --git a/lang/openjdk7/patches/patch-bk b/lang/openjdk7/patches/patch-bk
index 434b2214026..4f1566c2a75 100644
--- a/lang/openjdk7/patches/patch-bk
+++ b/lang/openjdk7/patches/patch-bk
@@ -1,4 +1,6 @@
-$NetBSD: patch-bk,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bk,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- jdk/make/java/npt/Makefile.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/java/npt/Makefile
diff --git a/lang/openjdk7/patches/patch-bl b/lang/openjdk7/patches/patch-bl
index efeb5d079f8..edbdfd3bf5b 100644
--- a/lang/openjdk7/patches/patch-bl
+++ b/lang/openjdk7/patches/patch-bl
@@ -1,4 +1,6 @@
-$NetBSD: patch-bl,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bl,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+DragonFly support.
--- jdk/make/java/instrument/Makefile.orig 2013-05-29 03:57:57.000000000 +0000
+++ jdk/make/java/instrument/Makefile
diff --git a/lang/openjdk7/patches/patch-bn b/lang/openjdk7/patches/patch-bn
index f6fb46ac6d2..b011ee6323b 100644
--- a/lang/openjdk7/patches/patch-bn
+++ b/lang/openjdk7/patches/patch-bn
@@ -1,4 +1,6 @@
-$NetBSD: patch-bn,v 1.3 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-bn,v 1.4 2013/06/15 09:31:05 jperkin Exp $
+
+Use pkgsrc fonts.
--- jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties.orig 2012-08-10 17:31:20.000000000 +0000
+++ jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties
diff --git a/lang/openjdk7/patches/patch-corba_make_common_shared_Defs-utils.gmk b/lang/openjdk7/patches/patch-corba_make_common_shared_Defs-utils.gmk
new file mode 100644
index 00000000000..bd63421cacc
--- /dev/null
+++ b/lang/openjdk7/patches/patch-corba_make_common_shared_Defs-utils.gmk
@@ -0,0 +1,15 @@
+$NetBSD: patch-corba_make_common_shared_Defs-utils.gmk,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+Use pkgsrc unzip.
+
+--- corba/make/common/shared/Defs-utils.gmk.orig 2013-02-20 04:35:29.000000000 +0000
++++ corba/make/common/shared/Defs-utils.gmk
+@@ -136,7 +136,7 @@ TR = $(UTILS_USR_BIN_PATH)tr
+ TRUE = $(UTILS_COMMAND_PATH)true
+ UNAME = $(UTILS_COMMAND_PATH)uname
+ UNIQ = $(UTILS_USR_BIN_PATH)uniq
+-UNZIP = $(UTILS_USR_BIN_PATH)unzip
++UNZIP = $(UTILS_DEVTOOL_PATH)unzip
+ UNZIPSFX = $(UTILS_DEVTOOL_PATH)unzipsfx
+ WC = $(UTILS_USR_BIN_PATH)wc
+ WHICH = $(UTILS_USR_BIN_PATH)which
diff --git a/lang/openjdk7/patches/patch-corba_make_common_shared_Platform.gmk b/lang/openjdk7/patches/patch-corba_make_common_shared_Platform.gmk
new file mode 100644
index 00000000000..6a731916d42
--- /dev/null
+++ b/lang/openjdk7/patches/patch-corba_make_common_shared_Platform.gmk
@@ -0,0 +1,15 @@
+$NetBSD: patch-corba_make_common_shared_Platform.gmk,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+Avoid warnings when building in a zone.
+
+--- corba/make/common/shared/Platform.gmk.orig 2013-02-20 04:35:29.000000000 +0000
++++ corba/make/common/shared/Platform.gmk
+@@ -143,7 +143,7 @@ ifeq ($(SYSTEM_UNAME), SunOS)
+ REQUIRED_FREE_SPACE=1040000
+ endif
+ # How much RAM does this machine have:
+- MB_OF_MEMORY=$(shell /etc/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
++ MB_OF_MEMORY=$(shell /usr/sbin/prtconf 2>&1 | fgrep 'Memory size:' | expand | cut -d' ' -f3)
+ endif
+
+ # Platform settings specific to Linux
diff --git a/lang/openjdk7/patches/patch-hotspot_make_bsd_makefiles_defs.make b/lang/openjdk7/patches/patch-hotspot_make_bsd_makefiles_defs.make
index 04d076524c2..2458389f236 100644
--- a/lang/openjdk7/patches/patch-hotspot_make_bsd_makefiles_defs.make
+++ b/lang/openjdk7/patches/patch-hotspot_make_bsd_makefiles_defs.make
@@ -1,4 +1,6 @@
-$NetBSD: patch-hotspot_make_bsd_makefiles_defs.make,v 1.2 2013/06/02 06:12:28 ryoon Exp $
+$NetBSD: patch-hotspot_make_bsd_makefiles_defs.make,v 1.3 2013/06/15 09:31:05 jperkin Exp $
+
+64-bit support.
--- hotspot/make/bsd/makefiles/defs.make.orig 2013-05-29 03:57:57.000000000 +0000
+++ hotspot/make/bsd/makefiles/defs.make
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_adlc.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_adlc.make
new file mode 100644
index 00000000000..55338811c66
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_adlc.make
@@ -0,0 +1,18 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_adlc.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/adlc.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/adlc.make
+@@ -75,9 +75,11 @@ endif
+
+ # CFLAGS_WARN holds compiler options to suppress/enable warnings.
+ # Compiler warnings are treated as errors
++ifeq ("${Platform_compiler}", "sparcWorks")
+ ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+ CFLAGS_WARN = +w -errwarn
+ endif
++endif
+ CFLAGS += $(CFLAGS_WARN)
+
+ ifeq ("${Platform_compiler}", "sparcWorks")
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_build__vm__def.sh b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_build__vm__def.sh
new file mode 100644
index 00000000000..d0cfe527299
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_build__vm__def.sh
@@ -0,0 +1,14 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_build__vm__def.sh,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+Fix path to nm.
+
+--- hotspot/make/solaris/makefiles/build_vm_def.sh.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/build_vm_def.sh
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+
+-/usr/ccs/bin/nm -p $* \
++/usr/bin/nm -p $* \
+ | awk '{
+ if ($2 == "U") next
+ if ($3 ~ /^__1c.*__vtbl_$/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";"
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_debug.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_debug.make
new file mode 100644
index 00000000000..7309b89576e
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_debug.make
@@ -0,0 +1,19 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_debug.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/debug.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/debug.make
+@@ -45,7 +45,11 @@ MAPFILE = $(GAMMADIR)/make/solaris/makef
+
+ # This mapfile is only needed when compiling with dtrace support,
+ # and mustn't be otherwise.
+-MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++ifdef USE_GCC
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE).gcc
++else
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++endif # USE_GCC
+
+ _JUNK_ := $(shell echo >&2 ""\
+ "-------------------------------------------------------------------------\n" \
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_dtrace.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_dtrace.make
new file mode 100644
index 00000000000..4314aaaaab6
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_dtrace.make
@@ -0,0 +1,56 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_dtrace.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+Enable DTrace support with GCC.
+
+--- hotspot/make/solaris/makefiles/dtrace.make.orig 2012-08-10 16:23:13.000000000 +0000
++++ hotspot/make/solaris/makefiles/dtrace.make
+@@ -30,13 +30,6 @@
+ ifneq ("${TYPE}", "CORE")
+ ifneq ("${TYPE}", "KERNEL")
+
+-ifdef USE_GCC
+-
+-dtraceCheck:
+- $(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
+-
+-else
+-
+ JVM_DB = libjvm_db
+ LIBJVM_DB = libjvm_db.so
+ LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so
+@@ -63,14 +56,23 @@ DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Pla
+ DTRACE = dtrace
+ DTRACE.o = $(DTRACE).o
+
+-# to remove '-g' option which causes link problems
+-# also '-z nodefs' is used as workaround
+-GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
++ifdef USE_GCC
++ # solaris linker does not like gcc and -fvisibility=hidden without mapfiles
++ GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g' -e 's/ -fvisibility=hidden / /g';)
++else
++ # to remove '-g' option which causes link problems
++ # also '-z nodefs' is used as workaround
++ GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
++endif
+
+ ifdef LP64
+ DTRACE_OPTS = -64 -D_LP64
+ endif
+
++ifdef USE_GCC
++ DTRACE_OPTS = -D_GNU_SOURCE
++endif # USE_GCC
++
+ # making libjvm_db
+
+ # Use mapfile with libjvm_db.so
+@@ -384,8 +386,6 @@ dtraceCheck:
+
+ endif # ifneq ("${dtraceFound}", "")
+
+-endif # ifdef USE_GCC
+-
+ else # KERNEL build
+
+ dtraceCheck:
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_fastdebug.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_fastdebug.make
new file mode 100644
index 00000000000..b9a45c75328
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_fastdebug.make
@@ -0,0 +1,19 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_fastdebug.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/fastdebug.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/fastdebug.make
+@@ -116,7 +116,11 @@ MAPFILE = $(GAMMADIR)/make/solaris/makef
+
+ # This mapfile is only needed when compiling with dtrace support,
+ # and mustn't be otherwise.
+-MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++ifdef USE_GCC
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE).gcc
++else
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++endif # USE_GCC
+
+ G_SUFFIX = _g
+ VERSION = optimized
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_gcc.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_gcc.make
new file mode 100644
index 00000000000..3e2a42418f7
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_gcc.make
@@ -0,0 +1,120 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_gcc.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/gcc.make.orig 2012-08-10 16:23:14.000000000 +0000
++++ hotspot/make/solaris/makefiles/gcc.make
+@@ -66,11 +66,23 @@ VM_PICFLAG/LIBJVM = $(PICFLAG)
+ VM_PICFLAG/AOUT =
+ VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
+
++ifeq ($(JVM_VARIANT_ZERO), true)
++ CFLAGS += $(LIBFFI_CFLAGS)
++endif
++ifeq ($(JVM_VARIANT_ZEROSHARK), true)
++ CFLAGS += $(LIBFFI_CFLAGS)
++ CFLAGS += $(LLVM_CFLAGS)
++endif
+ CFLAGS += $(VM_PICFLAG)
+ CFLAGS += -fno-rtti
+ CFLAGS += -fno-exceptions
+ CFLAGS += -D_REENTRANT
+ CFLAGS += -fcheck-new
++# version 4 and above support fvisibility=hidden (matches jni_x86.h file)
++# except 4.1.2 gives pointless warnings that can't be disabled (afaik)
++ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
++ CFLAGS += -fvisibility=hidden
++endif
+
+ ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
+
+@@ -103,6 +115,11 @@ ifdef CC_INTERP
+ CFLAGS += -DCC_INTERP
+ endif
+
++# Build for embedded targets
++ifdef JAVASE_EMBEDDED
++ CFLAGS += -DJAVASE_EMBEDDED
++endif
++
+ # Keep temporary files (.ii, .s)
+ ifdef NEED_ASM
+ CFLAGS += -save-temps
+@@ -113,9 +130,18 @@ endif
+
+ # Compiler warnings are treated as errors
+ WARNINGS_ARE_ERRORS = -Werror
+-# Enable these warnings. See 'info gcc' about details on these options
+-ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
+-CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS)
++
++# Except for a few acceptable ones
++# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
++# conversions which might affect the values. To avoid that, we need to turn
++# it off explicitly.
++ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
++ ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
++else
++ ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
++endif
++
++CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
+ # Special cases
+ CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
+
+@@ -173,7 +199,7 @@ MAPFLAG = -Xlinker -M -Xlinker FILENAME
+ endif
+
+ # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
+-SONAMEFLAG = -Xlinker -soname=SONAME
++SONAMEFLAG = -Wl,-soname=SONAME
+
+ # Build shared library
+ SHARED_FLAG = -shared
+@@ -181,17 +207,34 @@ SHARED_FLAG = -shared
+ #------------------------------------------------------------------------
+ # Debug flags
+
+-# Use the stabs format for debugging information (this is the default
+-# on gcc-2.91). It's good enough, has all the information about line
+-# numbers and local variables, and libjvm_g.so is only about 16M.
+-# Change this back to "-g" if you want the most expressive format.
+-# (warning: that could easily inflate libjvm_g.so to 150M!)
+-# Note: The Itanium gcc compiler crashes when using -gstabs.
+-DEBUG_CFLAGS/ia64 = -g
+-DEBUG_CFLAGS/amd64 = -g
+-DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
+-ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
+-DEBUG_CFLAGS += -gstabs
+-endif
++# DEBUG_BINARIES uses full -g debug information for all configs
++ifeq ($(DEBUG_BINARIES), true)
++ CFLAGS += -g
++else
++# Use the stabs format for debugging information (this is the default
++# on gcc-2.91). It's good enough, has all the information about line
++# numbers and local variables, and libjvm_g.so is only about 16M.
++# Change this back to "-g" if you want the most expressive format.
++# (warning: that could easily inflate libjvm_g.so to 150M!)
++# Note: The Itanium gcc compiler crashes when using -gstabs.
++DEBUG_CFLAGS/ia64 = -g
++DEBUG_CFLAGS/amd64 = -g
++DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
++ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
++DEBUG_CFLAGS += -gstabs
++endif
++endif
++
++# If we are building HEADLESS, pass on to VM
++# so it can set the java.awt.headless property
++ifdef HEADLESS
++ CFLAGS += -DHEADLESS
++endif
++
++# We are building Embedded for a small device
++# favor code space over speed
++ifdef MINIMIZE_RAM_USAGE
++ CFLAGS += -DMINIMIZE_RAM_USAGE
++endif
+
+ MCS = /usr/ccs/bin/mcs
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jsig.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jsig.make
new file mode 100644
index 00000000000..44baa264dfe
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jsig.make
@@ -0,0 +1,34 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_jsig.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/jsig.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/jsig.make
+@@ -47,15 +47,25 @@ LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfi
+ LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE))
+
+ ifdef USE_GCC
+-LFLAGS_JSIG += -D_REENTRANT
++ LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT
+ else
+-LFLAGS_JSIG += -mt -xnolib
++ LFLAGS_JSIG += -mt -xnolib
++endif
++
++# DEBUG_BINARIES overrides everything, use full -g debug information
++ifeq ($(DEBUG_BINARIES), true)
++ JSIG_DEBUG_CFLAGS = -g
+ endif
+
+ $(LIBJSIG): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
+ @echo Making signal interposition lib...
++ifdef USE_GCC
++ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
++ $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $(JSIGSRCDIR)/jsig.c -ldl
++else
+ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
+ $(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl
++endif
+ [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jvmg.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jvmg.make
new file mode 100644
index 00000000000..cc946f13be1
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_jvmg.make
@@ -0,0 +1,19 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_jvmg.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/jvmg.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/jvmg.make
+@@ -49,7 +49,11 @@ MAPFILE = $(GAMMADIR)/make/solaris/makef
+
+ # This mapfile is only needed when compiling with dtrace support,
+ # and mustn't be otherwise.
+-MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++ifdef USE_GCC
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE).gcc
++else
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++endif # USE_GCC
+
+ G_SUFFIX = _g
+ VERSION = debug
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER1.gcc b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER1.gcc
new file mode 100644
index 00000000000..54b5a139e72
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER1.gcc
@@ -0,0 +1,50 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER1.gcc,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/mapfile-vers-COMPILER1.gcc.orig 2013-03-10 22:22:12.895432470 +0000
++++ hotspot/make/solaris/makefiles/mapfile-vers-COMPILER1.gcc
+@@ -0,0 +1,43 @@
++#
++
++#
++# Copyright (c) 2003, 2008, 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.
++#
++# 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.
++#
++#
++
++# Define public interface.
++
++SUNWprivate_1.1 {
++ global:
++ # Dtrace support
++ _ZN8Universe15_methodKlassObjE;
++ _ZN9CodeCache5_heapE;
++ _ZN8Universe14_collectedHeapE;
++ _ZTV7nmethod;
++ _ZTV8CodeBlob;
++ _ZTV10BufferBlob;
++ _ZTV11RuntimeStub;
++ _ZTV13SafepointBlob;
++ _ZTV18DeoptimizationBlob;
++
++ __JvmOffsets;
++};
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER2.gcc b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER2.gcc
new file mode 100644
index 00000000000..10a4d47dd4a
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER2.gcc
@@ -0,0 +1,53 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_mapfile-vers-COMPILER2.gcc,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/mapfile-vers-COMPILER2.gcc.orig 2013-03-10 22:22:12.896595236 +0000
++++ hotspot/make/solaris/makefiles/mapfile-vers-COMPILER2.gcc
+@@ -0,0 +1,46 @@
++#
++
++#
++# Copyright (c) 2003, 2008, 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.
++#
++# 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.
++#
++#
++
++# Define public interface.
++
++SUNWprivate_1.1 {
++ global:
++ # Dtrace support
++ _ZN8Universe15_methodKlassObjE;
++ _ZN9CodeCache5_heapE;
++ _ZN8Universe14_collectedHeapE;
++ _ZTV7nmethod;
++ _ZTV8CodeBlob;
++ _ZTV10BufferBlob;
++ _ZTV11RuntimeStub;
++ _ZTV13SafepointBlob;
++ _ZTV18DeoptimizationBlob;
++
++ _ZTV13ExceptionBlob;
++ _ZTV16UncommonTrapBlob;
++
++ __JvmOffsets;
++};
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-TIERED.gcc b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-TIERED.gcc
new file mode 100644
index 00000000000..f840ef0847a
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_mapfile-vers-TIERED.gcc
@@ -0,0 +1,52 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_mapfile-vers-TIERED.gcc,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/mapfile-vers-TIERED.gcc.orig 2013-03-10 22:22:12.897768214 +0000
++++ hotspot/make/solaris/makefiles/mapfile-vers-TIERED.gcc
+@@ -0,0 +1,45 @@
++#
++
++#
++# Copyright (c) 2006, 2008, 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.
++#
++# 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.
++#
++#
++
++# Define public interface.
++
++SUNWprivate_1.1 {
++ global:
++ # Dtrace support
++ _ZN8Universe15_methodKlassObjE;
++ _ZN9CodeCache5_heapE;
++ _ZN8Universe14_collectedHeapE;
++ _ZTV7nmethod;
++ _ZTV8CodeBlob;
++ _ZTV10BufferBlob;
++ _ZTV11RuntimeStub;
++ _ZTV13SafepointBlob;
++ _ZTV18DeoptimizationBlob;
++ _ZTV13ExceptionBlob;
++ _ZTV16UncommonTrapBlob;
++
++ __JvmOffsets;
++};
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_optimized.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_optimized.make
new file mode 100644
index 00000000000..6f702aac9b1
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_optimized.make
@@ -0,0 +1,19 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_optimized.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/optimized.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/optimized.make
+@@ -57,7 +57,11 @@ MAPFILE = $(GAMMADIR)/make/solaris/makef
+
+ # This mapfile is only needed when compiling with dtrace support,
+ # and mustn't be otherwise.
+-MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++ifdef USE_GCC
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE).gcc
++else
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++endif # USE_GCC
+
+ # Set the environment variable HOTSPARC_GENERIC to "true"
+ # to inhibit the effect of the previous line on CFLAGS.
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_product.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_product.make
new file mode 100644
index 00000000000..bb56402e5c4
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_product.make
@@ -0,0 +1,25 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_product.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/product.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/product.make
+@@ -65,11 +65,16 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAG
+ # Linker mapfiles
+ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers
+
+-ifndef USE_GCC
+ # This mapfile is only needed when compiling with dtrace support,
+ # and mustn't be otherwise.
+-MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++ifdef USE_GCC
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE).gcc
++else
++ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
++endif # USE_GCC
+
++# reorder is not used with gcc
++ifndef USE_GCC
+ REORDERFILE = $(GAMMADIR)/make/solaris/makefiles/reorder_$(TYPE)_$(BUILDARCH)
+ endif
+
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_saproc.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_saproc.make
new file mode 100644
index 00000000000..eed134319a4
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_saproc.make
@@ -0,0 +1,23 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_saproc.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+Only use libdemangle for Sun Studio builds.
+
+--- hotspot/make/solaris/makefiles/saproc.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/saproc.make
+@@ -61,6 +61,7 @@ ifdef USE_GCC
+ SA_LFLAGS += -D_REENTRANT
+ else
+ SA_LFLAGS += -mt -xnolib -norunpath
++LIBDEMANGLE = -ldemangle
+ endif
+
+ # The libproc Pstack_iter() interface changed in Nevada-B159.
+@@ -106,7 +107,7 @@ $(LIBSAPROC): $(ADD_GNU_DEBUGLINK) $(FIX
+ $(SASRCFILES) \
+ $(SA_LFLAGS) \
+ -o $@ \
+- -ldl -ldemangle -lthread -lc
++ -ldl ${LIBDEMANGLE} -lthread -lc
+ [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
diff --git a/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_vm.make b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_vm.make
new file mode 100644
index 00000000000..20d8df03b3c
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_make_solaris_makefiles_vm.make
@@ -0,0 +1,50 @@
+$NetBSD: patch-hotspot_make_solaris_makefiles_vm.make,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/make/solaris/makefiles/vm.make.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/make/solaris/makefiles/vm.make
+@@ -59,7 +59,11 @@ INCLUDES += $(Src_Dirs_I:%=-I%)
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ # always build with debug info when we can create .debuginfo files
+ # and disable 'lazy debug info' so the .so has everything.
+- SYMFLAG = -g -xs
++ ifdef USE_GCC
++ SYMFLAG = -g
++ else
++ SYMFLAG = -g -xs
++ endif
+ else
+ ifeq (${VERSION}, debug)
+ SYMFLAG = -g
+@@ -132,7 +136,7 @@ LIBS += -ldl -lthread -lsocket $(LIBM) -
+ endif # 502
+ endif # 505
+ else
+-LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle
++LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
+ endif # sparcWorks
+
+ ifeq ("${Platform_arch}", "sparc")
+@@ -268,16 +272,19 @@ ifeq ($(LINK_INTO),AOUT)
+ LIBS_VM = $(LIBS)
+ else
+ LIBJVM.o = $(JVM_OBJ_FILES)
+- LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
+- LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
+ LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
+ ifndef USE_GCC
+ LIBS_VM = $(LIBS)
++ LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
++ LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
+ else
+ # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
+ # get around library dependency and compatibility issues. Must use gcc not
+ # g++ to link.
+ LFLAGS_VM += $(STATIC_LIBGCC)
++ ifeq ($(BUILDARCH),i486)
++ LFLAGS_VM += -mimpure-text
++ endif
+ LIBS_VM += $(STATIC_STDCXX) $(LIBS)
+ endif
+ endif
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_atomic__solaris__x86.inline.hpp b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_atomic__solaris__x86.inline.hpp
new file mode 100644
index 00000000000..0d0189083aa
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_atomic__solaris__x86.inline.hpp
@@ -0,0 +1,92 @@
+$NetBSD: patch-hotspot_src_os__cpu_solaris__x86_vm_atomic__solaris__x86.inline.hpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
+@@ -59,6 +59,8 @@ inline void Atomic::dec_ptr(volatile voi
+ // facilitate this, os::is_MP() is passed as an additional argument. 64-bit
+ // processors are assumed to be multi-threaded and/or multi-core, so the extra
+ // argument is unnecessary.
++// This needs cleaning up - gcc always requires is_mp due to laziness of porter.
++#ifndef _GNU_SOURCE
+ #ifndef _LP64
+ #define IS_MP_DECL() , int is_mp
+ #define IS_MP_ARG() , (int) os::is_MP()
+@@ -66,6 +68,11 @@ inline void Atomic::dec_ptr(volatile voi
+ #define IS_MP_DECL()
+ #define IS_MP_ARG()
+ #endif // _LP64
++#else
++#define IS_MP_DECL() , int is_mp
++#define IS_MP_ARG() , (int) os::is_MP()
++#endif // _GNU_SOURCE
++
+
+ extern "C" {
+ jint _Atomic_add(jint add_value, volatile jint* dest IS_MP_DECL());
+@@ -96,15 +103,27 @@ inline jlong Atomic::cmpxchg (jlon
+ #ifdef AMD64
+ inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
+ inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
++#ifndef _GNU_SOURCE
+ extern "C" jlong _Atomic_add_long(jlong add_value, volatile jlong* dest);
++#else
++extern "C" jlong _Atomic_add_long(jlong add_value, volatile jlong* dest IS_MP_DECL());
++#endif // _GNU_SOURCE
+ extern "C" jlong _Atomic_xchg_long(jlong exchange_value, volatile jlong* dest);
+
+ inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
++#ifndef _GNU_SOURCE
+ return (intptr_t)_Atomic_add_long((jlong)add_value, (volatile jlong*)dest);
++#else
++ return (intptr_t)_Atomic_add_long((jlong)add_value, (volatile jlong*)dest IS_MP_ARG());
++#endif // _GNU_SOURCE
+ }
+
+ inline void* Atomic::add_ptr(intptr_t add_value, volatile void* dest) {
++#ifndef _GNU_SOURCE
+ return (void*)_Atomic_add_long((jlong)add_value, (volatile jlong*)dest);
++#else
++ return (void*)_Atomic_add_long((jlong)add_value, (volatile jlong*)dest IS_MP_ARG());
++#endif // _GNU_SOURCE
+ }
+
+ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest) {
+@@ -116,11 +135,19 @@ inline void* Atomic::xchg_ptr(void*
+ }
+
+ inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value) {
++#ifndef _GNU_SOURCE
+ return (intptr_t)_Atomic_cmpxchg_long((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value);
++#else
++ return (intptr_t)_Atomic_cmpxchg_long((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value IS_MP_ARG());
++#endif // _GNU_SOURCE
+ }
+
+ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) {
++#ifndef _GNU_SOURCE
+ return (void*)_Atomic_cmpxchg_long((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value);
++#else
++ return (void*)_Atomic_cmpxchg_long((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value IS_MP_ARG());
++#endif // _GNU_SOURCE
+ }
+
+ inline jlong Atomic::load(volatile jlong* src) { return *src; }
+@@ -257,6 +284,16 @@ extern "C" {
+ #endif // if 0
+ #endif // AMD64
+ }
++
++ inline void _Atomic_move_long(volatile jlong* src, volatile jlong* dst) {
++ __asm__ volatile (
++ "fildll (%0)" "\n\t"
++ "fistpll (%1)"
++ :
++ :"r" (src), "r" (dst)
++ :"memory");
++ }
++
+ }
+ #undef LOCK_IF_MP
+
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_orderAccess__solaris__x86.inline.hpp b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_orderAccess__solaris__x86.inline.hpp
new file mode 100644
index 00000000000..4315d165abd
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_orderAccess__solaris__x86.inline.hpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-hotspot_src_os__cpu_solaris__x86_vm_orderAccess__solaris__x86.inline.hpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
+@@ -71,7 +71,11 @@ extern "C" {
+ }
+ inline void _OrderAccess_fence() {
+ // Always use locked addl since mfence is sometimes expensive
++#ifdef AMD64
++ __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
++#else
+ __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
++#endif // AMD64
+ }
+
+ }
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_os__solaris__x86.cpp b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_os__solaris__x86.cpp
new file mode 100644
index 00000000000..2688a5508bd
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_os__solaris__x86.cpp
@@ -0,0 +1,41 @@
+$NetBSD: patch-hotspot_src_os__cpu_solaris__x86_vm_os__solaris__x86.cpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp.orig 2012-08-10 16:24:45.000000000 +0000
++++ hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
+@@ -237,7 +237,22 @@ frame os::get_sender_for_C_frame(frame*
+ return frame(fr->sender_sp(), fr->link(), fr->sender_pc());
+ }
+
++#ifdef AMD64
++#define SPELL_REG_FP "rbp"
++#else
++#define SPELL_REG_FP "ebp"
++#endif
++
++#ifdef SPARC_WORKS
+ extern "C" intptr_t *_get_current_fp(); // in .il file
++#else
++#ifdef _GNU_SOURCE
++extern "C" intptr_t *_get_current_fp() {
++ register intptr_t **rbp __asm__ (SPELL_REG_FP);
++ return (intptr_t*) *rbp; // we want what it points to.
++}
++#endif // _GNU_SOURCE
++#endif // SPARC_WORKS
+
+ frame os::current_frame() {
+ intptr_t* fp = _get_current_fp(); // it's inlined so want current fp
+@@ -951,6 +966,11 @@ add_func_t* os::atomic_add_func
+ extern "C" void _solaris_raw_setup_fpu(address ptr);
+ void os::setup_fpu() {
+ address fpu_cntrl = StubRoutines::addr_fpu_cntrl_wrd_std();
++#ifndef _GNU_SOURCE
+ _solaris_raw_setup_fpu(fpu_cntrl);
++#else
++ // same as hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp : os::setup_fpu()
++ __asm__ volatile("fldcw (%0)"::"r"(fpu_cntrl):"memory");
++#endif
+ }
+ #endif // AMD64
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_prefetch__solaris__x86.inline.hpp b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_prefetch__solaris__x86.inline.hpp
new file mode 100644
index 00000000000..93c53a0e6aa
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_prefetch__solaris__x86.inline.hpp
@@ -0,0 +1,35 @@
+$NetBSD: patch-hotspot_src_os__cpu_solaris__x86_vm_prefetch__solaris__x86.inline.hpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC compatability.
+
+--- hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp
+@@ -34,14 +34,28 @@ extern "C" {
+
+ inline void Prefetch::read (void *loc, intx interval) {
+ #ifdef AMD64
++#ifdef SPARC_WORKS
+ _Prefetch_read(loc, interval);
++#else
++#ifdef _GNU_SOURCE
++ __asm__ ("prefetcht0 (%0,%1,1)" : : "r" (loc), "r" (interval));
++#endif // _GNU_SOURCE
++#endif // SPARC_WORKS
+ #endif // AMD64
+ }
+
+ // Use of this method should be gated by VM_Version::has_prefetchw.
+ inline void Prefetch::write(void *loc, intx interval) {
+ #ifdef AMD64
++#ifdef SPARC_WORKS
+ _Prefetch_write(loc, interval);
++#else
++#ifdef _GNU_SOURCE
++ // Do not use the 3dnow prefetchw instruction. It isn't supported on em64t.
++ // __asm__ ("prefetchw (%0,%1,1)" : : "r" (loc), "r" (interval));
++ __asm__ ("prefetcht0 (%0,%1,1)" : : "r" (loc), "r" (interval));
++#endif // _GNU_SOURCE
++#endif // SPARC_WORKS
+ #endif // AMD64
+ }
+
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_threadLS__solaris__x86.hpp b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_threadLS__solaris__x86.hpp
new file mode 100644
index 00000000000..e8b234db5fc
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os__cpu_solaris__x86_vm_threadLS__solaris__x86.hpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-hotspot_src_os__cpu_solaris__x86_vm_threadLS__solaris__x86.hpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC support.
+
+--- hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp
+@@ -65,7 +65,10 @@ public:
+ __asm__ __volatile__ ("movq %%fs:0, %0" : "=r"(rv));
+ return rv;
+ #else
+- return gs_thread();
++ uintptr_t rv;
++ __asm__ __volatile__ ("movl %%gs:0, %0" : "=r"(rv));
++ return rv;
++// return gs_thread();
+ #endif // AMD64
+ #else //_GNU_SOURCE
+ return _raw_thread_id();
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os_posix_vm_os__posix.cpp b/lang/openjdk7/patches/patch-hotspot_src_os_posix_vm_os__posix.cpp
new file mode 100644
index 00000000000..7c3cbb460ae
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os_posix_vm_os__posix.cpp
@@ -0,0 +1,39 @@
+$NetBSD: patch-hotspot_src_os_posix_vm_os__posix.cpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+rlim_t fixes.
+
+--- hotspot/src/os/posix/vm/os_posix.cpp.orig 2013-06-11 09:37:03.648327363 +0000
++++ hotspot/src/os/posix/vm/os_posix.cpp
+@@ -130,12 +130,12 @@ void os::Posix::print_rlimit_info(output
+
+ st->print(" STACK ");
+ getrlimit(RLIMIT_STACK, &rlim);
+- if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
++ if (rlim.rlim_cur == (rlim_t)RLIM_INFINITY) st->print("infinity");
+ else st->print("%uk", rlim.rlim_cur >> 10);
+
+ st->print(", CORE ");
+ getrlimit(RLIMIT_CORE, &rlim);
+- if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
++ if (rlim.rlim_cur == (rlim_t)RLIM_INFINITY) st->print("infinity");
+ else st->print("%uk", rlim.rlim_cur >> 10);
+
+ //Isn't there on solaris
+@@ -148,7 +148,7 @@ void os::Posix::print_rlimit_info(output
+
+ st->print(", NOFILE ");
+ getrlimit(RLIMIT_NOFILE, &rlim);
+- if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
++ if (rlim.rlim_cur == (rlim_t)RLIM_INFINITY) st->print("infinity");
+ else st->print("%d", rlim.rlim_cur);
+
+ #ifdef __OpenBSD__
+@@ -160,7 +160,7 @@ void os::Posix::print_rlimit_info(output
+ #else
+ st->print(", AS ");
+ getrlimit(RLIMIT_AS, &rlim);
+- if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
++ if (rlim.rlim_cur == (rlim_t)RLIM_INFINITY) st->print("infinity");
+ else st->print("%uk", rlim.rlim_cur >> 10);
+ st->cr();
+ #endif
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os_solaris_dtrace_jhelper.d b/lang/openjdk7/patches/patch-hotspot_src_os_solaris_dtrace_jhelper.d
new file mode 100644
index 00000000000..da9ab0404e4
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os_solaris_dtrace_jhelper.d
@@ -0,0 +1,89 @@
+$NetBSD: patch-hotspot_src_os_solaris_dtrace_jhelper.d,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+GCC compatability.
+
+--- hotspot/src/os/solaris/dtrace/jhelper.d.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/src/os/solaris/dtrace/jhelper.d
+@@ -43,16 +43,33 @@
+
+ extern pointer __JvmOffsets;
+
+-extern pointer __1cJCodeCacheF_heap_;
+-extern pointer __1cIUniverseP_methodKlassObj_;
+-extern pointer __1cIUniverseO_collectedHeap_;
+-extern pointer __1cIUniverseL_narrow_oop_;
++/* name mangling depends on the compiler used */
++#ifndef _GNU_SOURCE
++#define SYMBOL_JCODECACHE_HEAP __1cJCodeCacheF_heap_
++#define SYMBOL_UNIVERSE_METHODKLASSOBJ __1cIUniverseP_methodKlassObj_
++#define SYMBOL_UNIVERSE_COLLECTEDHEAP __1cIUniverseO_collectedHeap_
++#define SYMBOL_UNIVERSE_NARROW_OOP __1cIUniverseL_narrow_oop_
++#define SYMBOL_NMETHOD_VTBL __1cHnmethodG__vtbl_
++#define SYMBOL_BUFFERBLOB_VTBL __1cKBufferBlobG__vtbl_
++#else
++#define SYMBOL_JCODECACHE_HEAP _ZN9CodeCache5_heapE
++#define SYMBOL_UNIVERSE_METHODKLASSOBJ _ZN8Universe15_methodKlassObjE
++#define SYMBOL_UNIVERSE_COLLECTEDHEAP _ZN8Universe14_collectedHeapE
++#define SYMBOL_UNIVERSE_NARROW_OOP _ZN8Universe11_narrow_oopE
++#define SYMBOL_NMETHOD_VTBL _ZTV7nmethod
++#define SYMBOL_BUFFERBLOB_VTBL _ZTV10BufferBlob
++#endif /* ! _GNU_SOURCE */
++
++extern pointer SYMBOL_JCODECACHE_HEAP;
++extern pointer SYMBOL_UNIVERSE_METHODKLASSOBJ;
++extern pointer SYMBOL_UNIVERSE_COLLECTEDHEAP;
++extern pointer SYMBOL_UNIVERSE_NARROW_OOP;
+ #ifdef _LP64
+ extern pointer UseCompressedOops;
+ #endif
+
+-extern pointer __1cHnmethodG__vtbl_;
+-extern pointer __1cKBufferBlobG__vtbl_;
++extern pointer SYMBOL_NMETHOD_VTBL;
++extern pointer SYMBOL_BUFFERBLOB_VTBL;
+
+ #define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer))
+ #define copyin_uchar(ADDR) *(uchar_t*) copyin((pointer) (ADDR), sizeof(uchar_t))
+@@ -156,8 +173,8 @@ dtrace:helper:ustack:
+ #error "Don't know architecture"
+ #endif
+
+- this->Universe_methodKlassOop = copyin_ptr(&``__1cIUniverseP_methodKlassObj_);
+- this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
++ this->Universe_methodKlassOop = copyin_ptr(&``SYMBOL_UNIVERSE_METHODKLASSOBJ);
++ this->CodeCache_heap_address = copyin_ptr(&``SYMBOL_JCODECACHE_HEAP);
+
+ /* Reading volatile values */
+ #ifdef _LP64
+@@ -166,9 +183,9 @@ dtrace:helper:ustack:
+ this->Use_Compressed_Oops = 0;
+ #endif
+
+- this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
++ this->Universe_narrow_oop_base = copyin_ptr(&``SYMBOL_UNIVERSE_NARROW_OOP +
+ OFFSET_NarrowOopStruct_base);
+- this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
++ this->Universe_narrow_oop_shift = copyin_int32(&``SYMBOL_UNIVERSE_NARROW_OOP +
+ OFFSET_NarrowOopStruct_shift);
+
+ this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
+@@ -189,7 +206,7 @@ dtrace:helper:ustack:
+ /*
+ * Get Java heap bounds
+ */
+- this->Universe_collectedHeap = copyin_ptr(&``__1cIUniverseO_collectedHeap_);
++ this->Universe_collectedHeap = copyin_ptr(&``SYMBOL_UNIVERSE_COLLECTEDHEAP);
+ this->heap_start = copyin_ptr(this->Universe_collectedHeap +
+ OFFSET_CollectedHeap_reserved +
+ OFFSET_MemRegion_start);
+@@ -290,8 +307,8 @@ dtrace:helper:ustack:
+ this->start = this->block + SIZE_HeapBlockHeader;
+ this->vtbl = copyin_ptr(this->start);
+
+- this->nmethod_vtbl = (pointer) &``__1cHnmethodG__vtbl_;
+- this->BufferBlob_vtbl = (pointer) &``__1cKBufferBlobG__vtbl_;
++ this->nmethod_vtbl = (pointer) &``SYMBOL_NMETHOD_VTBL;
++ this->BufferBlob_vtbl = (pointer) &``SYMBOL_BUFFERBLOB_VTBL;
+ }
+
+ dtrace:helper:ustack:
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_decoder__solaris.cpp b/lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_decoder__solaris.cpp
new file mode 100644
index 00000000000..6d54786d695
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_decoder__solaris.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-hotspot_src_os_solaris_vm_decoder__solaris.cpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+Avoid libdemangle with GCC.
+
+--- hotspot/src/os/solaris/vm/decoder_solaris.cpp.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/src/os/solaris/vm/decoder_solaris.cpp
+@@ -27,6 +27,11 @@
+ #include <demangle.h>
+
+ bool ElfDecoder::demangle(const char* symbol, char *buf, int buflen) {
++#ifdef SPARC_WORKS
+ return !cplus_demangle(symbol, buf, (size_t)buflen);
++#else
++ memcpy(buf, symbol, (size_t)buflen);
++ return 0;
++#endif
+ }
+
diff --git a/lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_os__solaris.cpp b/lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_os__solaris.cpp
new file mode 100644
index 00000000000..70ed1cd8d30
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_os_solaris_vm_os__solaris.cpp
@@ -0,0 +1,124 @@
+$NetBSD: patch-hotspot_src_os_solaris_vm_os__solaris.cpp,v 1.1 2013/06/15 09:31:05 jperkin Exp $
+
+Misc SunOS casts.
+
+--- hotspot/src/os/solaris/vm/os_solaris.cpp.orig 2012-08-10 16:24:27.000000000 +0000
++++ hotspot/src/os/solaris/vm/os_solaris.cpp
+@@ -630,7 +630,7 @@ static bool assign_distribution(processo
+ const processorid_t limit_id = max_id + 1;
+ // Make up markers for available processors.
+ bool* available_id = NEW_C_HEAP_ARRAY(bool, limit_id);
+- for (uint c = 0; c < limit_id; c += 1) {
++ for (processorid_t c = 0; c < limit_id; c += 1) {
+ available_id[c] = false;
+ }
+ for (uint a = 0; a < id_length; a += 1) {
+@@ -653,7 +653,7 @@ static bool assign_distribution(processo
+ // ... find the next available processor in the board.
+ for (uint slot = 0; slot < processors_per_board; slot += 1) {
+ uint try_id = board * processors_per_board + slot;
+- if ((try_id < limit_id) && (available_id[try_id] == true)) {
++ if ((try_id < (uint)limit_id) && (available_id[try_id] == true)) {
+ distribution[assigned] = try_id;
+ available_id[try_id] = false;
+ assigned += 1;
+@@ -661,7 +661,7 @@ static bool assign_distribution(processo
+ }
+ }
+ board += 1;
+- if (board * processors_per_board + 0 >= limit_id) {
++ if (board * processors_per_board + 0 >= (uint)limit_id) {
+ board = 0;
+ }
+ }
+@@ -718,7 +718,7 @@ bool os::bind_to_processor(uint processo
+ bool os::getenv(const char* name, char* buffer, int len) {
+ char* val = ::getenv( name );
+ if ( val == NULL
+- || strlen(val) + 1 > len ) {
++ || strlen(val) + 1 > (size_t)len ) {
+ if (len > 0) buffer[0] = 0; // return a null string
+ return false;
+ }
+@@ -925,7 +925,7 @@ void os::init_system_properties_values()
+ strcpy(library_path, common_path);
+ } else {
+ int inserted = 0;
+- for (i = 0; i < info->dls_cnt; i++, path++) {
++ for (i = 0; (uint_t)i < info->dls_cnt; i++, path++) {
+ uint_t flags = path->dls_flags & LA_SER_MASK;
+ if (((flags & LA_SER_LIBPATH) == 0) && !inserted) {
+ strcat(library_path, common_path);
+@@ -1059,7 +1059,8 @@ extern "C" void* java_start(void* thread
+ // in java_to_os_priority. So we save the native priority
+ // in the osThread and recall it here.
+
+- if ( osthr->thread_id() != -1 ) {
++ // thread_id_t ("osThread_solaris.hpp") == thread_t (<thread.h>) == unsigned int
++ if ( osthr->thread_id() != (unsigned int)-1 ) {
+ if ( UseThreadPriorities ) {
+ int prio = osthr->native_priority();
+ if (ThreadPriorityVerbose) {
+@@ -2855,7 +2856,7 @@ void os::numa_make_global(char *addr, si
+ // Get the number of the locality groups.
+ size_t os::numa_get_groups_num() {
+ size_t n = Solaris::lgrp_nlgrps(Solaris::lgrp_cookie());
+- return n != -1 ? n : 1;
++ return n != (size_t) -1 ? n : 1;
+ }
+
+ // Get a list of leaf locality groups. A leaf lgroup is group that
+@@ -2867,7 +2868,7 @@ size_t os::numa_get_leaf_groups(int *ids
+ return 1;
+ }
+ int result_size = 0, top = 1, bottom = 0, cur = 0;
+- for (int k = 0; k < size; k++) {
++ for (size_t k = 0; k < size; k++) {
+ int r = Solaris::lgrp_children(Solaris::lgrp_cookie(), ids[cur],
+ (Solaris::lgrp_id_t*)&ids[top], size - top);
+ if (r == -1) {
+@@ -2987,7 +2988,7 @@ char *os::scan_pages(char *start, char*
+ }
+
+ if ((validity[i] & 2) != 0 && page_expected->lgrp_id > 0) {
+- if (outdata[types * i] != page_expected->lgrp_id) {
++ if (outdata[types * i] != (uint64_t)page_expected->lgrp_id) {
+ break;
+ }
+ }
+@@ -4714,7 +4715,7 @@ const char * signames[] = {
+ const char* os::exception_name(int exception_code, char* buf, size_t size) {
+ if (0 < exception_code && exception_code <= SIGRTMAX) {
+ // signal
+- if (exception_code < sizeof(signames)/sizeof(const char*)) {
++ if ((size_t)exception_code < sizeof(signames)/sizeof(const char*)) {
+ jio_snprintf(buf, size, "%s", signames[exception_code]);
+ } else {
+ jio_snprintf(buf, size, "SIG%d", exception_code);
+@@ -5051,7 +5052,7 @@ void os::init(void) {
+ // If the pagesize of the VM is greater than 8K determine the appropriate
+ // number of initial guard pages. The user can change this with the
+ // command line arguments, if needed.
+- if (vm_page_size() > 8*K) {
++ if ((size_t)vm_page_size() > 8*K) {
+ StackYellowPages = 1;
+ StackRedPages = 1;
+ StackShadowPages = round_to((StackShadowPages*8*K), vm_page_size()) / vm_page_size();
+@@ -5072,7 +5073,7 @@ jint os::init_2(void) {
+
+ // Allocate a single page and mark it as readable for safepoint polling. Also
+ // use this first mmap call to check support for MAP_ALIGN.
+- address polling_page = (address)Solaris::mmap_chunk((char*)page_size,
++ address polling_page = (address)Solaris::mmap_chunk((char*)(uintptr_t)page_size,
+ page_size,
+ MAP_PRIVATE | MAP_ALIGN,
+ PROT_READ);
+@@ -5126,7 +5127,7 @@ jint os::init_2(void) {
+ // stack on a power of 2 boundary. The real fix for this
+ // should be to fix the guard page mechanism.
+
+- if (vm_page_size() > 8*K) {
++ if ((size_t)vm_page_size() > 8*K) {
+ threadStackSizeInBytes = (threadStackSizeInBytes != 0)
+ ? threadStackSizeInBytes +
+ ((StackYellowPages + StackRedPages) * vm_page_size())
diff --git a/lang/openjdk7/patches/patch-hotspot_src_share_vm_utilities_globalDefinitions__gcc.hpp b/lang/openjdk7/patches/patch-hotspot_src_share_vm_utilities_globalDefinitions__gcc.hpp
new file mode 100644
index 00000000000..c4a1c212dfe
--- /dev/null
+++ b/lang/openjdk7/patches/patch-hotspot_src_share_vm_utilities_globalDefinitions__gcc.hpp
@@ -0,0 +1,17 @@
+$NetBSD: patch-hotspot_src_share_vm_utilities_globalDefinitions__gcc.hpp,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+SunOS fixes.
+
+--- hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp.orig 2013-02-19 23:21:59.000000000 +0000
++++ hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+@@ -31,6 +31,10 @@
+ // globally used constants & types, class (forward)
+ // declarations and a few frequently used utility functions.
+
++#ifdef SOLARIS
++#include <inttypes.h>
++#endif // SOLARIS
++
+ #include <ctype.h>
+ #include <string.h>
+ #include <stdarg.h>
diff --git a/lang/openjdk7/patches/patch-jdk_make_com_sun_java_pack_Makefile b/lang/openjdk7/patches/patch-jdk_make_com_sun_java_pack_Makefile
new file mode 100644
index 00000000000..21f97a86786
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_com_sun_java_pack_Makefile
@@ -0,0 +1,31 @@
+$NetBSD: patch-jdk_make_com_sun_java_pack_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/com/sun/java/pack/Makefile.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/com/sun/java/pack/Makefile
+@@ -109,6 +109,15 @@ endif
+ endif #LINUX
+ endif #PLATFORM
+
++# gcc on solaris; this makes a library, too, so the -Wl, will appear on the LDDFLAGS. it needs to be removed for the exe build
++LINKER_EXE = $(LINKER)
++ifeq ($(PLATFORM), solaris)
++ ifeq ($(CC_VERSION), gcc)
++ REPLACE=-Wl,-soname=lib$(LIBRARY).so
++ LINKER_EXE = $(subst $(REPLACE),,$(LINKER))
++ endif # CC_VERSION
++endif # PLATFORM
++
+ UNPACK_EXE = $(BINDIR)/unpack200$(EXE_SUFFIX)
+
+ UNPACK_EXE_FILES_cpp = $(filter-out jni.cpp,$(FILES_cpp))
+@@ -157,7 +166,7 @@ $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) upd
+ $(prep-target)
+ $(RM) $(TEMPDIR)/mapfile-vers
+ $(CP) mapfile-vers-unpack200 $(TEMPDIR)/mapfile-vers
+- $(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
++ $(LINKER_EXE) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
+ ifdef MT
+ $(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
+ endif
diff --git a/lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris-gcc.gmk b/lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris-gcc.gmk
new file mode 100644
index 00000000000..21eb14c01dc
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris-gcc.gmk
@@ -0,0 +1,511 @@
+$NetBSD: patch-jdk_make_common_Defs-solaris-gcc.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/common/Defs-solaris-gcc.gmk.orig 2013-03-11 12:55:10.407557389 +0000
++++ jdk/make/common/Defs-solaris-gcc.gmk
+@@ -0,0 +1,504 @@
++#
++# Copyright (c) 1999, 2012, 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.
++#
++
++#
++# Makefile to specify compiler flags for programs and libraries
++# targeted to Solaris. Should not contain any rules.
++#
++# WARNING: This file is shared with other workspaces.
++# So when it includes other files, it must use JDK_TOPDIR.
++#
++
++# Warning: the following variables are overriden by Defs.gmk. Set
++# values will be silently ignored:
++# CFLAGS (set $(OTHER_CFLAGS) instead)
++# CPPFLAGS (set $(OTHER_CPPFLAGS) instead)
++# CXXFLAGS (set $(OTHER_CXXFLAGS) instead)
++# LDFLAGS (set $(OTHER_LDFAGS) instead)
++# LDLIBS (set $(EXTRA_LIBS) instead)
++# LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
++
++# Get shared JDK settings
++include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
++
++# Part of INCREMENTAL_BUILD mechanism.
++# Compiler emits things like: path/file.o: file.h
++# We want something like: relative_path/file.o relative_path/file.d: file.h
++CC_DEPEND = -MM
++CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g'
++
++ifndef PLATFORM_SRC
++ PLATFORM_SRC = $(BUILDDIR)/../src/solaris
++endif # PLATFORM_SRC
++
++# Location of the various .properties files specific to Solaris platform
++ifndef PLATFORM_PROPERTIES
++ PLATFORM_PROPERTIES = $(BUILDDIR)/../src/solaris/lib
++endif # PLATFORM_SRC
++
++# Platform specific closed sources
++ifndef OPENJDK
++ ifndef CLOSED_PLATFORM_SRC
++ CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
++ endif
++endif
++
++# platform specific include files
++PLATFORM_INCLUDE_NAME = $(PLATFORM)
++PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
++
++# suffix used for make dependencies files.
++DEPEND_SUFFIX = d
++# The suffix applied to the library name for FDLIBM
++FDDLIBM_SUFFIX = a
++# The suffix applied to scripts (.bat for windows, nothing for unix)
++SCRIPT_SUFFIX =
++# CC compiler object code output directive flag value
++CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
++CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
++
++# The Full Debug Symbols (FDS) default for VARIANT == OPT builds is
++# enabled with debug info files ZIP'ed to save space. For VARIANT !=
++# OPT builds, FDS is always enabled, after all a debug build without
++# debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has
++# meaning when FDS is enabled.
++#
++# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
++# disabled for a VARIANT == OPT build.
++#
++# Note: Use of a different variable name for the FDS override option
++# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
++# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
++# in options via environment variables, use of distinct variables
++# prevents strange behaviours. For example, in a VARIANT != OPT build,
++# the FULL_DEBUG_SYMBOLS environment variable will be 0, but the
++# ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same
++# variable name is used, then different values can be picked up by
++# different parts of the build. Just to be clear, we only need two
++# variable names because the incoming option value can be overridden
++# in some situations, e.g., a VARIANT != OPT build.
++
++ADD_GNU_DEBUGLINK = $(ABS_BUILDTOOLBINDIR)/add_gnu_debuglink
++FIX_EMPTY_SEC_HDR_FLAGS = $(ABS_BUILDTOOLBINDIR)/fix_empty_sec_hdr_flags
++
++ifeq ($(VARIANT), OPT)
++ FULL_DEBUG_SYMBOLS ?= 1
++ ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
++else
++ # debug variants always get Full Debug Symbols (if available)
++ ENABLE_FULL_DEBUG_SYMBOLS = 1
++endif
++_JUNK_ := $(shell \
++ echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
++# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
++
++ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
++ ifndef CROSS_COMPILE_ARCH
++ # Default OBJCOPY comes from GNU Binutils on Solaris:
++ DEF_OBJCOPY=/opt/local/bin/objcopy
++ else
++ # Assume objcopy is part of the cross-compilation toolkit
++ DEF_OBJCOPY=$(COMPILER_PATH)/objcopy
++ endif
++ OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
++ ifneq ($(ALT_OBJCOPY),)
++ _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
++ # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
++ OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
++ endif
++
++ # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
++ # JDK build to import .debuginfo or .diz files from the HotSpot build.
++ # However, adding FDS support to the JDK build will occur in phases
++ # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
++ # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a
++ # particular library or program supports FDS.
++
++ ifeq ($(OBJCOPY),)
++ _JUNK_ := $(shell \
++ echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
++ ENABLE_FULL_DEBUG_SYMBOLS=0
++ else
++ _JUNK_ := $(shell \
++ echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
++
++ # Library stripping policies for .debuginfo configs:
++ # all_strip - strips everything from the library
++ # min_strip - strips most stuff from the library; leaves minimum symbols
++ # no_strip - does not strip the library at all
++ #
++ # Oracle security policy requires "all_strip". A waiver was granted on
++ # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
++ #
++ # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
++ STRIP_POLICY ?= min_strip
++
++ _JUNK_ := $(shell \
++ echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
++
++ ZIP_DEBUGINFO_FILES ?= 1
++
++ _JUNK_ := $(shell \
++ echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
++ endif
++endif
++
++#
++# Default optimization
++#
++
++ifndef OPTIMIZATION_LEVEL
++ ifeq ($(PRODUCT), java)
++ OPTIMIZATION_LEVEL = HIGHER
++ else
++ OPTIMIZATION_LEVEL = LOWER
++ endif
++endif
++ifndef FASTDEBUG_OPTIMIZATION_LEVEL
++ FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
++endif
++
++CC_OPT/NONE =
++CC_OPT/LOWER = -O2
++CC_OPT/HIGHER = -O3
++CC_OPT/HIGHEST = -O3
++
++CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
++
++# For all platforms, do not omit the frame pointer register usage.
++# We need this frame pointer to make it easy to walk the stacks.
++# This should be the default on X86, but ia64 and amd64 may not have this
++# as the default.
++CFLAGS_REQUIRED_amd64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
++LDFLAGS_COMMON_amd64 += -m64
++CFLAGS_REQUIRED_i586 += -m32 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
++LDFLAGS_COMMON_i586 += -m32
++CFLAGS_REQUIRED_ia64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
++CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
++LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
++CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
++LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
++CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN
++CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN
++ifeq ($(ZERO_BUILD), true)
++ CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
++ ifeq ($(ZERO_ENDIANNESS), little)
++ CFLAGS_REQUIRED += -D_LITTLE_ENDIAN
++ endif
++ LDFLAGS_COMMON += $(ZERO_ARCHFLAG)
++else
++ CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
++ LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
++endif
++
++# If this is a --hash-style=gnu system, use --hash-style=both
++# The gnu .hash section won't work on some Linux systems like SuSE 10.
++_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu')
++ifneq ($(_HAS_HASH_STYLE_GNU),)
++ LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
++endif
++LDFLAGS_COMMON += $(LDFLAGS_HASH_STYLE)
++
++#
++# Selection of warning messages
++#
++GCC_INHIBIT = -Wno-unused -Wno-parentheses
++GCC_STYLE =
++GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
++
++#
++# Treat compiler warnings as errors, if warnings not allowed
++#
++ifeq ($(COMPILER_WARNINGS_FATAL),true)
++ GCC_WARNINGS += -Werror
++endif
++
++#
++# Misc compiler options
++#
++ifneq ($(ARCH),ppc)
++ CFLAGS_COMMON = -fno-strict-aliasing
++endif
++PIC_CODE_LARGE = -fPIC
++PIC_CODE_SMALL = -fpic
++GLOBAL_KPIC = $(PIC_CODE_LARGE)
++CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS)
++ifeq ($(ARCH), amd64)
++ CFLAGS_COMMON += -pipe
++endif
++
++# Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1
++DEBUG_FLAG = -g
++ifeq ($(FASTDEBUG), true)
++ ifeq ($(ARCH_DATA_MODEL), 64)
++ DEBUG_FLAG = -g1
++ endif
++endif
++
++# DEBUG_BINARIES overrides everything, use full -g debug information
++ifeq ($(DEBUG_BINARIES), true)
++ DEBUG_FLAG = -g
++ CFLAGS_REQUIRED += $(DEBUG_FLAG)
++endif
++
++# If Full Debug Symbols is enabled, then we want the same debug and
++# optimization flags as used by FASTDEBUG.
++#
++ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
++ ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
++ ifeq ($(VARIANT), OPT)
++ CC_OPT = $(DEBUG_FLAG) $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
++ endif
++ endif
++endif
++
++CFLAGS_OPT = $(CC_OPT)
++CFLAGS_DBG = $(DEBUG_FLAG)
++CFLAGS_COMMON += $(CFLAGS_REQUIRED)
++
++CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
++CXXFLAGS_OPT = $(CC_OPT)
++CXXFLAGS_DBG = $(DEBUG_FLAG)
++CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
++
++# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java
++ifeq ($(FASTDEBUG), true)
++ CFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
++ CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
++endif
++
++CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
++
++# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
++ifneq ($(ARCH),alpha)
++ CPP_ARCH_FLAGS += -D$(ARCH)
++else
++ CPP_ARCH_FLAGS += -D_$(ARCH)_
++endif
++
++CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -D__solaris__ $(VERSION_DEFINES) -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
++
++ifeq ($(ARCH_DATA_MODEL), 64)
++CPPFLAGS_COMMON += -D_LP64=1
++endif
++
++CPPFLAGS_OPT = -DNDEBUG
++CPPFLAGS_DBG = -DDEBUG
++ifneq ($(PRODUCT), java)
++ CPPFLAGS_DBG += -DLOGGING
++endif
++
++ifdef LIBRARY
++ # Libraries need to locate other libraries at runtime, and you can tell
++ # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
++ # buried inside the .so. The $ORIGIN says to look relative to where
++ # the library itself is and it can be followed with relative paths from
++ # that. By default we always look in $ORIGIN, optionally we add relative
++ # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
++ # On Linux we add a flag -z origin, not sure if this is necessary, but
++ # doesn't seem to hurt.
++ # The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
++ # Try: 'readelf -d lib*.so' to see these settings in a library.
++ #
++ifndef USE_GCC
++ Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin
++ Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin
++ Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin
++ Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin
++ Z_ORIGIN_FLAG/arm =
++ Z_ORIGIN_FLAG/ppc =
++ Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin
++
++ LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY))
++
++ LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN
++ LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%)
++else
++ LDFLAGS_COMMON += -Wl,-R${PREFIX}/lib
++ LDFLAGS_COMMON += -Wl,-R${PREFIX}/java/openjdk7/jre/lib/$(LIBARCH)
++ LDFLAGS_COMMON += -Wl,-R${PREFIX}/java/openjdk7/jre/lib/$(LIBARCH)/jli
++endif # USE_GCC
++endif # LIBRARY
++
++EXTRA_LIBS += -lc
++
++LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs
++LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
++
++#
++# -L paths for finding and -ljava
++#
++#LDFLAGS_OPT = -Xlinker -O1
++LDFLAGS_OPT =
++LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
++ifdef LIBRARY
++LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
++endif
++
++#
++# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
++# statically link libgcc but will print a warning with the flag. We don't
++# want the warning, so check gcc version first.
++#
++ifeq ($(CC_MAJORVER),3)
++ OTHER_LDFLAGS += -static-libgcc
++endif
++
++# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
++# (See Rules.gmk) The gcc 5 compiler might have an option for this?
++AUTOMATIC_PCH_OPTION =
++
++#
++# Post Processing of libraries/executables
++#
++ifeq ($(VARIANT), OPT)
++ ifneq ($(NO_STRIP), true)
++ ifneq ($(DEBUG_BINARIES), true)
++ # Debug 'strip -g' leaves local function Elf symbols (better stack
++ # traces)
++ POST_STRIP_PROCESS = $(STRIP) -g
++ endif
++ endif
++endif
++
++#
++# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o
++#
++# actually if linker = illumos
++ifeq ($(CC_VERSION),gcc)
++LD_MAPFILE_FLAG = -Xlinker -M -Xlinker
++else
++LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker
++#LD_MAPFILE_FLAG = -M
++endif
++
++#
++# Support for Quantify.
++#
++ifdef QUANTIFY
++QUANTIFY_CMD = quantify
++QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
++LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
++endif
++
++#
++# Path and option to link against the VM, if you have to. Note that
++# there are libraries that link against only -ljava, but they do get
++# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
++# the library itself should not.
++#
++VM_NAME = server
++JVMLIB = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -Wl,-R${PREFIX}/java/openjdk7/jre/lib/$(LIBARCH)/$(VM_NAME) -ljvm
++JAVALIB = -ljava $(JVMLIB)
++
++#
++# We want to privatize JVM symbols on Solaris. This is so the user can
++# write a function called FindClass and this should not override the
++# FindClass that is inside the JVM. At this point in time we are not
++# concerned with other JNI libraries because we hope that there will
++# not be as many clashes there.
++#
++PRIVATIZE_JVM_SYMBOLS = false
++
++#USE_PTHREADS = true
++#override ALT_CODESET_KEY = _NL_CTYPE_CODESET_NAME
++override AWT_RUNPATH =
++#override HAVE_ALTZONE = false
++#override HAVE_FILIOH = false
++#override HAVE_GETHRTIME = false
++#override HAVE_GETHRVTIME = false
++#override HAVE_SIGIGNORE = true
++#override LEX_LIBRARY = -lfl
++ifeq ($(STATIC_CXX),true)
++override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
++else
++override LIBCXX = -lstdc++
++endif
++#override LIBPOSIX4 =
++override LIBM = /usr/lib$(ISA_DIR)/libm.so.2
++override LIBSOCKET = -lsocket
++override LIBNSL = -lnsl
++override LIBSCF = -lscf
++#override LIBTHREAD =
++override LIBDL = -ldl
++#override MOOT_PRIORITIES = true
++#override NO_INTERRUPTIBLE_IO = true
++override OPENWIN_HOME = /opt/local
++override OPENWIN_LIB = $(OPENWIN_HOME)/lib$(ISA_DIR)
++override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER
++#override SUN_CMM_SUBDIR =
++override THREADS_FLAG = native
++#override USE_GNU_M4 = true
++override USING_GNU_TAR = true
++#override WRITE_LIBVERSION = false
++
++# assuming that solaris && gcc equals a system with modular X11 header location
++ifeq ($(PLATFORM), solaris)
++ ifeq ($(CC_VERSION), gcc)
++ OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
++ endif # CC_VERSION
++endif # PLATFORM
++
++# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the
++# resulting resolved absolute name of the executable in the environment
++# variable EXECNAME. That executable name is then used that to locate the
++# installation area.
++#override USE_EXECNAME = true
++
++# If your platform has DPS, it will have Type1 fonts too, in which case
++# it is best to enable DPS support until such time as 2D's rasteriser
++# can fully handle Type1 fonts in all cases. Default is "yes".
++# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
++# DPS (Displayable PostScript) is available on Solaris machines
++HAVE_DPS = no
++
++SYSTEM_ZLIB = true
++
++#
++# Japanese manpages
++#
++JA_SOURCE_ENCODING = eucJP
++JA_TARGET_ENCODINGS = UTF-8
++
++# Settings for the JDI - Serviceability Agent binding.
++HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
++SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
++SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
++SA_DIZ_NAME = $(LIB_PREFIX)saproc.diz
++
++# The JDI - Serviceability Agent binding is not currently supported
++# on Linux-ia64.
++#ifeq ($(ARCH), ia64)
++# INCLUDE_SA = false
++#else
++ INCLUDE_SA = true
++#endif
++
++ifdef CROSS_COMPILE_ARCH
++ # X11 headers are not under /usr/include
++ OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
++ OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
++ OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
++endif
diff --git a/lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris.gmk b/lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris.gmk
new file mode 100644
index 00000000000..f89dea27f68
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_common_Defs-solaris.gmk
@@ -0,0 +1,23 @@
+$NetBSD: patch-jdk_make_common_Defs-solaris.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/common/Defs-solaris.gmk.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/common/Defs-solaris.gmk
+@@ -44,6 +44,10 @@
+ # Note: CPPFLAGS are used in C and C++ compiles.
+ #
+
++ifdef USE_GCC
++ include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM)-gcc.gmk
++else
++
+ # Get shared JDK settings
+ include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
+
+@@ -799,3 +803,5 @@ SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.
+ SA_DIZ_NAME = $(LIB_PREFIX)saproc.diz
+ INCLUDE_SA=true
+
++endif # USE_GCC
++
diff --git a/lang/openjdk7/patches/patch-jdk_make_common_Mapfile-vers.gmk b/lang/openjdk7/patches/patch-jdk_make_common_Mapfile-vers.gmk
new file mode 100644
index 00000000000..cbda9610494
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_common_Mapfile-vers.gmk
@@ -0,0 +1,42 @@
+$NetBSD: patch-jdk_make_common_Mapfile-vers.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/common/Mapfile-vers.gmk.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/common/Mapfile-vers.gmk
+@@ -50,14 +50,16 @@ ifeq ($(VARIANT), OPT)
+ ifndef FILES_m
+ FILES_m = mapfile-vers
+ endif
+-
++
++ifneq ($(CC_VERSION), gcc)
+ # If we are re-ordering functions in this solaris library, we need to make
+ # sure that -xF is added to the compile lines. This option is critical and
+ # enables the functions to be reordered.
+ ifdef FILES_reorder
+ CFLAGS_OPT += -xF
+ CXXFLAGS_OPT += -xF
+- endif
++ endif # FILES_reorder
++endif # USE_GCC
+
+ INIT += $(TEMPDIR)/mapfile-vers
+
+@@ -70,9 +72,15 @@ $(TEMPDIR)/mapfile-vers : $(FILES_m) $(F
+ endif # VARIANT
+
+ ifndef LDNOMAP
++ifneq ($(CC_VERSION), gcc)
+ LDMAPFLAGS_OPT = -M$(TEMPDIR)/mapfile-vers
+ LDMAPFLAGS_DBG = $(FILES_m:%=-M%)
+-endif
++else
++ ## proper passthrough for gcc
++ LDMAPFLAGS_OPT = -Xlinker -M$(TEMPDIR)/mapfile-vers
++ LDMAPFLAGS_DBG = $(FILES_m:%=-Xlinker -M%)
++endif # USE_GCC
++endif # LDNOMAP
+
+ endif # PLATFORM
+
diff --git a/lang/openjdk7/patches/patch-jdk_make_common_Program.gmk b/lang/openjdk7/patches/patch-jdk_make_common_Program.gmk
new file mode 100644
index 00000000000..5a012228b99
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_common_Program.gmk
@@ -0,0 +1,36 @@
+$NetBSD: patch-jdk_make_common_Program.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/common/Program.gmk.orig 2013-06-11 09:37:03.843509400 +0000
++++ jdk/make/common/Program.gmk
+@@ -65,7 +65,10 @@ program: $(ACTUAL_PROGRAM)
+ ifndef CROSS_COMPILE_ARCH
+ # reuse the mapfiles in the launcher's directory, the same should
+ # be applicable to the tool launchers as well.
+- FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH)
++ # Except when the makefile requests a specific mapfile.
++ ifndef FILES_m
++ FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH)
++ endif # ! FILES_m
+ include $(BUILDDIR)/common/Mapfile-vers.gmk
+ endif
+
+@@ -110,6 +113,7 @@ ifneq (,$(findstring $(PLATFORM), linux
+ LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
+ OTHER_LDLIBS += -ljli
+ ifeq ($(PLATFORM), solaris)
++ LDFLAGS += -R ${PREFIX}/java/openjdk7/jre/lib/${LIBARCH}/jli
+ ifeq ($(ARCH_DATA_MODEL), 32)
+ LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli
+ LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli
+@@ -124,6 +128,9 @@ ifneq (,$(findstring $(PLATFORM), linux
+ LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
+ LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
+ endif # PLATFORM LINUX
++ ifeq ($(SYSTEM_ZLIB),true)
++ OTHER_LDLIBS += $(ZLIB_LIBS)
++ endif # SYSTEM_ZLIB
+ endif # PLATFORM linux solaris
+
+ ifeq ($(PLATFORM), windows)
diff --git a/lang/openjdk7/patches/patch-jdk_make_common_shared_Compiler-gcc.gmk b/lang/openjdk7/patches/patch-jdk_make_common_shared_Compiler-gcc.gmk
new file mode 100644
index 00000000000..437a4d4ffaf
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_common_shared_Compiler-gcc.gmk
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_make_common_shared_Compiler-gcc.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC needs -shared not -G.
+
+--- jdk/make/common/shared/Compiler-gcc.gmk.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/common/shared/Compiler-gcc.gmk
+@@ -80,7 +80,7 @@ ifeq ($(PLATFORM), solaris)
+ CXX = $(COMPILER_PATH)g++
+
+ # Option used to create a shared library
+- SHARED_LIBRARY_FLAG = -G
++ SHARED_LIBRARY_FLAG = -shared
+
+ endif
+
diff --git a/lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-utils.gmk b/lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-utils.gmk
new file mode 100644
index 00000000000..b9561d200d2
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-utils.gmk
@@ -0,0 +1,14 @@
+$NetBSD: patch-jdk_make_common_shared_Defs-utils.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Use pkgsrc zip commands.
+
+--- jdk/make/common/shared/Defs-utils.gmk.orig 2013-03-10 22:22:12.950670029 +0000
++++ jdk/make/common/shared/Defs-utils.gmk
+@@ -254,3 +254,7 @@ ifeq ($(PLATFORM), macosx)
+ # Builtin shell command, no -e option needed
+ ECHO = echo
+ endif
++
++ZIPEXE = $(PKGSRC_ZIPEXE)
++UNZIP = $(PKGSRC_UNZIP)
++UNZIPSFX = $(PKGSRC_UNZIPSFX)
diff --git a/lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-versions.gmk b/lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-versions.gmk
new file mode 100644
index 00000000000..ee6a38ed688
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_common_shared_Defs-versions.gmk
@@ -0,0 +1,19 @@
+$NetBSD: patch-jdk_make_common_shared_Defs-versions.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Add GCC support.
+
+--- jdk/make/common/shared/Defs-versions.gmk.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/common/shared/Defs-versions.gmk
+@@ -36,7 +36,11 @@ endif
+
+ # Solaris uses Sun Studio compilers by default
+ ifeq ($(PLATFORM), solaris)
+- override CC_VERSION = sun
++ ifdef USE_GCC
++ override CC_VERSION = gcc
++ else
++ override CC_VERSION = sun
++ endif
+ endif
+
+ # Linux uses GNU compilers by default
diff --git a/lang/openjdk7/patches/patch-jdk_make_java_instrument_Makefile b/lang/openjdk7/patches/patch-jdk_make_java_instrument_Makefile
new file mode 100644
index 00000000000..76e11be1d88
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_java_instrument_Makefile
@@ -0,0 +1,16 @@
+$NetBSD: patch-jdk_make_java_instrument_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Need libiconv.
+
+--- jdk/make/java/instrument/Makefile.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/java/instrument/Makefile
+@@ -119,6 +119,9 @@ else
+ OTHER_LDLIBS += -ldl
+ ifeq ($(PLATFORM), solaris)
+ LDFLAGS += -R \$$ORIGIN/jli
++ ifeq ($(CC_VERSION), gcc)
++ OTHER_LDLIBS += -liconv
++ endif
+ endif
+ ifeq ($(PLATFORM), linux)
+ LDFLAGS += $(LDFLAG_Z_ORIGIN)
diff --git a/lang/openjdk7/patches/patch-jdk_make_java_nio_Makefile b/lang/openjdk7/patches/patch-jdk_make_java_nio_Makefile
new file mode 100644
index 00000000000..5397a06f94a
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_java_nio_Makefile
@@ -0,0 +1,16 @@
+$NetBSD: patch-jdk_make_java_nio_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Ensure we pick up the main flags.
+
+--- jdk/make/java/nio/Makefile.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/java/nio/Makefile
+@@ -34,6 +34,9 @@ PRODUCT = java
+ OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint:serial -Werror
+ include $(BUILDDIR)/common/Defs.gmk
+
++LDDFLAGS += $(LDFLAGS_COMMON_$(ARCH))
++CPPFLAGS += $(CFLAGS_REQUIRED_$(ARCH))
++
+ NIO_SRC = $(SHARE_SRC)/classes/java/nio
+ NIO_GEN = $(GENSRCDIR)/java/nio
+
diff --git a/lang/openjdk7/patches/patch-jdk_make_java_npt_Makefile b/lang/openjdk7/patches/patch-jdk_make_java_npt_Makefile
new file mode 100644
index 00000000000..64123cff7ca
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_java_npt_Makefile
@@ -0,0 +1,19 @@
+$NetBSD: patch-jdk_make_java_npt_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC needs libiconv.
+
+--- jdk/make/java/npt/Makefile.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/java/npt/Makefile
+@@ -38,6 +38,12 @@ FILES_m = mapfile-vers
+
+ include $(BUILDDIR)/common/Defs.gmk
+
++ifeq ($(PLATFORM), solaris)
++ ifeq ($(CC_VERSION), gcc)
++ OTHER_LDLIBS += -liconv
++ endif # CC_VERSION
++endif # PLATFORM
++
+ SRCDIR=$(SHARE_SRC)/npt
+ PSRCDIR=$(PLATFORM_SRC)/npt
+
diff --git a/lang/openjdk7/patches/patch-jdk_make_sun_awt_Makefile b/lang/openjdk7/patches/patch-jdk_make_sun_awt_Makefile
new file mode 100644
index 00000000000..c1e976b5f81
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_sun_awt_Makefile
@@ -0,0 +1,70 @@
+$NetBSD: patch-jdk_make_sun_awt_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/sun/awt/Makefile.orig 2013-06-11 14:02:41.501545894 +0000
++++ jdk/make/sun/awt/Makefile
+@@ -94,6 +94,7 @@ ifeq ($(PLATFORM), solaris)
+ FILES_c = $(FILES_2D_c)
+ FILES_c += awt_LoadLibrary.c
+ OTHER_LDLIBS = $(JVMLIB) $(LIBM) $(LIBDL)
++ifneq ($(CC_VERSION), gcc)
+ ifeq ($(CC_VER), 5.8)
+ ifndef REMOVE_ALL_WORKAROUNDS
+ ifeq ($(ARCH_FAMILY), i586)
+@@ -114,6 +115,7 @@ ifeq ($(CC_VER), 5.8)
+ endif
+ endif
+ endif
++endif # ! CC_VERSION
+ endif
+
+ ifeq ($(PLATFORM), linux)
+@@ -427,7 +429,15 @@ FONTCONFIGS_SRC = $(PLATFORM_SRC)/classe
+ _FONTCONFIGS = \
+ fontconfig.properties
+
+-FONTCONFIGS_SRC_PREFIX = $(PLATFORM).
++ifndef DISTRO
++ DISTRO=$(PLATFORM)
++endif # DISTRO
++
++ifeq ($(DISTRO), pkgsrc)
++ FONTCONFIGS_SRC_PREFIX = pkgsrc.
++else
++ FONTCONFIGS_SRC_PREFIX = $(PLATFORM).
++endif # DISTRO
+
+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SOLARIS
+ endif # PLATFORM
+@@ -543,12 +553,7 @@ ifneq ($(PLATFORM), windows)
+ # Other extra flags needed for compiling.
+ #
+
+-ifeq ($(PLATFORM), linux)
+-CPPFLAGS += -I$(OPENWIN_HOME)/include \
+- -I$(OPENWIN_HOME)/include/X11/extensions \
+- -I$(PLATFORM_SRC)/native/$(PKGDIR)/font
+-endif
+-ifeq ($(PLATFORM), bsd)
++ifneq (,$(findstring $(PLATFORM), linux bsd solaris))
+ CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/font
+ endif
+ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
+@@ -573,13 +578,10 @@ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGD
+ $(EVENT_MODEL)
+
+ # include these last so we don't pick up unintentional includes
+-ifeq ($(PLATFORM), bsd)
++ifneq (,$(findstring $(PLATFORM), linux bsd solaris))
+ CPPFLAGS += -I$(OPENWIN_HOME)/include \
+- -I$(OPENWIN_HOME)/include/X11/extensions
+-endif
+-
+-ifneq (,$(findstring $(PLATFORM), linux bsd))
+-LDFLAGS += -L$(OPENWIN_LIB)
++ -I$(OPENWIN_HOME)/include/X11/extensions
++LDFLAGS += -L$(OPENWIN_LIB) -Wl,-R$(OPENWIN_LIB)
+ endif
+
+ LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \
diff --git a/lang/openjdk7/patches/patch-jdk_make_sun_awt_mawt.gmk b/lang/openjdk7/patches/patch-jdk_make_sun_awt_mawt.gmk
new file mode 100644
index 00000000000..08bd0b903de
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_sun_awt_mawt.gmk
@@ -0,0 +1,31 @@
+$NetBSD: patch-jdk_make_sun_awt_mawt.gmk,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Fix "Extraneous text after `ifeq' directive".
+
+--- jdk/make/sun/awt/mawt.gmk.orig 2013-06-14 12:22:13.564220901 +0000
++++ jdk/make/sun/awt/mawt.gmk
+@@ -193,7 +193,7 @@ endif
+ #
+ # Other extra flags needed for compiling.
+ #
+-ifneq ($(PLATFORM), bsd))
++ifneq ($(PLATFORM), bsd)
+ CPPFLAGS += -I$(CUPS_HEADERS_PATH)
+
+ ifndef HEADLESS
+@@ -245,13 +245,13 @@ ifeq ($(PLATFORM), linux)
+ $(wildcard /usr/include/X11/extensions))
+ endif
+
+-ifeq ($(PLATFORM), bsd))
++ifeq ($(PLATFORM), bsd)
+ CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
+ -I$(OPENWIN_HOME)/include \
+ -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
+ endif
+
+-ifeq ($(PLATFORM), macosx))
++ifeq ($(PLATFORM), macosx)
+ CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
+ -I$(OPENWIN_HOME)/include
+ endif
diff --git a/lang/openjdk7/patches/patch-jdk_make_sun_security_ec_Makefile b/lang/openjdk7/patches/patch-jdk_make_sun_security_ec_Makefile
new file mode 100644
index 00000000000..146d5b307f0
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_sun_security_ec_Makefile
@@ -0,0 +1,22 @@
+$NetBSD: patch-jdk_make_sun_security_ec_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC compatability.
+
+--- jdk/make/sun/security/ec/Makefile.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/make/sun/security/ec/Makefile
+@@ -187,6 +187,15 @@ ifeq ($(NATIVE_ECC_AVAILABLE), true)
+ #
+ OTHER_CFLAGS += -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B
+
++ # gcc on solaris seems to define _POSIX_C_SOURCE or _XOPEN
++ # g++, on the otherhand, does not define either.
++ # It causes problems with g++: _B_FALSE instead of B_FALSE
++ ifeq ($(PLATFORM), solaris)
++ ifeq ($(CC_VERSION), gcc)
++ OTHER_CFLAGS += -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 -D__EXTENSIONS__
++ endif # CC_VERSION
++ endif # PLATFORM
++
+ #
+ # Libraries to link
+ #
diff --git a/lang/openjdk7/patches/patch-jdk_make_sun_splashscreen_Makefile b/lang/openjdk7/patches/patch-jdk_make_sun_splashscreen_Makefile
new file mode 100644
index 00000000000..d78c1ccaed8
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_sun_splashscreen_Makefile
@@ -0,0 +1,18 @@
+$NetBSD: patch-jdk_make_sun_splashscreen_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/sun/splashscreen/Makefile.orig 2013-06-11 09:37:03.893407544 +0000
++++ jdk/make/sun/splashscreen/Makefile
+@@ -91,6 +91,11 @@ else ifneq ($(PLATFORM), windows)
+ OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv
+ endif
+ endif
++ ifeq ($(PLATFORM), solaris)
++ ifeq ($(CC_VERSION), gcc)
++ OTHER_LDLIBS += -liconv
++ endif
++ endif
+ CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
+ OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread
+ else # PLATFORM
diff --git a/lang/openjdk7/patches/patch-jdk_make_sun_xawt_Makefile b/lang/openjdk7/patches/patch-jdk_make_sun_xawt_Makefile
new file mode 100644
index 00000000000..929b718c120
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_make_sun_xawt_Makefile
@@ -0,0 +1,25 @@
+$NetBSD: patch-jdk_make_sun_xawt_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC support.
+
+--- jdk/make/sun/xawt/Makefile.orig 2013-06-11 09:37:03.894233474 +0000
++++ jdk/make/sun/xawt/Makefile
+@@ -58,7 +58,7 @@ endif
+
+ # For Xrender extension.
+ ifeq ($(PLATFORM), solaris)
+-LDFLAGS += -L/usr/openwin/sfw/lib$(ISA_DIR) -R/usr/openwin/sfw/lib$(ISA_DIR)
++LDFLAGS += -Wl,-R$(OPENWIN_LIB)
+ endif
+
+ ifeq ($(PLATFORM), linux)
+@@ -170,6 +170,9 @@ endif
+ # we will set a flag indicating this mismatch and the JDK source file
+ # will interpret it to resolve the problem.
+ ifeq ($(PLATFORM), solaris)
++ ifeq ($(CC_VERSION), gcc)
++ CPPFLAGS += -I$(OPENWIN_HOME)/include
++ endif # CC_VERSION
+ CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
+ OS_VERSION := $(shell uname -r)
+ XRENDER_H := $(OPENWIN_HOME)/share/include/X11/extensions/Xrender.h
diff --git a/lang/openjdk7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_defines.h b/lang/openjdk7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_defines.h
new file mode 100644
index 00000000000..63259cdf417
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_defines.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_src_share_native_com_sun_java_util_jar_pack_defines.h,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Avoid uLong conflicts on !BSD.
+
+--- jdk/src/share/native/com/sun/java/util/jar/pack/defines.h.orig 2013-06-14 21:08:03.030278224 +0000
++++ jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
+@@ -93,7 +93,7 @@ extern int assert_failed(const char*);
+ // bytes and byte arrays
+
+ typedef unsigned int uint;
+-#if !defined(_ALLBSD_SOURCE) || (defined(_ALLBSD_SOURCE) && defined(NO_ZLIB))
++#if defined(NO_ZLIB)
+ #ifdef _LP64
+ typedef unsigned int uLong; // Historical zlib, should be 32-bit.
+ #else
diff --git a/lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_imageioJPEG.c b/lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_imageioJPEG.c
new file mode 100644
index 00000000000..39a3d698a34
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_imageioJPEG.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_src_share_native_sun_awt_image_jpeg_imageioJPEG.c,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Ensure we use the bundled jpeg.
+
+--- jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+@@ -50,7 +50,7 @@
+ #include "com_sun_imageio_plugins_jpeg_JPEGImageWriter.h"
+
+ /* headers from the JPEG library */
+-#include <jpeglib.h>
++#include "jpeglib.h"
+ #include "jerror.h"
+
+ #undef MAX
diff --git a/lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_jpegdecoder.c b/lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_jpegdecoder.c
new file mode 100644
index 00000000000..9bd8779092e
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_src_share_native_sun_awt_image_jpeg_jpegdecoder.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_src_share_native_sun_awt_image_jpeg_jpegdecoder.c,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Ensure we use the bundled jpeg.
+
+--- jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
+@@ -44,7 +44,7 @@
+ /* undo "system_boolean" hack and undef FAR since we don't use it anyway */
+ #undef boolean
+ #undef FAR
+-#include <jpeglib.h>
++#include "jpeglib.h"
+ #include "jerror.h"
+
+ /* The method IDs we cache. Note that the last two belongs to the
diff --git a/lang/openjdk7/patches/patch-jdk_src_share_native_sun_security_ec_impl_ecc__impl.h b/lang/openjdk7/patches/patch-jdk_src_share_native_sun_security_ec_impl_ecc__impl.h
new file mode 100644
index 00000000000..92ecd9c3198
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_src_share_native_sun_security_ec_impl_ecc__impl.h
@@ -0,0 +1,33 @@
+$NetBSD: patch-jdk_src_share_native_sun_security_ec_impl_ecc__impl.h,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC compatability.
+
+--- jdk/src/share/native/sun/security/ec/impl/ecc_impl.h.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/src/share/native/sun/security/ec/impl/ecc_impl.h
+@@ -38,12 +38,13 @@
+
+ #ifndef _ECC_IMPL_H
+ #define _ECC_IMPL_H
++
++#include <sys/types.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+-#include <sys/types.h>
+ #include "ecl-exp.h"
+
+ /*
+@@ -57,6 +58,11 @@ typedef unsigned long ulong_t;
+ typedef enum { B_FALSE, B_TRUE } boolean_t;
+ #endif /* __linux__ */
+
++#if defined(__solaris__) && defined(_GNU_SOURCE)
++#define B_FALSE _B_FALSE
++#define B_TRUE _B_TRUE
++#endif /* __solaris__ && _GNU_SOURCE */
++
+ #ifdef _ALLBSD_SOURCE
+ #include <stdint.h>
+ #define B_FALSE FALSE
diff --git a/lang/openjdk7/patches/patch-jdk_src_solaris_bin_ergo__i586.c b/lang/openjdk7/patches/patch-jdk_src_solaris_bin_ergo__i586.c
new file mode 100644
index 00000000000..3360c3abccb
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_src_solaris_bin_ergo__i586.c
@@ -0,0 +1,50 @@
+$NetBSD: patch-jdk_src_solaris_bin_ergo__i586.c,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+GCC compatability.
+
+--- jdk/src/solaris/bin/ergo_i586.c.orig 2013-06-12 00:28:04.421609606 +0000
++++ jdk/src/solaris/bin/ergo_i586.c
+@@ -27,7 +27,7 @@
+
+ static unsigned long physical_processors(void);
+
+-#ifdef __solaris__
++#if defined(__solaris__) && !defined(_GNU_SOURCE)
+
+ /*
+ * A utility method for asking the CPU about itself.
+@@ -76,7 +76,9 @@ get_cpuid(uint32_t arg,
+ asm(" popl %ebx");
+ #endif /* LP64 */
+ }
++#endif /* __solaris__ && !_GNU_SOURCE */
+
++#ifdef __solaris__
+ /* The definition of a server-class machine for solaris-i586/amd64 */
+ jboolean
+ ServerClassMachineImpl(void) {
+@@ -106,7 +108,7 @@ ServerClassMachineImpl(void) {
+
+ #endif /* __solaris__ */
+
+-#if !defined(MACOSX) && (defined(__linux__) || defined(_ALLBSD_SOURCE))
++#if !defined(MACOSX) && (defined(__linux__) || defined(_ALLBSD_SOURCE)) || (defined(__solaris__) && defined(_GNU_SOURCE))
+
+ /*
+ * A utility method for asking the CPU about itself.
+@@ -177,6 +179,7 @@ get_cpuid(uint32_t arg,
+ #define OSNAMEPREFIX "bsd_"
+ #endif
+
++#ifndef __solaris__
+ /* The definition of a server-class machine for linux-i586 */
+ jboolean
+ ServerClassMachineImpl(void) {
+@@ -203,6 +206,7 @@ ServerClassMachineImpl(void) {
+ (result == JNI_TRUE ? "true" : "false"));
+ return result;
+ }
++#endif /* !__solaris__ */
+ #endif /* !MACOSX && (__linux__ || _ALLBSD_SOURCE) */
+
+ /*
diff --git a/lang/openjdk7/patches/patch-jdk_src_solaris_native_java_net_NetworkInterface.c b/lang/openjdk7/patches/patch-jdk_src_solaris_native_java_net_NetworkInterface.c
new file mode 100644
index 00000000000..e8be58fc9e6
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_src_solaris_native_java_net_NetworkInterface.c
@@ -0,0 +1,45 @@
+$NetBSD: patch-jdk_src_solaris_native_java_net_NetworkInterface.c,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Zones support.
+
+--- jdk/src/solaris/native/java/net/NetworkInterface.c.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/src/solaris/native/java/net/NetworkInterface.c
+@@ -43,6 +43,7 @@
+ #include <fcntl.h>
+ #include <stropts.h>
+ #include <sys/sockio.h>
++#include <zone.h>
+ #endif
+
+ #ifdef __linux__
+@@ -1525,7 +1526,8 @@ static short getSubnet(JNIEnv *env, int
+
+
+
+-#define DEV_PREFIX "/dev/"
++#define NET_DEV_PREFIX "/dev/"
++#define ZONE_NET_DEV_PREFIX "/dev/net/"
+
+ /**
+ * Solaris specific DLPI code to get hardware address from a device.
+@@ -1542,11 +1544,18 @@ static int getMacFromDevice(JNIEnv *env,
+ int flags = 0;
+
+ /**
+- * Device is in /dev
++ * Device is in /dev in global zone / standalone
+ * e.g.: /dev/bge0
++ * Device is in /dev/net in a zone
++ * e.g.: /dev/net/net0
+ */
+- strcpy(style1dev, DEV_PREFIX);
++ if (getzoneid()==(zoneid_t)GLOBAL_ZONEID) {
++ strcpy(style1dev, NET_DEV_PREFIX);
++ } else {
++ strcpy(style1dev, ZONE_NET_DEV_PREFIX);
++ }
+ strcat(style1dev, ifname);
++
+ if ((fd = open(style1dev, O_RDWR)) < 0) {
+ /*
+ * Can't open it. We probably are missing the privilege.
diff --git a/lang/openjdk7/patches/patch-jdk_src_solaris_native_sun_awt_X11Color.c b/lang/openjdk7/patches/patch-jdk_src_solaris_native_sun_awt_X11Color.c
new file mode 100644
index 00000000000..e6b99e879aa
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_src_solaris_native_sun_awt_X11Color.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_src_solaris_native_sun_awt_X11Color.c,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Casting.
+
+--- jdk/src/solaris/native/sun/awt/X11Color.c.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/src/solaris/native/sun/awt/X11Color.c
+@@ -119,7 +119,7 @@ int getVirtCubeSize() {
+ return LOOKUPSIZE;
+ }
+
+- for (i = 0; i < MACHMAPSIZE; i++) {
++ for (i = 0; i < (int)MACHMAPSIZE; i++) {
+ if (strcmp(name.machine, machinemap[i].machine) == 0) {
+ #ifdef DEBUG
+ if (debug_colormap) {
diff --git a/lang/openjdk7/patches/patch-jdk_test_Makefile b/lang/openjdk7/patches/patch-jdk_test_Makefile
new file mode 100644
index 00000000000..7c03b4c7741
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_test_Makefile
@@ -0,0 +1,28 @@
+$NetBSD: patch-jdk_test_Makefile,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Use tools from pkgsrc.
+
+--- jdk/test/Makefile.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/test/Makefile
+@@ -54,6 +54,8 @@ UNAME = uname
+ UNIQ = uniq
+ WC = wc
+ ZIP = zip
++UNZIP = unzip
++WHICH = which
+
+ # Get OS name from uname
+ UNAME_S := $(shell $(UNAME) -s)
+@@ -376,6 +378,12 @@ else
+ JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
+ endif
+
++# carry over XAUTHORITY
++JTREG_TEST_OPTIONS += -e:XAUTHORITY
++
++# some tests expect to find zip and unzip on the path
++JTREG_TEST_OPTIONS += -e:PATH=/bin:/usr/bin:$(dir $(shell $(WHICH) $(ZIP))):$(dir $(shell $(WHICH) $(UNZIP)))
++
+ ifdef CONCURRENCY
+ EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
+ endif
diff --git a/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4168475_Test4168475.java b/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4168475_Test4168475.java
new file mode 100644
index 00000000000..de3a8c688c8
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4168475_Test4168475.java
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_test_java_beans_Introspector_4168475_Test4168475.java,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Test fixes.
+
+--- jdk/test/java/beans/Introspector/4168475/Test4168475.java.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/test/java/beans/Introspector/4168475/Test4168475.java
+@@ -41,6 +41,8 @@ public class Test4168475 {
+ private static final String[] PATH = {"infos"};
+
+ public static void main(String[] args) throws IntrospectionException {
++ // running under jtreg -agentvm: system classloader can't find this class (separate classloader?)
++ Thread.currentThread().setContextClassLoader(Test4168475.class.getClassLoader());
+ Introspector.setBeanInfoSearchPath(PATH);
+ BeanInfo info = Introspector.getBeanInfo(Component.class);
+ PropertyDescriptor[] pds = info.getPropertyDescriptors();
diff --git a/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4520754_Test4520754.java b/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4520754_Test4520754.java
new file mode 100644
index 00000000000..3da1d4c4c18
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_4520754_Test4520754.java
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_test_java_beans_Introspector_4520754_Test4520754.java,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Test fixes.
+
+--- jdk/test/java/beans/Introspector/4520754/Test4520754.java.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/test/java/beans/Introspector/4520754/Test4520754.java
+@@ -56,6 +56,8 @@ public class Test4520754 {
+ };
+
+ public static void main(String[] args) {
++ // running under jtreg -agentvm: system classloader can't find this class (separate classloader?)
++ Thread.currentThread().setContextClassLoader(Test4520754.class.getClassLoader());
+ // ensure that 4168475 does not regress
+ test4168475(Component.class);
+ // AWT classes (com.sun.beans.infos.ComponentBeanInfo)
diff --git a/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_Test4144543.java b/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_Test4144543.java
new file mode 100644
index 00000000000..7beb19c5abe
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_test_java_beans_Introspector_Test4144543.java
@@ -0,0 +1,16 @@
+$NetBSD: patch-jdk_test_java_beans_Introspector_Test4144543.java,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Test fixes.
+
+--- jdk/test/java/beans/Introspector/Test4144543.java.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/test/java/beans/Introspector/Test4144543.java
+@@ -34,7 +34,8 @@ import java.beans.PropertyDescriptor;
+
+ public class Test4144543 {
+ public static void main(String[] args) throws Exception {
+- Class type = Beans.instantiate(null, "Test4144543").getClass();
++ // running under jtreg -agentvm: system classloader can't find this class (separate classloader?)
++ Class type = Beans.instantiate(Test4144543.class.getClassLoader(), "Test4144543").getClass();
+
+ // try all the various places that this would break before
+
diff --git a/lang/openjdk7/patches/patch-jdk_test_java_lang_management_OperatingSystemMXBean_GetSystemLoadAverage.java b/lang/openjdk7/patches/patch-jdk_test_java_lang_management_OperatingSystemMXBean_GetSystemLoadAverage.java
new file mode 100644
index 00000000000..9ee700d1191
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_test_java_lang_management_OperatingSystemMXBean_GetSystemLoadAverage.java
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_test_java_lang_management_OperatingSystemMXBean_GetSystemLoadAverage.java,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Test fixes.
+
+--- jdk/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java
+@@ -103,6 +103,8 @@ public class GetSystemLoadAverage {
+ ? output.split(" ")
+ : output.split(",");
+ double expected = Double.parseDouble(lavg[0]);
++ // round to value to two decimals; some OSes report more (SmartOS at least)
++ expected = 0.01D * Math.round(expected / 0.01D);
+ double lowRange = expected * (1 - DELTA);
+ double highRange = expected * (1 + DELTA);
+
diff --git a/lang/openjdk7/patches/patch-jdk_test_sun_security_ec_TestEC.java b/lang/openjdk7/patches/patch-jdk_test_sun_security_ec_TestEC.java
new file mode 100644
index 00000000000..e169c78c2c0
--- /dev/null
+++ b/lang/openjdk7/patches/patch-jdk_test_sun_security_ec_TestEC.java
@@ -0,0 +1,15 @@
+$NetBSD: patch-jdk_test_sun_security_ec_TestEC.java,v 1.1 2013/06/15 09:31:06 jperkin Exp $
+
+Test fixes.
+
+--- jdk/test/sun/security/ec/TestEC.java.orig 2013-02-20 17:07:30.000000000 +0000
++++ jdk/test/sun/security/ec/TestEC.java
+@@ -82,7 +82,7 @@ public class TestEC {
+ // ClientJSSEServerJSSE fails on Solaris 11 when both SunEC and
+ // SunPKCS11-Solaris providers are enabled.
+ // Workaround:
+- // Security.removeProvider("SunPKCS11-Solaris");
++ Security.removeProvider("SunPKCS11-Solaris");
+ new ClientJSSEServerJSSE().main(p);
+
+ long stop = System.currentTimeMillis();