mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: nix@esperi.org.uk, rob@landley.net, mmazur@kernel.pl,
	linux-kernel@vger.kernel.org, llh-discuss@lists.pld-linux.org
Subject: Re: State of userland headers
Date: Fri, 24 Mar 2006 15:01:00 -0800	[thread overview]
Message-ID: <20060324150100.ec96dc15.rdunlap@xenotime.net> (raw)
In-Reply-To: <D903C0E1-4F7B-4059-A25D-DD5AB5362981@mac.com>

On Fri, 24 Mar 2006 17:46:27 -0500 Kyle Moffett wrote:

> On Mar 24, 2006, at 16:48:47, Nix wrote:
> > On 24 Mar 2006, Rob Landley suggested tentatively:
> >> On Friday 24 March 2006 1:51 pm, Kyle Moffett wrote:
> >>> 1: Ewww, bad glibc!
> >>> 2: The symbols in kabi/*.h should probably all start with __kabi_
> >>
> >> Any grand new incompatible thing is something I will happily  
> >> ignore for as long as I am able to, and I'm not alone here.  Your  
> >> uptake will be zero.
> >
> > I concur. The purpose of this thing is by definition to provide  
> > libcs with the kernel/user interface stuff they need in order for  
> > userspace programs to be compiled. There's no point defining a new  
> > interface because there is a massive quantity of *existing* code  
> > out there that we must work with. (Plus, it can be, uh, difficult  
> > to get changes of this nature into glibc in particular, and glibc  
> > is the 300-pound gorilla in this particular room. If the headers  
> > don't have working with it as a goal, they are pointless.)
> 
> Hmm, I didn't really explain my idea very well.  Let me start with a  
> list of a facts.  If anybody disagrees with any part of this, please  
> let me know.
> 
> 1)  The <linux/*.h> headers include a lot of information essential to  
> compiling userspace applications and libraries (libcs in  
> particular).  That same information is also required while building  
> the kernel (IE: The ABI).
> 2)  Those headers have a lot of declarations and definitions which  
> must *not* be present while compiling userspace applications, and is  
> basically kernel-only stuff.
> 3)  Glibc is extremely large and complex 500-pound gorilla and  
> contains an ugly build process and a lot of static definitions in its  
> own header files that conflict with the definitions in the kernel  
> headers.
> 4)  UML runs into a lot of problems when glibc's headers and the  
> native kernel headers headers conflict.
> 
> Here's some of my opinions about this:
> 
> 1)  Trying to create and maintain 2 separate versions of an ABI as  
> large and complex as the kernel<=>userspace ABI across new versions  
> and features would be extremely difficult and result in subtle bugs  
> and missing features, even over a short period of time.
> 2)  Ideally there should be three distinct pieces, the kernel, the  
> ABI, and userspace.  Compiling either the kernel or userspace  
> requires the ABI, but the ABI depends only on the compiler.
> 3)  Breaking any compatibility is bad
> 4)  Trying to continue to maintain the glibc custom-header-file  
> status-quo as more APIs and architectures get added to the kernel is  
> going to become an increasingly difficult and tedious task.
> 
> My proposal (which I'm working on sample patches for) would be to  
> divide up the kernel headers into 2 parts.  The first part would be  
> <kabi/*.h>, and the second would be all the traditional kernel-only  
> headers.  The kabi headers would *only* define things that begin with  
> the prefix __kabi_.  This would mean that the kabi headers have no  
> risk of namespace contamination with anything else existing in the  
> kernel or userspace, and since they would depend only on the  
> compiler, they would be useable anywhere.
> 
> The second step would be to convert the traditional linux header to  
> include the corresponding kabi header, then redefine its own  
> structures and defines in terms of those in the kabi header.  This  
> would provide complete backwards compatibility to all kernel code, as  
> well as to anything that currently compiles using the existing kernel  
> headers.  The entire rest of the <linux/*.h> header file would be  
> wrapped in #ifdef __KERNEL__, as it should not be needed by anything  
> in userspace.
> 
> In the process of those two steps, we would relocate many of the  
> misplaced "#ifdef __KERNEL__" and "#endif /* __KERNEL__ */".  The  
> kabi headers should not mention __KERNEL__ at all, and the linux/*  
> headers should be almost completely wrapped in __KERNEL__ ifdefs.   
> That should be enough to make klibc build correctly, although from  
> the description glibc needs significantly more work.
> 
> Once a significant portion of the kernel headers have been split that  
> way (preserving complete backwards compatibility), external projects  
> _may_ be converted to #include <kabi/*.h> instead of #include <linux/ 
> *.h>, although this would require other changes to the source to  
> handle the __kabi_ prefix.  Most of those should be straightforward,  
> however.  Since the kabi/*.h headers would not be kernel-version- 
> specific, they could be copied to a system running an older kernel  
> and reused there without problems.  Even though some of the syscalls  
> and ioctls referenced in the kabi headers might not be present on the  
> running kernel, portable programs are expected to be able to sanely  
> handle older kernels.
> 
> Once the kabi headers are available, it would be possible to begin  
> cleaning up many of the glibc headers without worrying about  
> differences between architectures.  If all critical constants and  
> datatypes are already defined in <kabi/*.h> with __kabi_ or __KABI_  
> prefixes, it should be possible to import those definitions into  
> klibc and glibc without much effort.
> 
> UML has other issues with conflicts between the native kernel headers  
> and the GLIBC-provided stubs.  It's been mentioned on the prior  
> threads about this topic that this sort of system would ease most of  
> the issues that UML runs into.
> 
> I'm working on some sample patches now which I'll try to post in a  
> few days if I get the time.

Kyle,
Do you have (recorded) or recall any constraints or requirements
on this $subject from Linus or Andrew or others?
I mean just basic big items, like "thou shalt not mix foo and bar".

I'm just looking for the basic parameters of this task.

Thanks,
---
~Randy

  reply	other threads:[~2006-03-24 22:58 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 15:19 [ANNOUNCE] linux-libc-headers dead Mariusz Mazur
2006-03-14 15:28 ` Ismail Donmez
2006-03-16  8:37 ` [llh-announce] " Nigel Kukard
2006-03-16 20:20   ` Jan Engelhardt
2006-03-16 20:42     ` Dan Kegel
2006-03-17  7:56 ` DervishD
2006-03-23 17:11 ` State of userland headers Mariusz Mazur
2006-03-23 23:04   ` Rob Landley
2006-03-26 13:12     ` Mariusz Mazur
2006-03-26 20:59       ` Rob Landley
2006-03-24 18:51   ` Kyle Moffett
2006-03-24 21:23     ` Rob Landley
     [not found]       ` <878xqzpl8g.fsf@hades.wkstn.nix>
2006-03-24 22:46         ` Kyle Moffett
2006-03-24 23:01           ` Randy.Dunlap [this message]
2006-03-25  6:48             ` Kyle Moffett
2006-03-28 20:17               ` Jim Gifford
2006-03-25  1:36           ` Jeff Dike
2006-03-25  6:33             ` Kyle Moffett
2006-03-25 16:03               ` Jeff Dike
2006-03-25  3:19           ` Rob Landley
2006-03-25  6:27             ` Kyle Moffett
2006-03-26 11:52           ` [RFC][PATCH 0/2] KABI example conversion and cleanup Kyle Moffett
2006-03-26 11:54             ` [RFC][PATCH 1/2] Create initial kernel ABI header infrastructure Kyle Moffett
2006-03-26 12:32               ` Arjan van de Ven
2006-03-26 12:50                 ` Kyle Moffett
2006-03-26 12:59                   ` Martin Mares
2006-03-26 13:14                     ` Kyle Moffett
2006-03-26 15:38                       ` Martin Mares
2006-03-26 16:16                         ` Kyle Moffett
2006-03-26 14:39                   ` Arjan van de Ven
2006-03-26 15:23                     ` Kyle Moffett
2006-03-29 22:26                   ` Pavel Machek
2006-04-02  0:22                     ` Randy.Dunlap
2006-04-02  2:42                       ` Kyle Moffett
2006-04-02  3:01                         ` Arjan van de Ven
2006-04-02  5:53                           ` Kyle Moffett
2006-04-02 13:09                             ` Arjan van de Ven
2006-04-02 10:32                         ` Pavel Machek
2006-04-02 11:16                           ` Kyle Moffett
2006-03-26 20:05               ` Sam Ravnborg
2006-03-26 20:39                 ` Kyle Moffett
2006-03-26 21:26                   ` Sam Ravnborg
2006-03-27  0:27                     ` Kyle Moffett
2006-03-26 11:55             ` [RFC][PATCH 2/2] Generalize fd_set handling across architectures Kyle Moffett
2006-03-26 12:06             ` [RFC][PATCH 0/2] KABI example conversion and cleanup Kyle Moffett
2006-03-26 13:43               ` Nix
2006-03-26 12:26             ` Arjan van de Ven
2006-03-26 12:30               ` Arjan van de Ven
2006-03-26 12:34               ` Kyle Moffett
2006-03-26 13:22                 ` Giuseppe Bilotta
2006-03-26 13:29                 ` Avi Kivity
2006-03-26 13:47                   ` Kyle Moffett
2006-03-26 13:53                     ` Giuseppe Bilotta
2006-03-26 14:30                       ` Kyle Moffett
2006-03-26 14:45                         ` Giuseppe Bilotta
2006-03-26 17:24                     ` Avi Kivity
2006-03-26 17:29                       ` Arjan van de Ven
2006-03-26 17:57                         ` Avi Kivity
2006-03-26 18:32                           ` Arjan van de Ven
2006-03-26 21:18                           ` Rob Landley
2006-03-27  0:18                             ` Kyle Moffett
2006-03-27  6:19                             ` Avi Kivity
2006-03-27 19:48                               ` Rob Landley
2006-03-28 20:04                                 ` Mariusz Mazur
2006-03-28 20:13                                   ` Kyle Moffett
2006-03-28 22:57                                   ` Rob Landley
2006-03-26 20:55                 ` Rob Landley
2006-03-27  0:12                   ` Kyle Moffett
2006-03-26 14:31             ` Eric Piel
2006-03-26 21:09               ` Rob Landley
2006-03-26 23:06                 ` Eric Piel
2006-03-27  0:40                   ` Kyle Moffett
2006-03-27  3:12                     ` Jeff Dike
2006-03-28 14:20                     ` Jan Engelhardt
2006-03-28 15:57                       ` [OT] Non-GCC compilers used for linux userspace Kyle Moffett
2006-03-28 16:13                         ` Eric Piel
2006-03-28 16:20                           ` Kyle Moffett
2006-03-28 16:59                             ` Jason L Tibbitts III
2006-03-28 17:13                               ` Kyle Moffett
2006-03-28 17:28                                 ` Daniel Jacobowitz
2006-03-28 17:41                                   ` Kyle Moffett
2006-04-05 17:01                                 ` Bryan O'Sullivan
2006-03-28 17:08                             ` Jan-Benedict Glaw
2006-03-28 17:56                             ` Jesper Juhl
2006-03-28 21:47                             ` Rob Landley
2006-03-29 21:23                               ` Nix
2006-03-30  1:36                                 ` Rob Landley
2006-03-30  7:24                                   ` Nix
2006-03-30 20:26                                     ` Rob Landley
2006-03-30 22:02                                       ` Nix
2006-03-30 23:00                                         ` Harald Arnesen
2006-03-30 23:16                                         ` Rob Landley
2006-03-29 13:25                             ` Mathieu Chouquet-Stringer
2006-03-28 18:44                           ` Eric W. Biederman
2006-03-29  4:26                         ` Peter Chubb
2006-03-30 15:15                         ` Roger Heflin
2006-03-28 17:16                       ` [RFC][PATCH 0/2] KABI example conversion and cleanup Ben Pfaff
2006-03-28 17:08                     ` Catalin Marinas
2006-03-31  0:20             ` Arch-specific header inconsistency (asm-*/termios.h) Kyle Moffett
2006-04-02 17:58             ` [RFC][PATCH 0/2] KABI example conversion and cleanup Sam Ravnborg
2006-04-02 19:30               ` Kyle Moffett
2006-04-02 20:47                 ` Arnd Bergmann

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=20060324150100.ec96dc15.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llh-discuss@lists.pld-linux.org \
    --cc=mmazur@kernel.pl \
    --cc=mrmacman_g4@mac.com \
    --cc=nix@esperi.org.uk \
    --cc=rob@landley.net \
    /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®