aboutsummaryrefslogtreecommitdiffstats
path: root/java/jdk16/files
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2007-05-26 02:44:27 +0800
committerjkim <jkim@FreeBSD.org>2007-05-26 02:44:27 +0800
commit588cf2989b059e767186e9f989398c0ebd8c1ee3 (patch)
tree430639422181c3160fc9253bab5a7057830909cb /java/jdk16/files
parent266f7723493758483b50c67a577d3b7c1a805f10 (diff)
downloadfreebsd-ports-gnome-588cf2989b059e767186e9f989398c0ebd8c1ee3.tar.gz
freebsd-ports-gnome-588cf2989b059e767186e9f989398c0ebd8c1ee3.tar.zst
freebsd-ports-gnome-588cf2989b059e767186e9f989398c0ebd8c1ee3.zip
Various fixes for -CURRENT.
- Build fixes after GCC 4.2 import. - Remove SIGRTMIN and SIGRTMAX redefinitions. - Use posix_memalign(3) instead of valloc(3). Approved by: glewis (maintainer)
Diffstat (limited to 'java/jdk16/files')
-rw-r--r--java/jdk16/files/patch-hotspot::amd64::vm::amd64.ad13
-rw-r--r--java/jdk16/files/patch-hotspot::amd64::vm::frame_amd64.hpp9
-rw-r--r--java/jdk16/files/patch-hotspot::amd64::vm::interpreter_amd64.hpp16
-rw-r--r--java/jdk16/files/patch-hotspot::amd64::vm::register_amd64.hpp38
-rw-r--r--java/jdk16/files/patch-hotspot::amd64::vm::templateTable_amd64.cpp11
-rw-r--r--java/jdk16/files/patch-hotspot::bsd::vm::jvm_bsd.h15
-rw-r--r--java/jdk16/files/patch-hotspot::bsd::vm::osThread_bsd.hpp11
-rw-r--r--java/jdk16/files/patch-hotspot::bsd_amd64::vm::os_bsd_amd64.cpp22
-rw-r--r--java/jdk16/files/patch-hotspot::bsd_amd64::vm::threadLS_bsd_amd64.hpp11
-rw-r--r--java/jdk16/files/patch-hotspot::bsd_i486::vm::os_bsd_i486.cpp22
-rw-r--r--java/jdk16/files/patch-hotspot::bsd_i486::vm::threadLS_bsd_i486.hpp11
-rw-r--r--java/jdk16/files/patch-hotspot::i486::vm::i486.ad14
-rw-r--r--java/jdk16/files/patch-hotspot::i486::vm::register_i486.hpp26
-rw-r--r--java/jdk16/files/patch-hotspot::i486::vm::templateTable_i486.cpp11
-rw-r--r--java/jdk16/files/patch-hotspot::share::vm::bytecodeTracer.cpp26
-rw-r--r--java/jdk16/files/patch-j2se::awt::mlib_sys.c22
-rw-r--r--java/jdk16/files/patch-j2se::bin::java_md.c21
-rw-r--r--java/jdk16/files/patch-j2se::hpi::memory_md.c30
-rw-r--r--java/jdk16/files/patch-j2se::jar::main.cpp14
-rw-r--r--java/jdk16/files/patch-j2se::jdbc::Makefile15
-rw-r--r--java/jdk16/files/patch-j2se::sound::HAE_API_BSDOS.c27
21 files changed, 385 insertions, 0 deletions
diff --git a/java/jdk16/files/patch-hotspot::amd64::vm::amd64.ad b/java/jdk16/files/patch-hotspot::amd64::vm::amd64.ad
new file mode 100644
index 000000000000..dbf43fe16d5e
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::amd64::vm::amd64.ad
@@ -0,0 +1,13 @@
+--- ../../hotspot/src/cpu/amd64/vm/amd64.ad.orig Thu May 24 15:27:42 2007
++++ ../../hotspot/src/cpu/amd64/vm/amd64.ad Thu May 24 17:15:10 2007
+@@ -662,8 +662,8 @@
+ {
+ #ifdef ASSERT
+ if (rspec.reloc()->type() == relocInfo::oop_type &&
+- d32 != 0 && d32 != (int) Universe::non_oop_word()) {
+- assert(oop(d32)->is_oop() && oop(d32)->is_perm(), "cannot embed non-perm oops in code");
++ d32 != 0 && d32 != (intptr_t) Universe::non_oop_word()) {
++ assert(oop((intptr_t)d32)->is_oop() && oop((intptr_t)d32)->is_perm(), "cannot embed non-perm oops in code");
+ }
+ #endif
+ cbuf.relocate(cbuf.mark(), rspec, format);
diff --git a/java/jdk16/files/patch-hotspot::amd64::vm::frame_amd64.hpp b/java/jdk16/files/patch-hotspot::amd64::vm::frame_amd64.hpp
new file mode 100644
index 000000000000..77bd14b2ea9e
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::amd64::vm::frame_amd64.hpp
@@ -0,0 +1,9 @@
+--- ../../hotspot/src/cpu/amd64/vm/frame_amd64.hpp.orig Tue Oct 19 14:41:26 2004
++++ ../../hotspot/src/cpu/amd64/vm/frame_amd64.hpp Thu May 24 15:55:55 2007
+@@ -125,5 +125,5 @@
+ inline address* sender_pc_addr() const;
+
+ // return address of param, zero origin index.
+- inline address* frame::native_param_addr(int idx) const;
++ inline address* native_param_addr(int idx) const;
+
diff --git a/java/jdk16/files/patch-hotspot::amd64::vm::interpreter_amd64.hpp b/java/jdk16/files/patch-hotspot::amd64::vm::interpreter_amd64.hpp
new file mode 100644
index 000000000000..0bd8ed438688
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::amd64::vm::interpreter_amd64.hpp
@@ -0,0 +1,16 @@
+--- ../../hotspot/src/cpu/amd64/vm/interpreter_amd64.hpp.orig Tue Oct 19 14:41:27 2004
++++ ../../hotspot/src/cpu/amd64/vm/interpreter_amd64.hpp Thu May 24 16:11:07 2007
+@@ -53,11 +53,11 @@
+ void generate_stack_overflow_check(void);
+
+ #ifndef CORE
+- void InterpreterGenerator::generate_counter_incr(
++ void generate_counter_incr(
+ Label* overflow,
+ Label* profile_method,
+ Label* profile_method_continue);
+- void InterpreterGenerator::generate_counter_overflow(address entry_point);
++ void generate_counter_overflow(address entry_point);
+ void generate_run_compiled_code(void);
+ void check_for_compiled_code(Label & run_compiled_code);
+ #endif
diff --git a/java/jdk16/files/patch-hotspot::amd64::vm::register_amd64.hpp b/java/jdk16/files/patch-hotspot::amd64::vm::register_amd64.hpp
new file mode 100644
index 000000000000..f4ebe6b17e62
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::amd64::vm::register_amd64.hpp
@@ -0,0 +1,38 @@
+--- ../../hotspot/src/cpu/amd64/vm/register_amd64.hpp.orig Tue Oct 19 14:41:27 2004
++++ ../../hotspot/src/cpu/amd64/vm/register_amd64.hpp Thu May 24 15:50:42 2007
+@@ -28,17 +28,17 @@
+ int encoding() const
+ {
+ assert(is_valid(), "invalid register");
+- return (int) this;
++ return value();
+ }
+
+ bool is_valid() const
+ {
+- return 0 <= (int) this && (int) this < number_of_registers;
++ return 0 <= value() && value() < number_of_registers;
+ }
+
+ bool has_byte_register() const
+ {
+- return 0 <= (int) this && (int)this < number_of_byte_registers;
++ return 0 <= value() && value() < number_of_byte_registers;
+ }
+
+ const char* name() const;
+@@ -92,12 +92,12 @@
+ int encoding() const
+ {
+ assert(is_valid(), "invalid fp register");
+- return (int) this;
++ return value();
+ }
+
+ bool is_valid() const
+ {
+- return 0 <= (int) this && (int) this < number_of_registers;
++ return 0 <= value() && value() < number_of_registers;
+ }
+
+ const char* name() const;
diff --git a/java/jdk16/files/patch-hotspot::amd64::vm::templateTable_amd64.cpp b/java/jdk16/files/patch-hotspot::amd64::vm::templateTable_amd64.cpp
new file mode 100644
index 000000000000..9e975618a271
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::amd64::vm::templateTable_amd64.cpp
@@ -0,0 +1,11 @@
+--- ../../hotspot/src/cpu/amd64/vm/templateTable_amd64.cpp.orig Tue Oct 19 14:41:28 2004
++++ ../../hotspot/src/cpu/amd64/vm/templateTable_amd64.cpp Thu May 24 16:34:33 2007
+@@ -3266,7 +3266,7 @@
+ // initialize object header only.
+ __ bind(initialize_header);
+ __ movq(Address(rax, oopDesc::mark_offset_in_bytes()),
+- (int) markOopDesc::prototype()); // header (address 0x1)
++ (intptr_t) markOopDesc::prototype()); // header (address 0x1)
+ __ movq(Address(rax, oopDesc::klass_offset_in_bytes()), rarg1); // klass
+ __ jmp(done);
+
diff --git a/java/jdk16/files/patch-hotspot::bsd::vm::jvm_bsd.h b/java/jdk16/files/patch-hotspot::bsd::vm::jvm_bsd.h
new file mode 100644
index 000000000000..b5c3ea0695c6
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::bsd::vm::jvm_bsd.h
@@ -0,0 +1,15 @@
+--- ../../hotspot/src/os/bsd/vm/jvm_bsd.h.orig Fri May 25 14:04:51 2007
++++ ../../hotspot/src/os/bsd/vm/jvm_bsd.h Fri May 25 14:04:14 2007
+@@ -78,8 +78,12 @@
+ #define ALT_ASYNC_SIGNAL ALT_INTERRUPT_SIGNAL+1 /* alternate async signal */
+
+ /* XXXBSD: compat? */
++#ifndef SIGRTMIN
+ #define SIGRTMIN 33
++#endif
++#ifndef SIGRTMAX
+ #define SIGRTMAX 63
++#endif
+
+ /* With 1.4.1 libjsig added versioning: used in os_bsd.cpp and jsig.c */
+ #define JSIG_VERSION_1_4_1 0x30140100
diff --git a/java/jdk16/files/patch-hotspot::bsd::vm::osThread_bsd.hpp b/java/jdk16/files/patch-hotspot::bsd::vm::osThread_bsd.hpp
new file mode 100644
index 000000000000..ae78d2f6f45b
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::bsd::vm::osThread_bsd.hpp
@@ -0,0 +1,11 @@
+--- ../../hotspot/src/os/bsd/vm/osThread_bsd.hpp.orig Thu May 24 16:50:49 2007
++++ ../../hotspot/src/os/bsd/vm/osThread_bsd.hpp Thu May 24 16:51:16 2007
+@@ -28,7 +28,7 @@
+
+ #ifndef PRODUCT
+ // Used for debugging, return a unique integer for each thread.
+- int thread_identifier() const { return (int)_thread_id; }
++ int thread_identifier() const { return (int)(intptr_t)_thread_id; }
+ #endif
+ #ifdef ASSERT
+ // On solaris reposition can fail in two ways:
diff --git a/java/jdk16/files/patch-hotspot::bsd_amd64::vm::os_bsd_amd64.cpp b/java/jdk16/files/patch-hotspot::bsd_amd64::vm::os_bsd_amd64.cpp
new file mode 100644
index 000000000000..ec8870613cd0
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::bsd_amd64::vm::os_bsd_amd64.cpp
@@ -0,0 +1,22 @@
+--- ../../hotspot/src/os_cpu/bsd_amd64/vm/os_bsd_amd64.cpp.orig Thu May 24 15:27:42 2007
++++ ../../hotspot/src/os_cpu/bsd_amd64/vm/os_bsd_amd64.cpp Thu May 24 16:26:52 2007
+@@ -255,15 +255,15 @@
+ // success, if not we return failure and the caller can retry.
+ //
+ _result = false;
+- if (uc->context_rip == (int)_old_addr.pc() ) {
+- uc->context_rip = (int)_new_addr.pc();
++ if (uc->context_rip == (intptr_t)_old_addr.pc() ) {
++ uc->context_rip = (intptr_t)_new_addr.pc();
+ _result = true;
+ #ifndef __OpenBSD__
+ } else if (uc->uc_link != NULL) {
+ // Check (and validate) one level of stacked ucontext
+ ucontext_t* linked_uc = uc->uc_link;
+- if (os::Bsd::valid_ucontext(thread, uc, linked_uc) && linked_uc->context_rip == (int)_old_addr.pc()) {
+- linked_uc->context_rip = (int)_new_addr.pc();
++ if (os::Bsd::valid_ucontext(thread, uc, linked_uc) && linked_uc->context_rip == (intptr_t)_old_addr.pc()) {
++ linked_uc->context_rip = (intptr_t)_new_addr.pc();
+ _result = true;
+ }
+ #endif
diff --git a/java/jdk16/files/patch-hotspot::bsd_amd64::vm::threadLS_bsd_amd64.hpp b/java/jdk16/files/patch-hotspot::bsd_amd64::vm::threadLS_bsd_amd64.hpp
new file mode 100644
index 000000000000..b0b0338a23cd
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::bsd_amd64::vm::threadLS_bsd_amd64.hpp
@@ -0,0 +1,11 @@
+--- ../../hotspot/src/os_cpu/bsd_amd64/vm/threadLS_bsd_amd64.hpp.orig Thu May 24 15:27:42 2007
++++ ../../hotspot/src/os_cpu/bsd_amd64/vm/threadLS_bsd_amd64.hpp Thu May 24 16:01:24 2007
+@@ -33,7 +33,7 @@
+
+ static uintptr_t pd_raw_thread_id() {
+ address sp = pd_sp_address();
+- return (unsigned int)sp / _pd_min_page_size;
++ return (uintptr_t) sp / _pd_min_page_size;
+ }
+
+ static int pd_cache_index(uintptr_t sp_page) {
diff --git a/java/jdk16/files/patch-hotspot::bsd_i486::vm::os_bsd_i486.cpp b/java/jdk16/files/patch-hotspot::bsd_i486::vm::os_bsd_i486.cpp
new file mode 100644
index 000000000000..aba5bec91b3c
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::bsd_i486::vm::os_bsd_i486.cpp
@@ -0,0 +1,22 @@
+--- ../../hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp.orig Thu May 24 15:27:43 2007
++++ ../../hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp Thu May 24 19:54:47 2007
+@@ -238,15 +238,15 @@
+ // success, if not we return failure and the caller can retry.
+ //
+ _result = false;
+- if (uc->context_eip == (int)_old_addr.pc() ) {
+- uc->context_eip = (int)_new_addr.pc();
++ if (uc->context_eip == (intptr_t)_old_addr.pc() ) {
++ uc->context_eip = (intptr_t)_new_addr.pc();
+ _result = true;
+ #ifndef __OpenBSD__
+ } else if (uc->uc_link != NULL) {
+ // Check (and validate) one level of stacked ucontext
+ ucontext_t* linked_uc = uc->uc_link;
+- if (os::Bsd::valid_ucontext(thread, uc, linked_uc) && linked_uc->context_eip == (int)_old_addr.pc()) {
+- linked_uc->context_eip = (int)_new_addr.pc();
++ if (os::Bsd::valid_ucontext(thread, uc, linked_uc) && linked_uc->context_eip == (intptr_t)_old_addr.pc()) {
++ linked_uc->context_eip = (intptr_t)_new_addr.pc();
+ _result = true;
+ }
+ }
diff --git a/java/jdk16/files/patch-hotspot::bsd_i486::vm::threadLS_bsd_i486.hpp b/java/jdk16/files/patch-hotspot::bsd_i486::vm::threadLS_bsd_i486.hpp
new file mode 100644
index 000000000000..318514b0dd80
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::bsd_i486::vm::threadLS_bsd_i486.hpp
@@ -0,0 +1,11 @@
+--- ../../hotspot/src/os_cpu/bsd_i486/vm/threadLS_bsd_i486.hpp.orig Thu May 24 15:27:43 2007
++++ ../../hotspot/src/os_cpu/bsd_i486/vm/threadLS_bsd_i486.hpp Thu May 24 19:43:59 2007
+@@ -33,7 +33,7 @@
+
+ static uintptr_t pd_raw_thread_id() {
+ address sp = pd_sp_address();
+- return (unsigned int)sp / _pd_min_page_size;
++ return (uintptr_t) sp / _pd_min_page_size;
+ }
+
+ static int pd_cache_index(uintptr_t sp_page) {
diff --git a/java/jdk16/files/patch-hotspot::i486::vm::i486.ad b/java/jdk16/files/patch-hotspot::i486::vm::i486.ad
new file mode 100644
index 000000000000..e0d91e628a78
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::i486::vm::i486.ad
@@ -0,0 +1,14 @@
+--- ../../hotspot/src/cpu/i486/vm/i486.ad.orig Thu May 24 15:27:42 2007
++++ ../../hotspot/src/cpu/i486/vm/i486.ad Thu May 24 19:47:30 2007
+@@ -383,8 +383,9 @@
+ void emit_d32_reloc(CodeBuffer &cbuf, int d32, RelocationHolder const& rspec,
+ int format) {
+ #ifdef ASSERT
+- if (rspec.reloc()->type() == relocInfo::oop_type && d32 != 0 && d32 != (int)Universe::non_oop_word()) {
+- assert(oop(d32)->is_oop() && oop(d32)->is_perm(), "cannot embed non-perm oops in code");
++ if (rspec.reloc()->type() == relocInfo::oop_type &&
++ d32 != 0 && d32 != (intptr_t)Universe::non_oop_word()) {
++ assert(oop((intptr_t)d32)->is_oop() && oop((intptr_t)d32)->is_perm(), "cannot embed non-perm oops in code");
+ }
+ #endif
+ cbuf.relocate(cbuf.mark(), rspec, format);
diff --git a/java/jdk16/files/patch-hotspot::i486::vm::register_i486.hpp b/java/jdk16/files/patch-hotspot::i486::vm::register_i486.hpp
new file mode 100644
index 000000000000..c033d064c7a6
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::i486::vm::register_i486.hpp
@@ -0,0 +1,26 @@
+--- ../../hotspot/src/cpu/i486/vm/register_i486.hpp.orig Thu May 24 15:27:42 2007
++++ ../../hotspot/src/cpu/i486/vm/register_i486.hpp Thu May 24 19:51:43 2007
+@@ -24,9 +24,9 @@
+ static Register as_Register(int encoding) { return (Register)encoding; }
+
+ // accessors
+- int encoding() const { assert(is_valid(), "invalid register"); return (int)this; }
+- bool is_valid() const { return 0 <= (int)this && (int)this < number_of_registers; }
+- bool has_byte_register() const { return 0 <= (int)this && (int)this < number_of_byte_registers; }
++ int encoding() const { assert(is_valid(), "invalid register"); return value(); }
++ bool is_valid() const { return 0 <= value() && value() < number_of_registers; }
++ bool has_byte_register() const { return 0 <= value() && value() < number_of_byte_registers; }
+ const char* name() const;
+ };
+
+@@ -74,8 +74,8 @@
+ friend XMMRegister as_XMMRegister(int encoding) { return (XMMRegister)encoding; }
+
+ // accessors
+- int encoding() const { assert(is_valid(), "invalid register"); return (int)this; }
+- bool is_valid() const { return 0 <= (int)this && (int)this < number_of_registers; }
++ int encoding() const { assert(is_valid(), "invalid register"); return value(); }
++ bool is_valid() const { return 0 <= value() && value() < number_of_registers; }
+ const char* name() const;
+ };
+
diff --git a/java/jdk16/files/patch-hotspot::i486::vm::templateTable_i486.cpp b/java/jdk16/files/patch-hotspot::i486::vm::templateTable_i486.cpp
new file mode 100644
index 000000000000..5dbc0e85eb84
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::i486::vm::templateTable_i486.cpp
@@ -0,0 +1,11 @@
+--- ../../hotspot/src/cpu/i486/vm/templateTable_i486.cpp.orig Tue Oct 19 14:41:33 2004
++++ ../../hotspot/src/cpu/i486/vm/templateTable_i486.cpp Thu May 24 19:53:09 2007
+@@ -2987,7 +2987,7 @@
+ // initialize object header only.
+ __ bind(initialize_header);
+ __ movl(Address(eax, oopDesc::mark_offset_in_bytes ()),
+- (int)markOopDesc::prototype()); // header
++ (intptr_t) markOopDesc::prototype()); // header
+ __ popl(ecx); // get saved klass back in the register.
+ __ movl(Address(eax, oopDesc::klass_offset_in_bytes()), ecx); // klass
+ __ jmp(done);
diff --git a/java/jdk16/files/patch-hotspot::share::vm::bytecodeTracer.cpp b/java/jdk16/files/patch-hotspot::share::vm::bytecodeTracer.cpp
new file mode 100644
index 000000000000..e98f0b8563ae
--- /dev/null
+++ b/java/jdk16/files/patch-hotspot::share::vm::bytecodeTracer.cpp
@@ -0,0 +1,26 @@
+--- ../../hotspot/src/share/vm/interpreter/bytecodeTracer.cpp.orig Tue Oct 19 14:42:10 2004
++++ ../../hotspot/src/share/vm/interpreter/bytecodeTracer.cpp Thu May 24 17:28:49 2007
+@@ -51,7 +51,11 @@
+ // Note 1: This code will not work as expected with true MT/MP.
+ // Need an explicit lock or a different solution.
+ tty->cr();
++#if defined(_ALLBSD_SOURCE)
++ tty->print("[%ld] ", (intptr_t) Thread::current()->osthread()->thread_id());
++#else
+ tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
++#endif
+ method->print_name(tty);
+ tty->cr();
+ _current_method = method();
+@@ -64,7 +68,11 @@
+ code = Bytecodes::cast(*bcp);
+ }
+ int bci = bcp - method->code_base();
++#if defined(_ALLBSD_SOURCE)
++ tty->print("[%ld] ", (intptr_t) Thread::current()->osthread()->thread_id());
++#else
+ tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
++#endif
+ if (Verbose) {
+ tty->print("%8d %4d " INTPTR_FORMAT " " INTPTR_FORMAT " %s",
+ BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
diff --git a/java/jdk16/files/patch-j2se::awt::mlib_sys.c b/java/jdk16/files/patch-j2se::awt::mlib_sys.c
new file mode 100644
index 000000000000..6f8d8f809011
--- /dev/null
+++ b/java/jdk16/files/patch-j2se::awt::mlib_sys.c
@@ -0,0 +1,22 @@
+--- ../../j2se/src/share/native/sun/awt/medialib/mlib_sys.c
++++ ../../j2se/src/share/native/sun/awt/medialib/mlib_sys.c
+@@ -15,6 +15,9 @@
+ #include <mlib_types.h>
+ #include <mlib_sys_proto.h>
+ #include "mlib_SysMath.h"
++#if defined(_ALLBSD_SOURCE)
++#include <sys/param.h>
++#endif
+
+ /***************************************************************/
+
+@@ -72,6 +75,9 @@
+ * alignment. -- from stdlib.h of MS VC++5.0.
+ */
+ return (void *) malloc(size);
++#elif defined(__FreeBSD__) && (__FreeBSD_version >= 700013)
++ void *ret;
++ return posix_memalign(&ret, 8, size) ? NULL : ret;
+ #elif defined(_ALLBSD_SOURCE)
+ return valloc(size);
+ #else
diff --git a/java/jdk16/files/patch-j2se::bin::java_md.c b/java/jdk16/files/patch-j2se::bin::java_md.c
new file mode 100644
index 000000000000..44bcce094433
--- /dev/null
+++ b/java/jdk16/files/patch-j2se::bin::java_md.c
@@ -0,0 +1,21 @@
+--- ../../j2se/src/solaris/bin/java_md.c.orig Thu May 24 19:15:46 2007
++++ ../../j2se/src/solaris/bin/java_md.c Thu May 24 19:14:59 2007
+@@ -1061,7 +1061,8 @@
+ #if defined(_ALLBSD_SOURCE)
+
+ uint64_t result;
+- int mib[2], rlen;
++ int mib[2];
++ size_t rlen;
+
+ /* fetch sysctl(hw.physmem) value */
+ mib[0] = CTL_HW;
+@@ -1635,7 +1636,7 @@
+ while (dp != NULL) {
+ cp = strchr(dp, (int)':');
+ if (cp != NULL)
+- *cp = (char)NULL;
++ *cp = '\0';
+ if ((target = ProcessDir(info, dp)) != NULL)
+ break;
+ dp = cp;
diff --git a/java/jdk16/files/patch-j2se::hpi::memory_md.c b/java/jdk16/files/patch-j2se::hpi::memory_md.c
new file mode 100644
index 000000000000..3b2b85b2c8bb
--- /dev/null
+++ b/java/jdk16/files/patch-j2se::hpi::memory_md.c
@@ -0,0 +1,30 @@
+--- ../../j2se/src/solaris/hpi/src/memory_md.c
++++ ../../j2se/src/solaris/hpi/src/memory_md.c
+@@ -32,7 +32,9 @@
+ #include <stdlib.h>
+ #include <stdio.h> /* For perror() */
+ #include <string.h>
+-#if !defined(_ALLBSD_SOURCE)
++#if defined(_ALLBSD_SOURCE)
++#include <sys/param.h>
++#else
+ #include <malloc.h>
+ #endif
+
+@@ -67,7 +69,16 @@
+ static size_t memGrainSize; /* A page for Linux */
+ #elif defined(_ALLBSD_SOURCE)
+ static size_t memGrainSize; /* A page for FreeBSD */
++#if defined(__FreeBSD__) && (__FreeBSD_version >= 700013)
++static inline void *
++memalign(size_t alignment, size_t size)
++{
++ void *ret;
++ return posix_memalign(&ret, alignment, size) ? NULL : ret;
++}
++#else
+ #define memalign(a, b) valloc(b)
++#endif
+ #else
+ static unsigned int memGrainSize; /* A page for Solaris */
+ #endif
diff --git a/java/jdk16/files/patch-j2se::jar::main.cpp b/java/jdk16/files/patch-j2se::jar::main.cpp
new file mode 100644
index 000000000000..99b0ae464f9e
--- /dev/null
+++ b/java/jdk16/files/patch-j2se::jar::main.cpp
@@ -0,0 +1,14 @@
+--- ../../j2se/src/share/native/com/sun/java/util/jar/pack/main.cpp.orig Tue Oct 19 14:59:48 2004
++++ ../../j2se/src/share/native/com/sun/java/util/jar/pack/main.cpp Thu May 24 18:46:10 2007
+@@ -17,7 +17,11 @@
+
+ #if defined(unix) && !defined(PRODUCT)
+ #include "pthread.h"
++#if defined(_ALLBSD_SOURCE)
++#define THREAD_SELF ((jlong)pthread_self())
++#else
+ #define THREAD_SELF ((int)pthread_self())
++#endif
+ #endif
+
+ #include "defines.h"
diff --git a/java/jdk16/files/patch-j2se::jdbc::Makefile b/java/jdk16/files/patch-j2se::jdbc::Makefile
new file mode 100644
index 000000000000..030e39449e8b
--- /dev/null
+++ b/java/jdk16/files/patch-j2se::jdbc::Makefile
@@ -0,0 +1,15 @@
+--- ../../j2se/make/sun/jdbc/Makefile.orig Thu May 24 15:27:43 2007
++++ ../../j2se/make/sun/jdbc/Makefile Thu May 24 18:28:12 2007
+@@ -89,10 +89,10 @@
+ make_libs: $(TMPDIR)/libodbcinst.so $(TMPDIR)/libodbc.so
+
+ $(TMPDIR)/libodbcinst.so: dummyodbc.c $(TMPDIR)
+- $(CC) -shared -o $@ $<
++ $(CC) -shared -fPIC -o $@ $<
+
+ $(TMPDIR)/libodbc.so: dummyodbc.c $(TMPDIR)
+- $(CC) -shared -o $@ $<
++ $(CC) -shared -fPIC -o $@ $<
+
+ clean::
+ $(RM) -f $(TMPDIR)/libodbcinst.so $(TMPDIR)/libodbc.so
diff --git a/java/jdk16/files/patch-j2se::sound::HAE_API_BSDOS.c b/java/jdk16/files/patch-j2se::sound::HAE_API_BSDOS.c
new file mode 100644
index 000000000000..44d92bdc4725
--- /dev/null
+++ b/java/jdk16/files/patch-j2se::sound::HAE_API_BSDOS.c
@@ -0,0 +1,27 @@
+--- ../../j2se/src/solaris/native/com/sun/media/sound/engine/HAE_API_BSDOS.c
++++ ../../j2se/src/solaris/native/com/sun/media/sound/engine/HAE_API_BSDOS.c
+@@ -42,6 +42,7 @@
+ #include <errno.h>
+
+ #ifdef __FreeBSD__
++#include <sys/param.h>
+ #include <sys/soundcard.h>
+ #endif
+ #if defined(__NetBSD__) || defined(__OpenBSD__)
+@@ -67,7 +68,16 @@
+ #define FALSE 0
+ #endif
+
++#if defined(__FreeBSD__) && (__FreeBSD_version >= 700013)
++static inline void *
++memalign(size_t alignment, size_t size)
++{
++ void *ret;
++ return posix_memalign(&ret, alignment, size) ? NULL : ret;
++}
++#else
+ #define memalign(a, b) valloc(b)
++#endif
+
+ // How many audio frames to generate at one time
+ #define HAE_BSD_FRAMES_PER_BLOCK 8