Johannes Stezenbach wrote:
in /usr/include/linux and /usr/include/asm right. But to compile additional drivers you always need the include files for the currently installed header, that's why the DVB driver (and the scan utility too) used the includes from /us/src/linux-$(KERNELRELEASE)/include/.On Tue, Oct 29, 2002 at 04:05:25PM +0100, Holger Waechtler wrote:Stefan Hu�feldt wrote:scan from todays (CVS) DVB package doesn't compile:Your kernel include files are screwed up. /usr/include/linux, /usr/include/asm have to refer to the same kernel source. You should use header files of a recent kernel.
|[root@zaphod scan]# make
|gcc -M -g -Wall -O0 -I/usr/src/linux-2.4.19-16mdksmp/include -I../../include scan.c dump.c > .depend
|gcc -g -Wall -O0 -I/usr/src/linux-2.4.19-16mdksmp/include -I../../include -c scan.c -o scan.o
|In file included from /usr/include/linux/prefetch.h:13,
| from /usr/include/linux/list.h:6,
| from scan.c:13:
|/usr/include/asm/processor.h:55: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
|/usr/include/asm/processor.h:55: requested alignment is not a constant
|make: *** [scan.o] Fehler 1
|[root@zaphod scan]# rpm -q kernel-headers
|kernel-headers-2.4.18-41mdk
|[root@zaphod scan]# cat /etc/redhat-release |Mandrake Linux release 9.0 (dolphin) for i586
AFAIK the header files in /usr/include/linux and asm must match the glibc installed in the system. Replacing them with newer ones is not recommended. Sometimes it's necessary to supply newer driver API header files to use new ioctls (like for the DVB driver ;-), but in general you should leave the system header files alone.
The files from /usr/include/linux and /usr/include/asm were used by gcc as fallback because the actual includes were not found. Maybe we should add -nostdinc to the CFLAGS, then compilation is rejected and the fallbacks from /usr/include will never be used.
(illegal but working:)What scan.c does to use linux/list.h is simply illegal.
It was a quick hack to get a linked list implementation and would have worked fine if your kernel headers would had been installed correctly.
(Anyway, it's clean now - your computer science teacher should be happy too;)
When you don't install the include files for your currently running kernel (and compile everything that talks directly to the kernel against these header files, applications as well as driver modules) you always risk oopses and segfaults because nobody guarantees that data layout does not changes between kernel revisions.
Holger
--
Info:
To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as subject.
