Seabright Technology Header Image

Building dalvik by itself

Just some notes for now. After following the instructions at you’ll have a local copy of the full android source code. We’re only interested in dalvik so we’ll skip building the rest.

First switch to the 1.5 release tag. The first version that I pulled had a typo that stopped the build.  To do this, change to the dalvik directory, list the tags, then change to the 1.5r2 tag
cd dalvik
git tag
git checkout android-1.5r2

According to dalvik/docs/hello-world.html, we can set up the local environment to build a x86 debug release. Change back to the top directory and run:
. build/
choosecombo Simulator debug sim eng

Note that this command and many others are defined in

We can now build individual directories using mm to build the module in the current directory.

cd dalvik/vm
cd ../dalvikmm

On my system this gave me a in out/debug/host/linux-x86/product/sim/obj/lib/ and a executable in out/debug/host/linux-x86/product/sim/obj/EXECUTABLES/dalvikvm_intermediates/dalvikvm. To run, change to the top directory and run:

export LD_LIBRARY_PATH=$PWD/out/debug/host/linux-x86/product/sim/obj/lib

E/dalvikvm(22399): ERROR: must specify non-'.' bootclasspath
W/dalvikvm(22399): JNI_CreateJavaVM failed
Dalvik VM init failed (check log file)

It looks like I had most of the system already built from an earlier top level make. The next step is to take the source back to the 1.5r2 tag and build everything for linux-x86.

The lesson for today was the ‘mm’ command. I couldn’t make head nor tail of the rest of the build system. The top level is 699 lines by itself.

Leave a Reply