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!


Mahdieh Kazemipour said...

please give me exucution binary file of strace


Sedeeq Al-Khazraji said...

I need to use strace on a rooted Android Asus ZenFone 2E, Intel Atom, x86.
So, I get a working binary for strace and run it on other phone and it is working perfectly. But when I tried to run the same command on Asus ZenFone 2E, it did not work.
The command is:

strace -f -c -p 123

The resulted error is:

PTRACE_SYSCALL doesn't work: Function not implemented

Alucard said...

@Mahdieh you need to build it yourself or obtain it on Android as it usually comes bundled with the OS.

@Sedeeq most likely it is disabled on the OS