All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Shuah Khan <shuah@kernel.org>, Zhangjin Wu <falcon@tinylab.org>,
	Yuan Tan <tanyuan@tinylab.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 1/2] tools/nolibc: add stdarg.h header
Date: Tue, 29 Aug 2023 11:26:19 +0200	[thread overview]
Message-ID: <ZO25u3crGixkGKWe@1wt.eu> (raw)
In-Reply-To: <2b6c62f1-c1f1-4f2c-ba0c-981e066f4268@t-8ch.de>

On Tue, Aug 29, 2023 at 11:14:09AM +0200, Thomas Weißschuh wrote:
> Hi Willy!
> 
> On 2023-08-29 08:28:27+0200, Willy Tarreau wrote:
> > On Sun, Aug 27, 2023 at 10:00:15AM +0200, Thomas Weißschuh wrote:
> > > This allows nolic to work with `-nostdinc` avoiding any reliance on
> > > system headers.
> > > 
> > > The implementation has been lifted from musl libc 1.2.4.
> > > There is already an implementation of stdarg.h in include/linux/stdarg.h
> > > but that is GPL licensed and therefore not suitable for nolibc.
> > 
> > I'm a bit confused because for me, stdarg was normally provided by the
> > compiler, but I could be mistaken. It's just that it reminds me not so
> > old memories. Therefore maybe we just need to include or define
> > "something" to use it.
> 
> It is indeed provided by the compiler.

OK. But then, doesn't it mean that if we don't provide our stdarg.h,
the compilers' will be used ? I'm asking because we're already using
va_list and va_args, for example in vfprintf() in stdio.h, which
precisely includes <stdarg.h> so it must indeed come from the compiler.

> I could not find anybody doing this differently.
> Using builtins seems to me to be the normal way to expose compiler
> implementation specifics.

OK but it's already what the compiler does itself in its own stdarg that
is provided. That's why I don't understand what specific case we're trying
to cover here, I feel like we're providing an alternate stdarg in case the
compiler doesn't provide one except that I've not seen a compiler not
provide it (even tcc comes with it), it's like stddef.

Thanks,
Willy

  reply	other threads:[~2023-08-29  9:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27  8:00 [PATCH 0/2] nolibc: remove reliance on system headers Thomas Weißschuh
2023-08-27  8:00 ` [PATCH 1/2] tools/nolibc: add stdarg.h header Thomas Weißschuh
2023-08-29  6:28   ` Willy Tarreau
2023-08-29  9:14     ` Thomas Weißschuh
2023-08-29  9:26       ` Willy Tarreau [this message]
2023-08-29 10:16         ` Thomas Weißschuh
2023-08-29 12:12           ` Willy Tarreau
2023-08-30  6:21             ` Thomas Weißschuh
2023-08-30  7:23               ` Willy Tarreau
2023-08-30  7:27   ` Willy Tarreau
2023-08-27  8:00 ` [PATCH 2/2] selftests/nolibc: use -nostdinc for nolibc-test Thomas Weißschuh

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=ZO25u3crGixkGKWe@1wt.eu \
    --to=w@1wt.eu \
    --cc=falcon@tinylab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=shuah@kernel.org \
    --cc=tanyuan@tinylab.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.