linux编译出现错误

来源:互联网 发布:期货自动化交易软件 编辑:程序博客网 时间:2024/05/16 04:46
引用:http://blog.chinaunix.net/u/12207/showart_2061214.html
关于2.6.31遇到的问题
错误提示1:
drivers/built-in.o(.init.text+0x3bad): In function `con_init':
include/trace/events/kmem.h:47: undefined reference to `.L1452'
解决:
vi /usr/src/linux/drivers/char/vt.c 找到static int __init con_init(void)函数中,以下语句
删除以下行(第2875行)
vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT);  
在相同位置添加:
vc_cons[currcons].d = vc = alloc_bootmem(sizeof(struct vc_data));
同时记得加上头文件 #include <linux/bootmem.h>,否则会出现第2个错误。
 
错误提示2:
drivers/char/vt.c: In function `con_init':
drivers/char/vt.c:2875: error: implicit declaration of function `alloc_bootmem'
drivers/char/vt.c:2875: warning: assignment makes pointer from integer without a cast
原因:vt.c中引用了alloc_bootmem,但是找不到相关.h定义文件或没有在相关的头文件.h中定义
解决:
 

# vi /usr/src/linux/drivers/char/vt.c,添加以下这行:
#include <linux/bootmem.h>
 
错误提示3:
drivers/message/fusion/mptsas.c: In function `mptsas_port_delete':
drivers/message/fusion/mptsas.c:105: sorry, unimplemented: inlining failed in call to 'mptsas_set_rphy': function body not available
drivers/message/fusion/mptsas.c:467: sorry, unimplemented: called from here
原因:
mptsas_port_delete中引用了mptsas_set_rphy,但mptsas_set_rphy的定义却在mptsas_port_delete之后。
解决:
vi /usr/src/linux/drivers/message/fusion/mptsas.c,将mptsas_set_rphy的定义(第483行起)移动到mptsas_port_delete的定义(第446行)前面即可。