Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h>

From: Ingo Molnar
Date: Sun Sep 06 2015 - 02:42:04 EST



* Mikko Rapeli <mikko.rapeli@xxxxxx> wrote:

> On Sat, Sep 05, 2015 at 01:59:43PM +0200, Ingo Molnar wrote:
> >
> > * Mikko Rapeli <mikko.rapeli@xxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/