mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Sam Ravnborg <sam@ravnborg.org>
Cc: "David S. Miller" <davem@redhat.com>,
	Andreas Steinmetz <ast@domdv.de>,
	axboe@suse.de, schilling@fokus.fraunhofer.de,
	linux-kernel@vger.kernel.org
Subject: Re: Kernel includefile bug not fixed after a year :-(
Date: 02 Oct 2003 00:42:43 -0600	[thread overview]
Message-ID: <m1lls4gmxo.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20030930161018.GA900@mars.ravnborg.org>

Sam Ravnborg <sam@ravnborg.org> writes:

> On Tue, Sep 30, 2003 at 05:23:37AM -0700, David S. Miller wrote:
> > 
> > Suggest changes to fix the problems, but just saying "don't include
> > kernel header in your user apps, NYAH NYAH NYAH!" does not help
> > anyone at all.

One nasty part of the issue is that glibc has decided it is the master
of types and the glibc ABI is not compatible with the kernel ABI with
some fundamental types like dev_t.
 
> I really liked the proposal that Matthew Wilcox came up with:
> 
> Todays hirachi:
> include/linux		=>	Kernel wide internal
> include/sub-system	=>	sub-system internal
> include/asm-$(ARCH)	=>	arch specific
> include/asm		=>	symlink to include/asm-$(ARCH)
> include/asm-generic	=>	default arch implementations
> 
> Additional hirachy:
> usr/include/linux-abi	=>	kernel wide ABI
> usr/include/abi-$(ARCH)	=>	arch specifics ABI
> usr/include/arch-abi	=>	symlink to above

One case that does not handle cleanly because of the symlink
is cross compilation.  With a proliferation of 32/64bit architectures
I think that is something worth considering.

So I would make that:
include/linux-abi/              => kernel wide ABI
include/linux-abi/abi-$(ARCH)/  => arch specifics ABI
include/linux-abi/features.h    => Environment abstractor.

<linux-abi/features.h> would define a macro __LINUX_ARCH that used
like:  ``#include __LINUX_ARCH(syscalls.h)''

And the __LINUX_ARCH(X) would expand to the include directory
for the various architectures as appropriate.  

Something else that needs to happen is that all definitions that
are in flux should be surrounded with an #ifdef LINUX_EXPERIMENTAL or
something similar.  So people don't start using an ABI that is in
flux by mistake.

All type names need to have a __linux_ prefix so we do not pollute
the C namespace, and because our types and the types glibc
exports to user space are different.

All defines for ioctls and the like should be prefixed with __LINUX_
again because user space may be doing something different. 

For glibc and the like it should be easy enough to write a perl
script that identify what definitions are in the headers and creates
definitions for their saner cousins.  It is either that or we need
to define an interface definition language and have tools to process
that.

Fixed sized types need to be derived from stdint.h when compiling
in user space, so they work with any weird compiler around.

We should make this the plan of record for 2.7.  But this is nothing
to rush into because once it is decided what the architecture is going
to be or where a definition should live we really cannot move it,
except during the kernel development cycle when the definitions are
introduced.  

Eric

  parent reply	other threads:[~2003-10-02  6:43 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-30 11:44 Joerg Schilling
2003-09-30 11:54 ` Jens Axboe
2003-09-30 12:12   ` Andreas Steinmetz
2003-09-30 12:21     ` Jens Axboe
2003-09-30 12:26       ` Andreas Steinmetz
2003-09-30 12:30         ` Jens Axboe
2003-09-30 12:32       ` David S. Miller
2003-09-30 12:40         ` Jens Axboe
2003-09-30 12:39           ` David S. Miller
2003-09-30 12:23     ` David S. Miller
2003-09-30 12:28       ` Jens Axboe
2003-09-30 12:34         ` David S. Miller
2003-09-30 12:42           ` Jens Axboe
2003-09-30 19:09         ` Erik Andersen
2003-10-01  8:48           ` Paul Rolland
2003-10-01  8:55             ` Arjan van de Ven
2003-10-01 17:49             ` Erik Andersen
2003-09-30 16:10       ` Sam Ravnborg
2003-10-01  6:39         ` David S. Miller
2003-10-02  6:42         ` Eric W. Biederman [this message]
2003-09-30 19:04       ` Erik Andersen
2003-09-30 12:25     ` Nick Piggin
2003-09-30 19:00     ` Erik Andersen
2003-10-01  8:47       ` Paul Rolland
  -- strict thread matches above, loose matches on Subject: below --
2003-10-01  1:05 Albert Cahalan
2003-09-30 13:26 Joerg Schilling
2003-09-30 12:52 Joerg Schilling
2003-09-30 12:37 Joerg Schilling
2003-09-30 13:21 ` Tomas Szepe
2003-09-30 11:57 Joerg Schilling
2003-09-30 12:06 ` Jens Axboe
2003-09-30 12:28   ` David S. Miller
2003-09-30 12:38     ` Jens Axboe
2003-09-30 14:41       ` Krzysztof Halasa
2003-10-10  6:36     ` Sandy Harris
2003-09-30 10:28 Joerg Schilling
2003-09-30 11:05 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1lls4gmxo.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ast@domdv.de \
    --cc=axboe@suse.de \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=schilling@fokus.fraunhofer.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®