Messages in this thread | | | Date | Tue, 26 Mar 1996 01:37:18 +0200 | From | Andries.Brouwer@cwi ... | Subject | Re: Horrible things with 1.3.78 |
| |
Alberto Vignani:
: Should we avoid using stdlib.h in kernel files (i.e. this error was a Good : Thing), or we are only starting get into _very_ big compatibility troubles?
: Having to modify files like unistd.h or gnu/types.h could be a temporary : workaround, but it would be best to avoid changes to files not part of the : kernel tree.
The kernel must not depend on the libc include files. The libc include files must not depend on the kernel.
These very simple rules will keep us out of trouble. These very simple rules are absolutely necessary if we want to avoid a big mess.
There are a few problems in the kernel with this. Some compilations are needed in order to run configure scripts (like drivers/sound/configure, menuconfig, xconfig). For all we know we might be cross compiling. So, here we cannot use the kernel includes, and need the libc includes (for the host, not the target architecture). This means that in the top-level Makefile the code
HPATH = $(TOPDIR)/include HOSTCC =gcc -I$(HPATH)
is incorrect - we just need
HPATH = $(TOPDIR)/include HOSTCC =gcc
It also means that we already need to compile things before /usr/src/linux/include/linux/version.h exists. But the present libc includes do not work in such a situation. (For example, <ctype.h> includes <endian.h> which includes <bytesex.h> which includes <linux/version.h>.)
I compiled 1.3.78 by making the above change and pointing /usr/include/linux at the includes of some older kernel version.
I surely hope that it will be possible to convince HJLu that the libc includes should be distributed together with a copy of the kernel includes, for some appropriate kernel version (preferably with the parts between #ifdef __KERNEL__ ... #endif stripped out) and an indication: this libc works with kernel version 1.4.0 and later.
Imagine. No more symlinks. No more kernel source required on-line before one can translate something. No more programs that suddenly fail to translate, or show obscure bugs, after updating kernel source.
Andries
| |