【SystemTap】c独立安装elfutils导致错误 cannot load ld backend library 'libld_elf_x86_64.so' 和 error: C compiler cannot create executables
来源:互联网 发布:手机淘宝版本大全 编辑:程序博客网 时间:2024/06/06 09:01
场景:
运行程序时出现了一系列的错误,例如:
(1)编译内核执行命令 make menuconfig 命令时出现如下错误:
/usr/local/bin/ld: cannot load ld backend library 'libld_elf_x86_64.so':
libld_elf_x86_64.so: cannot open shared object file: No such file or directory
即
/usr/local/bin/ld: cannot load ld backend library 'libld_elf_x86_64.so': libld_elf_x86_64.so: 无法打开共享对象文件: 没有那个文件或目录
(2)执行 systemtap下的 ./configure 出现如下错误
checking for C compiler default output file name...
configure: error: in `/local/zkl/systemtap-1.1':
configure: error: C compiler cannot create executables
See `config.log' for more details.
{
我查看 config.log 文件,搜索 " C compiler default output file name ",发现以下几行
configure:2913: checking for C compiler default output file name
configure:2935: gcc conftest.c >&5
/usr/local/bin/ld: cannot load ld backend library 'libld_elf_x86_64.so': libld_elf_x86_64.so: cannot open shared object file: No such file or directory
}
两个错误实际上都是 'libld_elf_x86_64.so' 造成的。
原因分析:
独立安装 elfutils-0.137 后导致的一系列致命错误:
错误描述
回想我的操作,可能是因为我安装 elfutils-0.137 的缘故,因为SystemTap需要elfutils支持,所以我下载了 elfutils-0.137,解压后执行了:./configure,make,make install 进行安装,然后就出现了这一系列莫名奇妙的错误。libld_elf_x86_64.so 应该是elfutils的库,最开始也不知道是elfutils导致的问题。
网上找了好久,终于在下面的一个网站中找到了眉目: http://permalink.gmane.org/gmane.linux.systemtap/16482
它描述原因是:
The error was because I had "make install" the downloaded elfutils, which subsequently installed "ld" and "ar" into /usr/local/bin, and these latter binaries are not working properly. But as systemtap just need the source of elfutils, it is not need to "make install" for the elfutils.
download elfutils sources, untar into some directory, then configure systemtap with --with-elfutils=THE_ELFUTILS_SOURCE_DIRECTORY/.
原来是因为make install 安装elfutils生成的库不能正常工作,systemtap的安装仅仅是需要elfutils源码(执行 ./configure --with-elfutils=THE_ELFUTILS_SOURCE_DIRECTORY ),而不是首先 make install 安装 elfutils。
因此,归结为,独立安装 elfutils-0.137 导致了错误: /usr/local/bin/ld: cannot load ld backend library 'libld_elf_x86_64.so': libld_elf_x86_64.so: cannot open shared object file: No such file or directory。应该是执行ld命令检查库依赖时出现了问题,
解决办法:
进入 elfutils-0.137 目录,按以下顺序执行命令卸载 elfutils,
make uninstall;
make distclean;
注意执行这些命令都需要Makefile文件,而elfutils是通过 ./configure 生成Makefile文件,因此若发现没有makefile文件,则需要在一台没有问题的机器上执行 ./configure 命令生成 Makefile 文件,然后再拷贝过来,再对 elfutils 进行卸载。
- 【SystemTap】c独立安装elfutils导致错误 cannot load ld backend library 'libld_elf_x86_64.so' 和 error: C compiler cannot create executables
- error: C compiler cannot create executables
- configure: error: C compiler cannot create executables
- configure: error: C compiler cannot create executables
- ubuntu错误:configure: error: C compiler cannot create executables
- configure: error: C compiler cannot create executables错误解决
- error: C compiler cannot create executables的错误
- configure: error: C compiler cannot create executables错误解决
- configure: error: C compiler cannot create executables错误解决
- tslib安装 C compiler cannot create executables
- "C compiler cannot create executables"
- C compiler cannot create executables
- ubuntu apache 源码安装错误 configure: error: C compiler cannot create executables 解决
- 安装源码版apache出现 configure: error: C compiler cannot create executables错误
- [Linux] configure: error: C compiler cannot create executables
- 编译问题configure: error: C compiler cannot create executables
- Android中configure: error: C compiler cannot create executables解决方法
- C compiler cannot create executables问题
- asp.net网页中的跳转问题
- Winsock2中WSAAsynSelect()模型各种事件的触发条件
- E1线拨外地的号正常,本地固话和手机都要加拨区号才行-[已解决]
- hibernate+oracle下使用sequence策略设置主键的方法
- setsockopt函数的功能列举
- 【SystemTap】c独立安装elfutils导致错误 cannot load ld backend library 'libld_elf_x86_64.so' 和 error: C compiler cannot create executables
- 四:vc++在文件夹下寻找文件
- STL 中容器的一些简单操作
- 开始学CPU啦,任务艰巨
- 使用OpenCV进行视频读写
- 药品网站优化常见的几个错误
- 自建网站的https对应。
- 互联网产品设计进阶(12)描绘用户心中的海市蜃楼
- SQL server的两种验证模式:NT验证模式和混合安全模式(转载)