-->

building ltrace for android

2019-06-06 21:08发布

问题:

I'm trying to build ltrace for android. I've tryed a few ways none worked....

I was able to produce a bin file compiling the source code using crosstool-ng's arm-unknown-linux-gnueabi and

./configure -host=arm-linux-gnueabi -target arm-linux-gnueabi CC=/path/to/toolchain/bin/arm-unknown-linux-gnueabi-gcc -prefix=/path/to/destination/folder

but when i tried to execute that bin on android i get:

./ltrace: not found

Any ideas?

回答1:

Looks like executable bit is not set? You can check by doing ls -l ltrace and if needed, set it with chmod a+x ltrace.



回答2:

Your probably have the wrong path to the dynamic linker inside the ltrace binary. On android the linker lives in /system/bin/linker. By default the path will be /bin/ld-linux.so. The way to go is to either port ltrace to work with the Android NDK, build some sample code with Android NDK and figure out all the build flags, link statically, or just find a working pre-built ltrace. I am in the process of solving this problem right now, will post when I have results.