编译内核时2.6.21.5 (make (该配置内置了initramfs 文件系统),第一次make 成功, 但是此后再也不行了!make , make clean 等后都会出错):
# make
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CHK include/linux/compile.h
/home/work/bsp_1b/linux-kernel/usr/Makefile:49: *** multiple target patterns. Stop.
make: *** [usr] Error 2
解决方法:
# make -d //会列出详细信息,下面就最后的一信息
Reading makefile `/home/work/kenrel/1b-linux-bsp-5542fd5/usr/Makefile' (search path) (no ~ expansion)...
Reading makefile `usr/.initramfs_data.cpio.gz.d' (search path) (no ~ expansion)...
/home/work/kenrel/1b-linux-bsp-5542fd5/usr/Makefile:49: *** multiple target patterns. Stop.
Reaping losing child 0x09b1ecb8 PID 25934
make: *** [usr] Error 2
# rm usr/.initramfs_data.cpio.gz.d
# make //ok
make[1]: *** [usr/initramfs_data.cpio.gz] Error 1
make: *** [usr] Error 2
make: *** Waiting for unfinished jobs....
权限问题:因为编译内核是在普通用户,而文件系统有的文件需要 root 用户才有权访问
解决方法:
切换到 root 用度进行编译
编译内核时2.6.36.3(gcc-4.4.0)
drivers/built-in.o: In function `sd_revalidate_disk':
sd.c:(.text.sd_revalidate_disk+0x16bc): undefined reference to `____ilog2_NaN'
sd.c:(.text.sd_revalidate_disk+0x16bc): relocation truncated to fit: R_MIPS_26 against `____ilog2_NaN'
make: *** [.tmp_vmlinux1] Error 1
解决方法:
1. 去除 driver/scsi 的支持,这种是冶标不冶本的方法 (不予推荐)
2. 在 .config 中添加 CONFIG_CC_OPTIMIZE_FOR_SIZE=y (推荐)
出现此问题为gcc的bug:详见
阅读(3103) | 评论(0) | 转发(2) |