用clang编译SPEC2006 过程中的问题(与gcc,ld相关)
来源:互联网 发布:数据接口大全 编辑:程序博客网 时间:2024/06/15 22:07
1. 重复定义__strcspn_c1
编译401.bzip2时错误
/usr/include/bits/string2.h:972: multiple definition of `__strcspn_c1'
bgm.o:/usr/include/bits/string2.h:972: first defined here
dinkini.o: In function `__strcspn_c2':
/usr/include/bits/string2.h:983: multiple definition of `__strcspn_c2'
bgm.o:/usr/include/bits/string2.h:983: first defined here
dinkini.o: In function `__strcspn_c3':
/usr/include/bits/string2.h:996: multiple definition of `__strcspn_c3'
bgm.o:/usr/include/bits/string2.h:996: first defined here
分析:该问题一般是在使用较老版本的gcc库时碰到,例如在centos操作系统平台上,gcc是4.1.2时会碰到该问题,问题原因SPEC中部分代码时C89,但是clang默认版本为CC89,从而导致出现该错误。更详细解释可以参考:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-December/027958.html
GCC从4.5开始,才完全支持C99.
https://gcc.gnu.org/c99status.html
解决:在编译选项中添加-std=gnu89
另外, 429.mcf, 433.milc, 445.gobmk等也存在同样问题
2. 编译403.gcc是的重复定义错误
错误信息:
mp/concat-yeQL2V.o: In function `gnu_dev_major':
/usr/include/sys/sysmacros.h:44: multiple definition of `gnu_dev_major'
/tmp/alloca-YSgYzY.o:/usr/include/sys/sysmacros.h:44: first defined here
/tmp/concat-yeQL2V.o: In function `gnu_dev_makedev':
/usr/include/sys/sysmacros.h:56: multiple definition of `gnu_dev_makedev'
/tmp/alloca-YSgYzY.o:/usr/include/sys/sysmacros.h:56: first defined here
/tmp/concat-yeQL2V.o: In function `gnu_dev_minor':
/usr/include/sys/sysmacros.h:50: multiple definition of `gnu_dev_minor'
/tmp/alloca-YSgYzY.o:/usr/include/sys/sysmacros.h:50: first defined here
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 25.
/tmp/getpwd-UxjZIi.o: In function `fstat':
/usr/include/sys/stat.h:449: multiple definition of `fstat'
/tmp/c-parse-7tFGiF.o:/usr/include/sys/stat.h:449: first defined here
/tmp/getpwd-UxjZIi.o: In function `fstat64':
/usr/include/sys/stat.h:498: multiple definition of `fstat64'
/tmp/c-parse-7tFGiF.o:/usr/include/sys/stat.h:498: first defined here
/tmp/getpwd-UxjZIi.o: In function `fstatat':
分析:ld版本过旧,当前版本是
更新后版本是
GNU ld (GNU Binutils) 2.20.1.20100303
并将该链接器添加到对应路径中,例如PATH和LD_LIBRARY_PATH
问题解决。
如果还需要编译其他C++程序,那么最好安装binutils 2.25.
http://ftp.gnu.org/gnu/binutils/
- 用clang编译SPEC2006 过程中的问题(与gcc,ld相关)
- gcc编译,ld连接
- gcc编译,ld连接
- GCC 编译过程及相关的知识
- Clang、LLVM与GCC介绍
- GCC/LD编译链接潜规则
- OSG程序编译与开发过程中的问题(不断更新)
- LLVM(Clang)的编译过程
- IOS 下编译 LIBCURL gcc clang
- 编译clang的时候ld进程耗尽内存
- gcc ld碰到的问题
- gcc 编译relocation相关的一个问题
- SPEC2006编译经历
- SPEC2006编译经历
- Linux下编译SPEC2006
- Spec2006 编译错误
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题(一)
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题(二)
- js call
- Java 单文本替换并计算替换的个数
- UVA - 10396(简单暴力)
- 电热恒温鼓风干燥箱的产品操作流程
- iOS开发网络篇—实现一个视频播放客户端小应用(二)
- 用clang编译SPEC2006 过程中的问题(与gcc,ld相关)
- 配置多个git仓库
- Mysql group by top N的问题
- span设置固定宽度
- Objective-C创建目录接口createDirectoryAtPath:withIntermediateDirectories:attributes:error:中参数attributes的设置
- 内省、注解、类加载器
- iOS开发网络篇—实现一个视频播放客户端小应用(三)
- atitit.验证码识别step4--------图形二值化 灰度化
- jquery总结