The return of the Shark, part II (howto)
November 28, 2012 10 Comments
So, finally, after some back and forth, the Shark fixes landed in hotspot-comp (thanks Twisti for reviewing and pushing me). It took a little while to sort out the new atomic operations in LLVM. If you want to play with it, you first need LLVM 3.2 (not the latest 3.1 release!):
svn co http://llvm.org/svn/llvm-project/llvm/branches/release_32/ llvm-3.2 cd llvm-3.2 ./configure && make && make install
Then you need to check out hotspot-comp:
cd .. hg clone http://hg.openjdk.java.net/hsx/hotspot-comp/ cd hotspot-comp sh get-source.sh
Finally, I recommend you use my build script for Shark: place it in the toplevel directoy of hotspot-comp and modify all the env variables to your needs. Most importantly, change LLVM_CONFIG to point to your $LLVM_INSTALL_DIR/bin/llvm-config. Enjoy the Shark!



Wow Awesome! Side question, is there an openjdk7 build that works too?
No, not yet. It might get backported in a 7 update release though.
Good man!
Rgds
Damon
Will this work for Arm and PowerPC also?
Can I cross-compile for Arm and PowerPC?
That’s what I’m really interested in doing.
I haven’t tried yet, but this is definitely the goal.
context, people, context. You and your friends can know what you mean by shark but I don´t. So where do we learn what shark is and why it is important?
Right, sorry
I briefly mentioned it in the previous post and here’s a more complete FAQ the project’s website on OpenJDK.
http://today.java.net/pub/a/today/2009/05/21/zero-and-shark-openjdk-port.html – Zero and Shark: a Zero-Assembly Port of OpenJDK -This article was made by gbenson back in 2009 and describe the need for Zero and Shark nicely.
Thank you for the link ive got it working and running.however been a strict adherent to the klingon school of programinig i ignored your script and tried to use the new autotools with limited success they do not setup the enviroment correctly setting MFLAGS does work fine.
Should i have some time id like to work on this. i may also clean up the patch on bugzilla for shark/llvm with min 3.2 its clear llvm3.0/3.1 are lemons.
Ok success with X32/Shark note that its a x86_64 system with 32bit ELF
There is a small patch needed that you could look at
jdk/makefiles/CreateJars.gmk
JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
should be ifdef/endif inside ifeq ($(INCLUDE_SA), true)
without this patch images cant be built
file ./jdk/bin/java;./jdk/bin/java -version
./jdk/bin/java: ELF 32-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.4.0, not stripped
openjdk version “1.8.0-internal”
OpenJDK Runtime Environment (build 1.8.0-internal-root_2013_02_11_14_42-b00)
OpenJDK Shark VM (build 25.0-b19, mixed mode)