2.6.31內核編譯處理3個錯誤 (redhat)

 

編譯2.6.31內核時,遇到3個錯誤。網上資料也很少能參考的,記錄一下處理過程。

錯誤提示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

刪除以下行(2875)

vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT);  

在相同位置添加

vc_cons[currcons].d = vc = alloc_bootmem(sizeof(struct vc_data));

 

錯誤提示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行)前面即可。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章