openjdk6 patch and install

Brian Gardner brian at experts-exchange.com
Fri Jan 30 13:09:01 PST 2009


Hello fellow BSD lovers,
I've created a patch process for patching openjdk6 for BSD (FreeBSD 
specifically), although I tried to keep all BSD versions in mind when 
creating my patch. 

http://beta.experts-exchange.com/articles/OS/Unix/BSD/Patch-for-OpenJDK6-on-BSD.html#top

Welcome to OpenJDK6 on BSD

First let me start with a little background on why I chose to port 
openjdk6, and then I'll discuss the process I took to do it.  I work for 
Experts Exchange recently we decided to move from Linux to FreeBSD.  
This decision came after a comprehensive test involving Linux, FreeBSD, 
and Solaris 10.  FreeBSD blew the others away doubling the performance 
of Linux and outperforming Solaris 10 by a significant margin as well.  
We have come across several issues with the port java/jdk16, including 
lack of jmap functionality to track down memory errors and instability 
running the CMS garbage collector with a heap over 2G.  I created the a 
patch to bring jmap functionality to java/jdk16.  My next task was to 
begin hardening the VM, however it hardly makes sense to work on 
java/jdk16, because it's missing lots of bugs fixes from sun.  openjdk7 
looked like the next choice to try and I compiled it up and gave it a 
try, however a third party library/software I was using didn't work and 
upon talking with terracotta developers they had no plans to support 
openjdk7 in the future.  I researched what exactly openjdk6 was and 
decided to give it a try.


How did I perform the Port

I started by duplicating jdk6 to bsd-port6.  Then I take the difference 
between jdk7 and bsd-port and import them.  I had trouble using patch 
-Nu jdk7 bsd-port because there were new files that contained long lines 
that patch complained about.  I whipped up a quick perl script to 
compare the directories and create the 
jdk7_bsd_changes_20090126.newfiles and jdk7_bsd_changes_20090126.patches 
directories.  Any file the was brand new to bsd-port was copied into 
jdk7_bsd_changes_20090126.newfiles to avoid the patch issue with long 
lines.  jdk7_bsd_changes_20090126.patches contains a separate patch for 
each file the was changed between jdk7 and bsd-port.  Not all of these 
patches applied cleanly so I then went through about 40 .rej files and 
applied the patches by hand, keeping track of the changes.  When 
compiling I released the build structure had changed between jdk6 and 
jdk7 and bsd-port6/hotspot/make/bsd/ had to be moved to 
bsd-port6/hotspot/build/bsd.  Makefiles also had to be patched to 
complete the change.  custom-patches contains these patches.


Applying the patch.
*) run import_patch.pl
   - download jdk6 using mercurial to _jdk6
   - dupicate _jdk6 to bsd-port6
   - apply jdk7-bsd-changes-20090126
   - apply custom-patches
*) now compile, I've included a build_bsd-port6.sh script that I use to 
start compiling



Notes of Custom Patches

COPIED FROM bsd-port to bsd-port6
jdk/src/solaris/native/java/io/UnixFileSystem_md.c
jdk/src/solaris/classes/java/lang/UNIXProcess.java.bsd


HAND PATCHED
jdk/src/solaris/bin/java_md.c
jdk/src/share/classes/sun/tools/jar/Main.java
jdk/make/sun/awt/Makefile
jdk/make/tools/freetypecheck/Makefile
jdk/src/share/bin/java.c
jdk/src/share/native/common/check_code.c
jdk/src/share/transport/socket/socketTransport.c
jdk/src/solaris/native/java/lang/UNIXProcess_md.c
jdk/src/solaris/native/sun/nio/ch/Net.c
hotspot/src/share/vm/runtime/os.cpp
hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
hotspot/src/share/vm/utilities/macros.hpp
hotspot/src/share/vm/utilities/vmError.cpp
hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep
hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew
jdk/make/common/internal/BinaryPlugs.gmk
jdk/make/common/shared/Platform.gmk
hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
hotspot/src/cpu/x86/vm/x86_32.ad
hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp
hotspot/src/cpu/x86/vm/runtime_x86_32.cpp
jdk/src/share/classes/java/lang/ProcessBuilder.java

MAKEFILES
mv bsd-port6/hotspot/make/bsd bsd-port6/hotspot/build/bsd

NOTES
jdk/src/share/bin/java.c - was hand patched, however I wasn't able to 
test compiling on Mac OS X, and I worry it won't compile

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_openjdk6_freebsd_0.1.0.tbz
Type: application/octet-stream
Size: 410584 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/bsd-port-dev/attachments/20090130/d3db3c96/patch_openjdk6_freebsd_0.1.0.tbz 


More information about the bsd-port-dev mailing list