- 积分
- 17
贡献40
飞刀0 FD
注册时间2010-5-21
在线时间6 小时
扫一扫,手机访问本帖
|
最近需要在OK335x的板子上安装valgrind,遇到了一个关于ld-linux.so.3的很难解决的问题:
我的主机是Acer 5745DG,安装的系统是Federo20。target板是OK335xD,安装了光盘里面的Linux+QT镜像。交叉编译器使用的是光盘里面自带的。
下载valgrind的最新版本3.9.0之后,在Fedora20下编译并且运行成功,然后使用交叉编译器执行:
[root@localhost valgrind-3.9.0]# ./configure \
CC=/opt/arm-arago-linux-gcc/bin/arm-arago-linux-gnueabi-gcc \
CPP=/opt/arm-arago-linux-gcc/bin/arm-arago-linux-gnueabi-cpp \
CXX=/opt/arm-arago-linux-gcc/bin/arm-arago-linux-gnueabi-g++ \
CFLAGS="-pipe -Os -mtune=cortex-a8 -march=armv7-a -mabi=aapcs-linux -msoft-float -I/opt/arm-arago-linux-gcc/arm-arago-linux-gnueabi/usr/include" \
LDFLAGS="-L/opt/arm-arago-linux-gcc/arm-arago-linux-gnueabi/usr/lib" \
--prefix=/opt/valgrind-arm \
--host=armv7-none-linux-gnueabi \
--target=arm-none-linux-gnueabi
然后是make和make intall。到这一步能够编译成功,并且在/opt生成目录,将它拷贝进target板之后,运行bin下面的可执行文件valgrind,会提示找不到lib库,此时直接在/opt下创建符号链接既可。
比较难解决的问题是:
valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
valgrind:
valgrind: A must-be-redirected function
valgrind: whose name matches the pattern: memcpy
valgrind: in an object with soname matching: ld-linux.so.3
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld-linux.so.3
valgrind:
valgrind: Possible fixes: (1, short term): install glibc's debuginfo
valgrind: package on this machine. (2, longer term): ask the packagers
valgrind: for your Linux distribution to please in future ship a non-
valgrind: stripped ld.so (or whatever the dynamic linker .so is called)
valgrind: that exports the above-named function using the standard
valgrind: calling conventions for this platform. The package you need
valgrind: to install for fix (1) is called
valgrind:
valgrind: On Debian, Ubuntu: libc6-dbg
valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.
在网上搜的解决方法基本都是基于桌面发行版的,另外有一个方法是执行valgrind时给出参数:
valgrind --read-var-info=yes --trace-children=yes --smc-check=all-non-file --malloc-fill=0xA5 --free-fill=0xC3 --leak-check=full --num-callers=50 --show-possibly-lost=no ./1-main-arm
但是程序运行不到10s还是会出现上面的ld-linux.so.3的问题。
有谁遇到过同样的问题吗?该怎么解决呢?
|
|