Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1219736

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

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h>
Date 2015-09-06 08:50 +0200
Message-ID <q5BW1-7SJ-1@gated-at.bofh.it> (permalink)
References <q5geR-2go-3@gated-at.bofh.it> <q5geS-2go-35@gated-at.bofh.it> <q5jmq-6Gh-7@gated-at.bofh.it> <q5ksa-8rE-15@gated-at.bofh.it> <q5kBQ-bb-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/15] x86/headers: Clean up sigcontext types and headers Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
  [PATCH 07/15] x86/headers: Unify 'struct _fpstate_ia32' and i386 struct _fpstate Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers: Unify 'struct _fpstate_ia32'   and i386 struct _fpstate tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:40 +0200
  [PATCH 08/15] x86/headers: Convert uses of _fpstate_ia32 to _fpstate_32 Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers:   Convert uses of _fpstate_ia32 to _fpstate_32 tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200
  [PATCH 06/15] x86/headers: Unify register type definitions between 32-bit compat and i386 Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers:   Unify register type definitions between 32-bit compat and i386 tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200
  [PATCH 12/15] x86/headers: Unify 'struct sigcontext_ia32' and 'struct sigcontext_32' Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers: Unify 'struct sigcontext_ia32'   and 'struct sigcontext_32' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200
  [PATCH 05/15] x86/headers: Use ABI types consistently in sigcontext*.h Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers:   Use ABI types consistently in sigcontext*.h tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200
  [PATCH 10/15] x86/headers: Move the 'struct sigcontext' definitions into the UAPI header Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers: Move the 'struct sigcontext'   definitions into the UAPI header tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200
  [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-05 13:00 +0200
      Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-05 14:10 +0200
        Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-05 14:20 +0200
          Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-06 08:50 +0200
            Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-06 22:30 +0200
              Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Ingo Molnar <mingo@kernel.org> - 2015-09-07 09:40 +0200
                Re: [PATCH 15/15] x86/headers: Remove <asm/sigcontext.h> Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-07 10:20 +0200
    [tip:x86/headers] x86/headers: Remove <asm/sigcontext.h>   references on the kernel side tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:40 +0200
      Re: [tip:x86/headers] x86/headers: Remove <asm/sigcontext.h>  references on the kernel side Mikko Rapeli <mikko.rapeli@iki.fi> - 2015-09-08 22:20 +0200
  [PATCH 04/15] x86/headers: Separate out legacy user-space structure definitions Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers:   Separate out legacy user-space structure definitions tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200
  [PATCH 01/15] x86/headers: Fix (old) header file dependency bug in uapi/asm/sigcontext32.h Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers: Fix (old)   header file dependency bug in uapi/asm/sigcontext32.h tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200
  [PATCH 09/15] x86/headers: Clean up the kernel's struct sigcontext types to be ABI-clean Ingo Molnar <mingo@kernel.org> - 2015-09-05 09:40 +0200
    [tip:x86/headers] x86/headers: Clean up the kernel'  s struct sigcontext types to be ABI-clean tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-09-08 16:30 +0200

csiph-web