用clang编译SPEC2006 过程中的问题(与gcc,ld相关)
2015-04-16 14:16
417 查看
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 version 2.17.50.0.6-9.el5 20061020
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
更新后版本是
GNU ld (GNU Binutils) 2.20.1.20100303
并将该链接器添加到对应路径中,例如PATH和LD_LIBRARY_PATH
问题解决。
如果还需要编译其他C++程序,那么最好安装binutils 2.25.
http://ftp.gnu.org/gnu/binutils/
编译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 version 2.17.50.0.6-9.el5 20061020
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
更新后版本是
GNU ld (GNU Binutils) 2.20.1.20100303
并将该链接器添加到对应路径中,例如PATH和LD_LIBRARY_PATH
问题解决。
如果还需要编译其他C++程序,那么最好安装binutils 2.25.
http://ftp.gnu.org/gnu/binutils/
相关文章推荐
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题
- GCC 编译过程及相关的知识
- 整理Linux下gcc编译中关于头文件与库文件搜索路径相关问题
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题 1
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题(一)
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题 2
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题(二)
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题 3
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题(三)
- 使用gcc编译时错误提示: ld returned 1 exit status问题
- 关于Qt交叉编译过程中出现的collect2: ld returned 1 exit status问题的解决方案
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题(一)
- 转载: Linux下gcc编译中关于头文件与库文件搜索路径相关问题
- CentOS 系统下编译安装 gcc4.8.2过程及编译问题详解
- GCC编译过程中出错问题总结
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题
- Linux下gcc编译中关于头文件与库文件搜索路径相关问题(一)
- 如何解决编译过程中遇到ASN1C相关的问题
- GCC编译过程中出错问题总结
- gcc 编译relocation相关的一个问题