Android x86 Build Notes

Here are my notes regarding building Android x86 under Mountain Lion, with stock Xcode.


Guess what, the ICS source loathes it. So I’m using the following:

repo init -u git:// -b ics-x86
repo sync
. build/ 
export CPP='llvm-gcc-4.2'
export CC='llvm-gcc-4.2'
export CXX='llvm-g++'

Currently Stuck at (2012-08-11):

host C: editdisklbl <= bootable/newinstaller/editdisklbl/editdisklbl.c
make: *** No rule to make target `out/host/darwin-x86/obj/STATIC_LIBRARIES/libdiskconfig_host_intermediates/libdiskconfig_host.a', needed by `out/host/darwin-x86/obj/EXECUTABLES/editdisklbl_intermediates/editdisklbl'.  Stop.

This appears to be a bad makefile that fails to take into account differences in the environment.


Header Idiocy


This needs the extra strlen declaration commented out, since strlen is already defined but the header file fails to take that into account. I’m surprised this doesn’t blow up on other Unixes.


This requires an extra definition around line 100 (this is defined in the Linux system header files, but is absent in Darwin).

typedef long long loff_t;


You’ll need (for some obscure reason) to install the libxml2 bindings to get one of the Python build scripts to work. I’ve never had to do this for any other Android build, which is strange. Again, using Homebrew, you do:

# this is necessary since Homebrew is somewhat prissy about sudo
sudo chmod o+w /Library/Python/2.7/site-packages
brew update
brew edit libxml2

Change the formula to read:

    system "./configure", "--prefix=#{prefix}", "--with-python"


brew install libxml2
sudo chmod o-w /Library/Python/2.7/site-packages

This will effectively install a different .dylib for libxml2, but with no ill effects since Homebrew doesn’t place it into the linker path – all we want is for Python to be happy – it will use the system’s built-in libxml2 instead.