|
发表于 2003-10-29 15:59:31
|
显示全部楼层
[quote:ca478e60f5="yihe_guo"]多谢各位高手的指点,我修改了/usr/include/linux/version.h问题解决了,但有一点没想明白,到底kernel gcc版本问题是怎么回事,尽靠修改头文件会不会为以后带来隐患?
还有一个问题编写程序的头文件#include <linux/*> ,他的路经是在/usr/src/linux/include/linux还是/usr/include/linux 而且我发现里边文件数目不同,同一文件名的内容也不同,我想编写一个驱动程序模块,如何理解该问题?[/quote]
Your questions are very good! You think of the same questions as I once did.
1,"隐患"
At first, gcc is just a compiler and, as far as Compiling Principle is concerned, header files are none business of the comiler(gcc) itself(at least to some extent), but of the C library(glibc). If you worry about it, and if you want to DIY all, I recommand a helpful way to you:
1. recompile your kernel: linux-x.y.z
2. recompile your glibc with options "--with-headers=/usr/src/linux-x.y.z/include"
3. when compiling kernel module, use the gcc option "-I/usr/src/linux-x.y.z/include" or simply, delete /usr/include/linux and asm, and link linux-x.y.z/linux and asm-i386 to there.
Still any "隐患"?
2."路经"
/usr/src/linux/include/(, with which your kernel was built !) is always proper. |
|