linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] Decouple build from userspace headers
Date: Wed, 14 Jul 2021 11:42:28 +0300	[thread overview]
Message-ID: <YO6jdIlu5xy35nix@localhost.localdomain> (raw)
In-Reply-To: <CAK7LNATVysAEkcq86AD75njoXis67M4i+QVEfg5LawWzfC1h9g@mail.gmail.com>

On Wed, Jul 14, 2021 at 01:54:59PM +0900, Masahiro Yamada wrote:
> On Wed, Jul 14, 2021 at 4:47 AM Alexey Dobriyan <adobriyan@gmail.com> wrote:
> >
> > In theory, userspace headers can be under incompatible license.
> >
> > Linux by virtue of being OS kernel is fully independent piece of code
> > and should not require anything from userspace.
> 
> As far as I know,
> <stdarg.h> was the only exception,
> which was borrowed from the compiler.
> 
> 
> I like this as long as:
>   - license is clear (please add SPDX tag to the new header)
>   - it works for both gcc and clang (I guess the answer is yes)

It should. clang version is essentially the same
(with less prehistoric macrology).

> I think removing <stdbool.h> and <stddef.h> are non-controversial.
> Mayby, you can split it into 1/2.
> 
> 
> 
> 
> >
> > For this:
> >
> > * ship minimal <stdarg.h>
> >         2 types, 4 macros
> >
> > * delete "-isystem"
> >         This is what enables leakage.
> >
> > * fixup compilation where necessary.
> >
> > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> > ---
> >
> >  Makefile                                                               |    2 +-
> >  arch/um/include/shared/irq_user.h                                      |    1 -
> >  arch/um/os-Linux/signal.c                                              |    2 +-
> >  crypto/aegis128-neon-inner.c                                           |    2 --
> >  drivers/net/wwan/iosm/iosm_ipc_imem.h                                  |    1 -
> >  drivers/pinctrl/aspeed/pinmux-aspeed.h                                 |    1 -
> >  drivers/staging/media/atomisp/pci/hive_isp_css_common/host/isp_local.h |    2 --
> >  include/stdarg.h                                                       |    9 +++++++++
> >  sound/aoa/codecs/onyx.h                                                |    1 -
> >  sound/aoa/codecs/tas.c                                                 |    1 -
> >  10 files changed, 11 insertions(+), 11 deletions(-)
> >
> 
> > new file mode 100644
> > --- /dev/null
> > +++ b/include/stdarg.h
> > @@ -0,0 +1,9 @@
> 
> 
> This is a new file, so please add the SPDX tag.
> What project did you copy the code from?
> 
>   If gcc, is it GPL v3 (but not compatible for GPL v2) ?

It is GPL 2, brought to you by Debian! I'll add a link.

	http://archive.debian.org/debian/pool/main/g/gcc-4.2/

>   If clang, is it
>    SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
> 
> Or, can we license this small portion of code
> as GPL v2?
> 
> 
> 
> > +#ifndef _LINUX_STDARG_H
> > +#define _LINUX_STDARG_H
> > +typedef __builtin_va_list __gnuc_va_list;
> 
> Where is __gnuc_va_list needed?
> 
> BTW, once this is accepted, I'd like to
> change all <stdarg.h>  to <linux/stdarg.h>.

Yes. I've just realised <stdarg.h> is the wrong place:

  gcc -Wp,-MMD,scripts/selinux/genheaders/.genheaders.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89     -I/home/ad/linux/linux-1/include/uapi -I/home/ad/linux/linux-1/include -I/home/ad/linux/linux-1/security/selinux/include  -I ./scripts/selinux/genheaders   -o scripts/selinux/genheaders/genheaders /home/ad/linux/linux-1/scripts/selinux/genheaders/genheaders.c
In file included from /home/ad/linux/linux-1/scripts/selinux/genheaders/genheaders.c:6:
/usr/include/stdio.h:52:9: error: unknown type name ‘__gnuc_va_list’
   52 | typedef __gnuc_va_list va_list;

Or maybe <stdarg.h> is the right place by passing all those include
directories to userspace helpers is the wrong thing to do.

  reply	other threads:[~2021-07-14  8:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 19:47 [PATCH] Decouple build from userspace headers Alexey Dobriyan
2021-07-14  4:54 ` Masahiro Yamada
2021-07-14  8:42   ` Alexey Dobriyan [this message]
2021-07-14 14:22 ` Christoph Hellwig
2021-07-14 15:54   ` Alexey Dobriyan
2021-07-14 15:56     ` Christoph Hellwig
2021-07-14 17:16       ` Alexey Dobriyan
2021-07-14 17:45 ` [PATCH v2] " Alexey Dobriyan
2021-07-15 21:15   ` [PATCH -mm] fixup "Decouple build from userspace headers" Alexey Dobriyan
2021-07-18 12:36     ` Masahiro Yamada
2021-07-18 13:05       ` Masahiro Yamada
2021-07-16  9:03   ` [PATCH v2] Decouple build from userspace headers Anders Roxell
2021-07-16 10:10     ` Alexey Dobriyan
2021-07-16 13:04       ` Anders Roxell
2021-07-18 13:11       ` Masahiro Yamada
2021-07-20 16:13         ` Anders Roxell

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=YO6jdIlu5xy35nix@localhost.localdomain \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).