1、
error: ‘PATH_MAX’ undeclared (first use in this function)
scripts/mod/sumversion.c: In function ‘get_src_version’:
scripts/mod/sumversion.c:384:16: error: ‘PATH_MAX’ undeclared (first use in this function)
scripts/mod/sumversion.c:384:16: note: each undeclared identifier is reported only once for each function it appears in
scripts/mod/sumversion.c:384:7: warning: unused variable ‘filelist’ [-Wunused-variable]
make[2]: *** [scripts/mod/sumversion.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
解决方法:# vi scripts/mod/sumversion.c头文件包含中查看是否有limits.h,若没有,包含进去即可,,#inlcude <limits.h>
2、
drivers/video/neofb.c: In function ‘neo_init_hw’:
drivers/video/neofb.c:1925:6: warning: variable ‘maxHeight’ set but not used [-Wunused-but-set-variable]
drivers/video/neofb.c:1924:6: warning: variable ‘maxWidth’ set but not used [-Wunused-but-set-variable]
drivers/video/neofb.c:1923:6: warning: variable ‘linearSize’ set but not used [-Wunused-but-set-variable]
drivers/video/neofb.c:1921:6: warning: variable ‘CursorMem’ set but not used [-Wunused-but-set-variable]
CC [M] drivers/video/tdfxfb.o
drivers/video/tdfxfb.c: In function ‘att_outb’:
drivers/video/tdfxfb.c:240:16: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]
CC [M] drivers/video/tridentfb.o
drivers/video/tridentfb.c: In function ‘set_vclk’:
drivers/video/tridentfb.c:616:6: warning: variable ‘f’ set but not used [-Wunused-but-set-variable]
drivers/video/tridentfb.c: In function ‘tridentfb_set_par’:
drivers/video/tridentfb.c:788:51: warning: variable ‘vblankend’ set but not used [-Wunused-but-set-variable]
CC [M] drivers/video/hgafb.o
CC [M] drivers/video/sstfb.o
drivers/video/sstfb.c:150:6: error: #elif with no expression
drivers/video/sstfb.c: In function ‘sst_detect_ics’:
drivers/video/sstfb.c:990:26: warning: variable ‘n_clk1_b’ set but not used [-Wunused-but-set-variable]
drivers/video/sstfb.c:990:16: warning: variable ‘n_clk0_7’ set but not used [-Wunused-but-set-variable]
drivers/video/sstfb.c:990:6: warning: variable ‘n_clk0_1’ set but not used [-Wunused-but-set-variable]
make[2]: *** [drivers/video/sstfb.o] Error 1
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2
解决方法:定位到
drivers/video/sstfb.c:150:6: error: #elif with no expression
将elif 改为else
3、mutex.c:(.sched.text+0x1aca): undefined reference to `__mutex_lock_slowpath'
kernel/built-in.o: In function `.text.lock.mutex':
mutex.c:(.sched.text+0x1aca): undefined reference to `__mutex_lock_slowpath'
mutex.c:(.sched.text+0x1ad4): undefined reference to `__mutex_unlock_slowpath'
make: *** [.tmp_vmlinux1] Error 1
/*
* In the DEBUG case we are using the "NULL fastpath" for mutexes,
* which forces all calls into the slowpath:
*/
#ifdef CONFIG_DEBUG_MUTEXES
# include "mutex-debug.h"
# include <asm-generic/mutex-null.h>
#else
# include "mutex.h"
# include <asm/mutex.h>
#endif
解释: CONFIG_DEBUG_MUTEXES控制了头文件的包含关系,搜索配置文件 .config 可以看到CONFIG_DEBUG_MUTEXES并没有定义。
解决方案:将 .config 文件中的 CONFIG_DEBUG_MUTEXES 宏 值必为 y 即可。(位于2747行。或者 用命令『vim』查找 /CONFIG_DEBUG_MUTEXES
)