Productivity Sync Just another WordPress weblog

January 1, 2012

Building AOSP on ubuntu 11.10 x86_64

Filed under: Uncategorized — admin @ 12:18 am

The Android Open Source Project has issues with the newest GCC host compiler where the build of ICS falls over in annoying ways on the new distro.  To get around this issue I tried building my own compiler but, that was a pain in the ass with getting the multi-lib support working then in my googleing for how to do that with the old compilers I found the following blog post that is all gold to me.  Using it when building AOSP works well.  🙂

Setup:

http://www.android-dev.ro/2011/12/13/building-android-4-0-on-ubuntu-11-10/
sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib 
sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so 
cd to your AOSP ics directory: make CC=gcc-4.4 CXX=g++-4.4 -j4

Shiny!

Well, maybe not 100% shiny. Building rowboat for the beagle board falls over on the kernel and the sgx build using the CC=gcc-4.4 CXX=g++-4.4 command line hack. They get confused by the CC and the CXX.  The work around I have done for this is to hack the AOSP build/core/combo/select.mk file:


diff --git a/build/core/combo/select.mk b/build/core/combo/select.mk
index 916320b..8116723 100644
--- a/build/core/combo/select.mk
+++ b/build/core/combo/select.mk
@@ -25,8 +25,8 @@ combo_os_arch := $($(combo_target)OS)-$($(combo_target)ARCH)
 
 # Set reasonable defaults for the various variables
 
-$(combo_target)CC := $(CC)
-$(combo_target)CXX := $(CXX)
+$(combo_target)CC := gcc-4.4
+$(combo_target)CXX := g++-4.4
 $(combo_target)AR := $(AR)
 
 $(combo_target)BINDER_MINI := 0

Now its more shiny but not perfect. I don’t need to change my command line to build on 11.10 but, I do have to remember this hack every time I set up a project.

Powered by WordPress