The instructions are very precise, following them you get your statically linked
strace.
Just to be safe (in case the original source disappears), I'll back up the instructions for myself:
- Prerequisite: you already have the cross compiler downloaded from the CodeSourcery GNU toolchain site, make sure you select ARM GNU/Linux, and IA32 GNU/Linux.
- Download the strace source distribution from the SourceForge strace project.
- Extract the strace package on your linux machine.
- Set your compiler information:
export CC=your_cross_compiler_folder/bin/arm-none-linux-gnueabi-gcc
export STRIP=your_cross_compiler_folder/bin/arm-none-linux-gnueabi-strip
export CFLAGS="-O2 -static"
Note: CFLAGS is by default -g -O2, but we need static linking and (optionally) no debug information. You can even leave out -static, but in that case you'll have to ship the compiled executable with all the referenced shared libs from the cross compiler!
- Add
your_cross_compiler_folder/bin into your $PATH.
- Change your current folder to the strace folder (where you extracted the source), use command:
./configure --host=arm-linux
Optionally you might want to specify a prefix with --prefix=/data/local.
- Compile:
make
- Verify the result (eg. static linking) with the command:
file strace
You shall see:
strace: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, statically linked, not stripped
- Optionally you can strip symbols from it with:
$STRIP strace
(if you only need the executable)
Or package it into a TGZ:
tmpdir="$(mktemp -d)"
mkdir -p "$tmpdir/data/local"
make install-strip prefix="$tmpdir/data/local"
dir="$(dirname "$(pwd)")"
packagefile="$dir/$(basename "$(pwd)")-bin.tgz"
cd "$tmpdir"
fakeroot -- sh -c "chmod -R a+rX,u+w,go-w data && chown -R root:root data && tar czf \"$packagefile\" data"
cd "$dir"
rm -rf "$tmpdir"
Done, you have another powerful tool for your Android.
P.S.: I've made a few changes (imho optimizations) to the original instructions.
Update (2013.05.23): I've reapplied the same instructions to compile strace v4.7 with Sourcery CodeBench Lite 2013.05-24. I installed the latter with the linux installer (arm-2013.05-24-arm-none-linux-gnueabi.bin) in my user home directory on a 32-bit Ubuntu 10.10 (x86) server. I've attached the compiled TGZ package that you can simply extract into your filesystem and it'll put all strace files into
/data/local.
Recent comments
2 weeks 5 days ago
5 weeks 6 hours ago
5 weeks 7 hours ago
5 weeks 5 days ago
5 weeks 6 days ago
6 weeks 1 day ago
6 weeks 1 day ago
6 weeks 2 days ago
6 weeks 2 days ago
6 weeks 3 days ago