Tuesday, March 27, 2012

Building strace

Alright, now after modifying the source code to suppress the annoying "umoven" error, I decided to build the strace. 

Before you start building, follow the instructions to initialize the build environment and to download the code base which is huge, ~ 6GB. However, if you just want to build a specific component like me, you can choose to download the essential packages only.

Here are some of the essential packages (for building strace):
  • prebuilt toolchain  (follow the link to git clone the compiler binaries)
  • platform/bionic
  • platform/build
  • platform/external/apache-http
  • platform/external/libphonenumber
  • platform/external/nist-sip
  • platform/external/stlport
  • platform/external/strace
  • platform/external/tagsoup
  • platform/frameworks/base
  • platform/frameworks/support
  • platform/libcore
  • platform/system/core
  • platform/system/media
Use the repo sync command to download these specific packages into your local repo.
(You might have to remove the platform/ prefix when feeding into repo sync)

Next, simply type "make strace" to start building! It is pretty fast on my Ubuntu 11.10 virtual machine. If somehow you are missing a certain package during the build process, simply use repo sync to download it, and re-make.


You should be aware of the version of the target ARM architecture instruction set. When I first used "make strace", the default target ARM version is 7 which might not be supported by the emulator or the actual phone. As a result, the first binary I built seg faulted with "illegal instruction" on the emulator.


I changed to ARM v5 using this command:
make strace TARGET_PRODUCT=generic_armv5


I pushed the binary to the emulator using the adb tool and it ran fine! No more umoven errors!

No comments: