首页
社区
课程
招聘
[求助]Android下可用的ltrace,最好是静态链接版本 或编译方法
2016-6-17 17:02 8501

[求助]Android下可用的ltrace,最好是静态链接版本 或编译方法

2016-6-17 17:02
8501
试验了几天,随源码也没编译出Android版本的ltrace,看Android官方公告,Disable ltrace build,应该是一个依赖库不能用clang编译。我在4.4源码中用0.5.3ltrace编译是总是报Libiberty不对。在6.0源码中编译0.7.9版本时mmm不起作用,我修改了Android .mk的条件编译也不灵。谷歌和百度了很多资料都没有找到解决方案,请各位大侠指点。

这是我用对立工具链编译时的错误,用的是NDK11版的独立工具链,出错情况和在4.4源码编译时相同。编译已经通过了,就是找不到库。其实是不兼容warning: skipping incompatible。因为没有4.4的出错信息,就用这个代替。独立工具链版本不兼容正常,因为是4.4源码带的,和R11的版本不同。可是6.0源码就是没有ARM版本的Libiberty。

/home/yj/toolchain/bin/arm-linux-androideabi-gcc  main.o libltrace.a -lelf -lsupc++ -liberty  -o ltrace
/home/yj/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /home/yj/toolchain/bin/../sysroot/usr/lib/libiberty.a while searching for iberty
/home/yj/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /home/yj/toolchain/bin/../sysroot/usr/lib/libiberty.a while searching for iberty
/home/yj/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -liberty
read_config_file.c:86: error: undefined reference to 'index'
demangle.c:32: error: undefined reference to 'cplus_demangle'
elf.c:48: error: undefined reference to 'error'
elf.c:55: error: undefined reference to 'error'
elf.c:70: error: undefined reference to 'error'
elf.c:252: error: undefined reference to 'error'
external/elfutils/libelf/elf_error.c:383: error: undefined reference to 'dgettext'
collect2: error: ld returned 1 exit status
make: *** [ltrace] 错误 1

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
打赏
分享
最新回复 (3)
雪    币: 95
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
losted 2016-6-19 19:35
2
0
安卓6.0.1的源码下载下来,编译debug版本地rom,编译后在/system/bin目录下,直接就有ltrace和strace
雪    币: 67
活跃值: (53)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
yaojunhap 2016-6-26 09:33
3
0
请教一下,哪个是ebug版本地rom。

You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_arm64-eng
     3. aosp_mips-eng
     4. aosp_mips64-eng
     5. aosp_x86-eng
     6. aosp_x86_64-eng
     7. aosp_deb-userdebug
     8. aosp_flo-userdebug
     9. full_fugu-userdebug
     10. aosp_fugu-userdebug
     11. mini_emulator_arm64-userdebug
     12. m_e_arm-userdebug
     13. mini_emulator_mips-userdebug
     14. mini_emulator_x86_64-userdebug
     15. mini_emulator_x86-userdebug
     16. aosp_flounder-userdebug
     17. aosp_hammerhead-userdebug
     18. aosp_hammerhead_fp-userdebug
     19. aosp_shamu-userdebug
雪    币: 67
活跃值: (53)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
yaojunhap 2016-6-27 15:41
4
0
研究了一下,在/system/xbin下是有一个版本,可惜无法在4.4下运行,出错信息如下: CANNOT LINK EXECUTABLE: empty/missing DT_HASH in "./ltrace" (built with --hash-style=gnu?)
显然工具链是对的,所以不是LD FLAG的问题。
所以只有继续在4.4下折腾了。
游客
登录 | 注册 方可回帖
返回