lkml.org 
[lkml]   [2015]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h>

* Mikko Rapeli <mikko.rapeli@iki.fi> wrote:

> On Sat, Sep 05, 2015 at 01:59:43PM +0200, Ingo Molnar wrote:
> >
> > * Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> >
> > > > diff --git a/arch/x86/include/uapi/asm/sigcontext32.h b/arch/x86/include/uapi/asm/sigcontext32.h
> > > > index a92b0f0dc09e..8b870175befa 100644
> > > > --- a/arch/x86/include/uapi/asm/sigcontext32.h
> > > > +++ b/arch/x86/include/uapi/asm/sigcontext32.h
> > > > @@ -3,6 +3,6 @@
> > > >
> > > > /* This is a legacy file - all the type definitions are in sigcontext.h: */
> > > >
> > > > -#include <asm/sigcontext.h>
> > > > +#include <uapi/asm/sigcontext.h>
> > >
> > > This needs to be without uapi directory in path.
> >
> > What do you mean?
>
> There is not uapi in path in userspace so it fails to compile:

Ok, I see. So it's not common, but I don't think there's an outright prohibition
for uapi headers to refer to each other:

arch/hexagon/include/uapi/asm/signal.h:#include <uapi/asm/registers.h>
arch/mips/include/uapi/asm/siginfo.h:#include <uapi/asm-generic/siginfo.h>
arch/x86/include/uapi/asm/sigcontext32.h:#include <uapi/asm/sigcontext.h>

There are a couple of solutions:

- copy the uapi/ directory if you take the kernel headers as-is

- adapt the headers to the old user-space layout when you import them.
(i.e. do a sed -i 's/<uapi/</' on them).

- create a symbolic link from asm/uapi to asm/ in user-space.

The kernel side solutions are uglier:

- We could create a symbolic link from asm/uapi/sigcontext32.h to
asm/uapi/sigcontext.h, although I'm not sure what the policy for that is in
the kernel repository - I think it's generally frowned upon.

- We could keep asm/sigcontext.h that includes asm/uapi/sigcontext.h - a
poor man's symbolic link.

OTOH the last option isn't all that ugly.

> This is the fix:
>
> --- a/arch/x86/include/uapi/asm/sigcontext32.h
> +++ b/arch/x86/include/uapi/asm/sigcontext32.h
> @@ -3,6 +3,6 @@
>
> /* This is a legacy file - all the type definitions are in sigcontext.h: */
>
> -#include <uapi/asm/sigcontext.h>
> +#include <asm/sigcontext.h>

There's no asm/sigcontext.h file anymore if you apply my patches - but we could
reintroduce it to make the copy of UAPI headers to user-space work as-is.

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-09-06 09:01    [W:0.067 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site