lkml.org 
[lkml]   [1996]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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





\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.068 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site