From time to time I get the question: How do I make a native build of Icedtea6 using Shark and LLVM on ARM?
Here is how I do it:
First all dependencies needed to build llvm and openjdk needs to be installed, if you are using Ubuntu then this can be satisfied quite easily by typing in these two lines.
apt-get build-dep openjdk-6-jdk llvm
apt-get install cmake mercurial subversion-tools openjdk-6-jdk ccache
The next little script does all the magic, it download the sources using subversion and mercurial, configures and starts the building!
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
mkdir llvm-cmake
cd llvm-cmake
cmake -DCMAKE_BUILD_TYPE:STRING=ReleaseWithDebInfo \
-DLLVM_BUILD_TOOLS:BOOL=ON \
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \
-DLLVM_ENABLE_ASSERTIONS:BOOL=ON \
-DLLVM_TARGETS_TO_BUILD:STRING=ARM ../llvm
make
make install
cd ..
hg clone http://icedtea.classpath.org/hg/icedtea6
cd icedtea6
./autogen.sh
cd ..
mkdir icedtea6-shark-build
cd icedtea6-shark-build
../icedtea6/configure –enable-zero –enable-shark –disable-docs –with-openjdk
make
Enjoy!
Hum, interesting. Since LLVM can target the iPhone, would it be possible to compile JVM bytecode for the iPhone using a Shark/Zero/LLVM/iPhone toolchain ?
That would make developing applications for iPhone in Java possible, which would be really cool
Comment by Cédric Vidal — November 4, 2009 @ 8:43 pm
Hi Cédric!
Guillaume Legris have made some great progress getting JavaME applications running on the iPhone using MIDPath, you should check it out its awesome: http://bloggl.thenesis.org/2009/03/midpath-on-iphone.html
JamVM are currently the most well tested jvm to use on the iPhone, try it!
http://draenog.blogspot.com/2008/11/jamvmgnu-classpathiphone-roundup.html
Ok back to your question: Yes, LLVM have great support for Darwin so I see no issues compiling it for the iPhone and MIDPath can be configured to use JavaSE JVM’s like hotspot and Zero/Shark so you should be able to get some GUI’s up and running as well!
The only issue that I can see are that hotspot JVM using Zero/Shark are currently only known to compile and run on Linux therefore some more porting work are required to get it running under Darwin as well. The OpenJDK BSD porters are the ones to team up with to make it happen!
http://landonf.bikemonkey.org/2008/08/20
http://landonf.bikemonkey.org/static/soylatte/
http://mail.openjdk.java.net/mailman/listinfo/bsd-port-dev
Cheers and have a great day!
Xerxes
Comment by xerxes — November 4, 2009 @ 9:58 pm