ubuntu14.04 64bit PC(gcc版本4.8)编译 2.6.32的内核(配置成i386, 32bit)出错

内核编译和嵌入式产品的设计与开发
回复
eagle7
帖子: 4
注册时间: 2015-04-01 9:22
系统: ubuntu14.04

ubuntu14.04 64bit PC(gcc版本4.8)编译 2.6.32的内核(配置成i386, 32bit)出错

#1

帖子 eagle7 » 2015-04-01 10:28

编译前我把本机的gcc 还原为gcc-4.8
$ ll /usr/bin/gcc*
lrwxrwxrwx 1 root root 16 4月 1 18:05 /usr/bin/gcc -> /usr/bin/gcc-4.8*
-rwxr-xr-x 1 root root 255080 3月 20 2014 /usr/bin/gcc-4.4*
-rwxr-xr-x 1 root root 357344 3月 20 2014 /usr/bin/gcc-4.6*
-rwxr-xr-x 1 root root 775888 4月 5 2014 /usr/bin/gcc-4.8*
lrwxrwxrwx 1 root root 10 4月 8 2014 /usr/bin/gcc-ar -> gcc-ar-4.8*
-rwxr-xr-x 1 root root 26968 4月 5 2014 /usr/bin/gcc-ar-4.8*
lrwxrwxrwx 1 root root 10 4月 8 2014 /usr/bin/gcc-nm -> gcc-nm-4.8*
-rwxr-xr-x 1 root root 26968 4月 5 2014 /usr/bin/gcc-nm-4.8*
lrwxrwxrwx 1 root root 14 4月 8 2014 /usr/bin/gcc-ranlib -> gcc-ranlib-4.8*
-rwxr-xr-x 1 root root 26968 4月 5 2014 /usr/bin/gcc-ranlib-4.8*


出错信息如下:
$ make bzImage V=1
...
...
...
In file included from include/linux/blkdev.h:12:0,
from init/do_mounts.h:2,
from init/do_mounts_md.c:5:
include/linux/pagemap.h: In function ‘fault_in_pages_readable’:
include/linux/pagemap.h:413:16: warning: variable ‘c’ set but not used [-Wunused-but-set-variable]
volatile char c;
^
set -e ; perl /home/xfy/work/linux_kernel_debug__/_kr_debug_code_/linux-2.6.32.7/scripts/recordmcount.pl "x86_64" "32" "objdump" "objcopy" "gcc" "ld" "nm" "" "" "0" "init/do_mounts_md.o";
ld -m elf_i386 -r -o init/mounts.o init/do_mounts.o init/do_mounts_rd.o init/do_mounts_initrd.o init/do_mounts_md.o
ld: Relocatable linking with relocations from format elf64-x86-64 (init/do_mounts_rd.o) to format elf32-i386 (init/mounts.o) is not supported
make[1]: *** [init/mounts.o] Error 1
make: *** [init] Error 2
回复