public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: ldv@altlinux•org (Dmitry V. Levin)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] uapi: fix asm/signal.h userspace compilation errors
Date: Thu, 2 Mar 2017 18:48:45 +0300	[thread overview]
Message-ID: <20170302154845.GB3503@altlinux.org> (raw)
In-Reply-To: <CAE2sS1h9QNV+31GMSv8aahJYOb9hFtFp5Aj-yVOfg7cjBHr_kg@mail.gmail.com>

On Thu, Mar 02, 2017 at 10:22:18AM -0500, Carlos O'Donell wrote:
> On Wed, Mar 1, 2017 at 11:20 AM, Arnd Bergmann <arnd@arndb•de> wrote:
> > On Sun, Feb 26, 2017 at 2:01 AM, Dmitry V. Levin <ldv@altlinux•org> wrote:
> >> Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix asm/signal.h
> >> userspace compilation errors like this:
> >>
> >> /usr/include/asm/signal.h:126:2: error: unknown type name 'size_t'
> >>   size_t ss_size;
> >>
> >> As no uapi header provides a definition of size_t, inclusion
> >> of <stddef.h> seems to be the most conservative fix available.
[...]
> > I'm not sure if this is the best fix. We generally should not include one
> > standard header from another standard header. Would it be possible
> > to use __kernel_size_t instead of size_t?
> 
> In glibc we handle this with special use of __need_size_t with GCC's
> provided stddef.h.
> 
> For example glibc's signal.h does this:
> 
> # define __need_size_t
> # include <stddef.h>

Just to make it clear, do you suggest this approach for asm/signal.h as well?

[...]
> Changing the fundamental type causes the issues you see in patch v2
> where sizeof(size_t) < sizeof(__kernel_size_t).
> 
> It will only lead to problem substituting the wrong type.

I don't see any appetite for creating more ABIs like x32 with
sizeof(size_t) < sizeof(__kernel_size_t), so v2 approach
is not going to be any different from v1 in maintenance.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170302/f75b9e11/attachment.sig>

  reply	other threads:[~2017-03-02 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26  1:01 [PATCH] uapi: fix asm/signal.h userspace compilation errors Dmitry V. Levin
2017-03-01 16:20 ` Arnd Bergmann
2017-03-02  0:20   ` [PATCH v2] " Dmitry V. Levin
2017-03-02 15:22   ` [PATCH] " Carlos O'Donell
2017-03-02 15:48     ` Dmitry V. Levin [this message]
2017-03-04  1:23       ` Carlos O'Donell
2017-03-06 15:10         ` Carlos O'Donell

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=20170302154845.GB3503@altlinux.org \
    --to=ldv@altlinux$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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