binutils编译错误
参考:http://www.linuxdiyf.com/viewarticle.php?id=137799,我打算升级内核我在redhat 9,内核2.4.8的机器上安装binutils 2.17
执行以下命令:
tar zxf binutils-2.17.tar.gz
cd binutils-2.17
./configure
make
结果出错了,错误为:
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating bfd-in3.h
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default commands
make: Entering directory `/mnt/hgfs/share/update/binutils-2.17/libiberty'
if [ x"" != x ] && [ ! -d pic ]; then \
mkdir pic; \
else true; fi
touch stamp-picdir
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/regex.c -o
pic/regex.o;
\
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/regex.c -o
regex.o
../libiberty/regex.c:130: warning: function declaration isn't a prototype
../libiberty/regex.c:131: warning: function declaration isn't a prototype
In file included from ../libiberty/regex.c:638:
../libiberty/regex.c: In function `byte_regex_compile':
../libiberty/regex.c:2439: warning: implicit declaration of function `free'
../libiberty/regex.c:3253: warning: implicit declaration of function `strcmp'
../libiberty/regex.c: In function `byte_re_compile_fastmap':
../libiberty/regex.c:4835: warning: implicit declaration of function `abort'
../libiberty/regex.c: In function `xre_comp':
../libiberty/regex.c:7846: warning: implicit declaration of function `strlen'
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/cplus-dem.c -o
pic/cplus-dem.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/cplus-dem.c -o
cplus-dem.o
../libiberty/cplus-dem.c:55: warning: function declaration isn't a prototype
../libiberty/cplus-dem.c:55: warning: conflicting types for `malloc'
../libiberty/cplus-dem.c:56: warning: function declaration isn't a prototype
../libiberty/cplus-dem.c: In function `code_for_qualifier':
../libiberty/cplus-dem.c:582: warning: implicit declaration of function
`abort'
../libiberty/cplus-dem.c: In function `squangle_mop_up':
../libiberty/cplus-dem.c:1082: warning: implicit declaration of function
`free'
../libiberty/cplus-dem.c: In function `demangle_qualified':
../libiberty/cplus-dem.c:3177: warning: implicit declaration of function
`atoi'
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/cp-demangle.c -o
pic/cp-demangle.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/cp-demangle.c -o
cp-demangle.o
../libiberty/cp-demangle.c: In function `d_identifier':
../libiberty/cp-demangle.c:1310: warning: implicit declaration of function
`memcmp'
../libiberty/cp-demangle.c: In function `d_expression':
../libiberty/cp-demangle.c:2243: warning: implicit declaration of function
`strcmp'
../libiberty/cp-demangle.c: In function `d_print_resize':
../libiberty/cp-demangle.c:2576: warning: implicit declaration of function
`realloc'
../libiberty/cp-demangle.c:2579: warning: implicit declaration of function
`free'
../libiberty/cp-demangle.c: In function `d_print_append_buffer':
../libiberty/cp-demangle.c:2622: warning: implicit declaration of function
`memcpy'
../libiberty/cp-demangle.c: In function `cplus_demangle_print':
../libiberty/cp-demangle.c:2654: warning: implicit declaration of function
`malloc'
../libiberty/cp-demangle.c: In function `d_demangle':
../libiberty/cp-demangle.c:3790: warning: implicit declaration of function
`strlen'
../libiberty/cp-demangle.c:3794: warning: implicit declaration of function
`strncmp'
../libiberty/cp-demangle.c:3807: warning: implicit declaration of function
`strcpy'
../libiberty/cp-demangle.c:3810: warning: implicit declaration of function
`strcat'
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/md5.c -o
pic/md5.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/md5.c -o md5.o
../libiberty/md5.c: In function `md5_finish_ctx':
../libiberty/md5.c:110: warning: implicit declaration of function `bcopy'
../libiberty/md5.c: In function `md5_process_bytes':
../libiberty/md5.c:237: warning: passing arg 1 of `md5_process_block' makes
pointer from integer without a cast
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/alloca.c -o
pic/alloca.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/alloca.c -o
alloca.o
../libiberty/alloca.c: In function `C_alloca':
../libiberty/alloca.c:184: warning: implicit declaration of function `free'
../libiberty/alloca.c:204: warning: implicit declaration of function `abort'
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/argv.c -o
pic/argv.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/argv.c -o argv.o
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/choose-temp.c -o
pic/choose-temp.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/choose-temp.c -o
choose-temp.o
../libiberty/choose-temp.c: In function `choose_temp_base':
../libiberty/choose-temp.c:63: warning: implicit declaration of function
`strlen'
../libiberty/choose-temp.c:65: warning: implicit declaration of function
`strcpy'
../libiberty/choose-temp.c:68: warning: implicit declaration of function
`mktemp'
../libiberty/choose-temp.c:70: warning: implicit declaration of function
`abort'if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/concat.c -o
pic/concat.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/concat.c -o
concat.o
../libiberty/concat.c: In function `vconcat_length':
../libiberty/concat.c:76: warning: implicit declaration of function `strlen'
../libiberty/concat.c: In function `vconcat_copy':
../libiberty/concat.c:90: warning: implicit declaration of function `memcpy'
../libiberty/concat.c: In function `reconcat':
../libiberty/concat.c:206: warning: implicit declaration of function `free'
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/cp-demint.c -o
pic/cp-demint.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/cp-demint.c -o
cp-demint.o
../libiberty/cp-demint.c: In function `cplus_demangle_fill_builtin_type':
../libiberty/cp-demint.c:140: warning: implicit declaration of function
`strlen'../libiberty/cp-demint.c:144: warning: implicit declaration of
function `strcmp'../libiberty/cp-demint.c: In function
`cplus_demangle_v3_components':
../libiberty/cp-demint.c:204: warning: implicit declaration of function
`malloc'../libiberty/cp-demint.c:210: warning: implicit declaration of
function `free'
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/dyn-string.c -o
pic/dyn-string.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/dyn-string.c -o
dyn-string.o
../libiberty/dyn-string.c: In function `dyn_string_delete':
../libiberty/dyn-string.c:110: warning: implicit declaration of function
`free'
../libiberty/dyn-string.c: In function `dyn_string_copy':
../libiberty/dyn-string.c:187: warning: implicit declaration of function
`abort'../libiberty/dyn-string.c:193: warning: implicit declaration of
function `strcpy'
../libiberty/dyn-string.c: In function `dyn_string_copy_cstr':
../libiberty/dyn-string.c:206: warning: implicit declaration of function
`strlen'
../libiberty/dyn-string.c: In function `dyn_string_insert':
../libiberty/dyn-string.c:257: warning: implicit declaration of function
`strncpy'
../libiberty/dyn-string.c: In function `dyn_string_eq':
../libiberty/dyn-string.c:396: warning: implicit declaration of function
`strcmp'
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/fdmatch.c -o
pic/fdmatch.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/fdmatch.c -o
fdmatch.o
if [ x"" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes.././libiberty/fibheap.c -o
pic/fibheap.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include-W -Wall
-pedantic -Wwrite-strings -Wstrict-prototypes .././libiberty/fibheap.c -o
fibheap.o
In file included from ../libiberty/fibheap.c:35:
../include/fibheap.h:63: warning: bit-field `degree' type invalid in ISO C
../include/fibheap.h:64: warning: bit-field `mark' type invalid in ISO C
../libiberty/fibheap.c: In function `fibheap_union':
../libiberty/fibheap.c:151: warning: implicit declaration of function `free'
../libiberty/fibheap.c: In function `fibheap_delete_node':
../libiberty/fibheap.c:258: `LONG_MIN' undeclared (first use in this function)
../libiberty/fibheap.c:258: (Each undeclared identifier is reported only once
../libiberty/fibheap.c:258: for each function it appears in.)
../libiberty/fibheap.c: In function `fibheap_consolidate':
../libiberty/fibheap.c:360: warning: implicit declaration of function `memset'
make: *** Error 1
make: Leaving directory `/mnt/hgfs/share/update/binutils-2.17/libiberty'
make: *** Error 2
make: Leaving directory `/mnt/hgfs/share/update/binutils-2.17'
make: *** Error 2
从提示来看应该是函数定义或者声明不对,
请各位前辈帮忙分析分析哪里出错的,改如何修改。(备注:我这个系统是刚装的,没有做过任何修改,即库和头文件都是redhat9自带的)
回复 #1 xuyong_32 的帖子
你的内核版本是不是太低了,binutils这个版本支持的是哪个版本?你在网上查一下有可能是版本问题
参考这个http://www.linuxdiyf.com/viewarticle.php?id=137799
那作者实践说可行的。也是在2.4.8内核上。
低版本应该不行,因为这个工具最后要生成高版本内核使用。
低版本也许能编译安装成功,但是最后生成高版本的内核映像可能会导致运行不了。
[ 本帖最后由 xuyong_32 于 2009-8-22 19:43 编辑 ] 那你这个应该就是版本不支持的问题造成的了
问题根源
问题根源是安装路径问题我将安装文件拷贝到/usr/src目录下,编译,安装均没有问题。
至于最根本的原因,就不太清楚了。
有高手可以说说。
回复 #5 xuyong_32 的帖子
有可能是对内核的依赖,内核文件默认在/usr/src,你这个安装的时候,就在本目录下找内核依赖。具体需要你自己验证一下。
我想也是这样
换其他目录安装也是提示出错回复 #7 xuyong_32 的帖子
./configure --help看看是不是应该configure KERNEL_DIR=/.../..指出内核目录在哪里
没有啊
看来配置文件,没有要求输入源代码位置的,有个让输入X-LIB的目录的选项.还是想不通,呵呵.
升级的时候编译内核也出错了.挺郁闷.
页:
[1]