在编译linux-2.6.29内核版本过程,依次出现如下问题,记录解决方法。
报错提示1:
解决:
执行:vi /home/wangz/rootfs/linux-2.6.29/kernel/timeconst.pl文件,执行:373跳转至373行,将!defined(@val)改为!(@val) 即可,如下
报错提示:2:
解决:
由于旧编译器可能是用OABI的,而配置内核时又选择了使用EABI的,修改内核配置(make menuconfig)选项:
Kernel Features ---->Use the ARM EABIto compile the kernel 为 no,重新生成.config文件(其中.config默认为隐藏文件,用ls -a可以查看到)
报错提示3:
解决:
如果使用的是Ubuntu 9.10及以上版本,可以使用下面的命令安装mkimage,执行:#apt-get install uboot-mkimage。我在Ubuntu16.04上测试行不通,
然后执行:apt-get install u-boot-tools,安装成功后重新编译内核,执行:
make uImage ARCH=arm CROSS_COMPILE=arm-linux-
最后编译得到内核uImage镜像如下:
编译内核模块时出现问题:
执行:make modules ARCH=arm CROSS_COMPILE=arm-linux-
报错提示1:
解决:
implicit declaration of function `dma_cache_sync'表示隐式声明错误,可能有几个原因:
1 没有把函数所在的c文件生成.o目标文件
2 在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明
在/home/wangz/rootfs/linux-2.6.29//arch\arm\include\asm\dma-mapping.h下没有这个函数声明,但有如下注释:
/*
* Dummy noncoherent implementation. We don't provide a dma_cache_sync
* function so drivers using this API are highlighted with build warnings.
*/
dma_cache_sync( )没有申明却被调用, 这里直接把它注释掉好了,执行
vi /home/wangz/rootfs/linux-2.6.29/drivers/scsi/advansys.c,查找dma_cache_sync( )函数调用部分改为如下:、
报错提示2:
执行:
make menuconfig
然后在配置中设置device drivers -->network device support-->enthernet (10 or 100Mbit)-->Sun GEM support选项为 no 即可解决上述问题。