[PATCH 0/8] nolibc: small updates required for the self-tests

Willy Tarreau posted 8 patches 4 years, 3 months ago
tools/Makefile                |  4 ++++
tools/include/nolibc/Makefile | 43 +++++++++++++++++++++++++++++++++++
tools/include/nolibc/stdio.h  | 32 +++++++++++++++++---------
tools/include/nolibc/stdlib.h | 23 +++++++++++++++++++
tools/include/nolibc/string.h | 23 +++++++++++++++++++
tools/include/nolibc/sys.h    | 17 ++++++++++++++
tools/include/nolibc/types.h  | 10 ++++++++
7 files changed, 141 insertions(+), 11 deletions(-)
create mode 100644 tools/include/nolibc/Makefile
[PATCH 0/8] nolibc: small updates required for the self-tests
Posted by Willy Tarreau 4 years, 3 months ago
Hello Paul,

while developing the nolibc self-tests, I naturally faced a few
limitations ranging from missing POLL* flags to missing strcmp() or
getenv(), as well as the ability for printf() to print "(null)" on
"%s" instead of crashing.

This series adds a makefile and a headers installation target that
creates a sysroot made of kernel headers and nolibc headers, which
significantly ease building programs.

I already have some test code with roughly 75 tests, but I find it
misplaced in the nolibc dir, I need to move it to testing/selftests/
before sending it to you.

This series is intended to be an add-on to what you already have in your
dev branch. I don't intend to send you much more stuff on top of this,
but I expect to see an update from Ammar's patch set (CCed). With all
this I think we'll have a good basis to easily add new tests.

Thanks!
Willy

---
Willy Tarreau (8):
  tools/nolibc/stdio: make printf(%s) accept NULL
  tools/nolibc/stdlib: add a simple getenv() implementation
  tools/nolibc/stdio: add support for '%p' to vfprintf()
  tools/nolibc/string: add strcmp() and strncmp()
  tools/nolibc/sys: add syscall definition for getppid()
  tools/nolibc/types: add poll() and waitpid() flag definitions
  tools/nolibc: add a makefile to install headers
  tools/nolibc: add the nolibc subdir to the common Makefile

 tools/Makefile                |  4 ++++
 tools/include/nolibc/Makefile | 43 +++++++++++++++++++++++++++++++++++
 tools/include/nolibc/stdio.h  | 32 +++++++++++++++++---------
 tools/include/nolibc/stdlib.h | 23 +++++++++++++++++++
 tools/include/nolibc/string.h | 23 +++++++++++++++++++
 tools/include/nolibc/sys.h    | 17 ++++++++++++++
 tools/include/nolibc/types.h  | 10 ++++++++
 7 files changed, 141 insertions(+), 11 deletions(-)
 create mode 100644 tools/include/nolibc/Makefile

-- 
2.35.1
Re: [PATCH 0/8] nolibc: small updates required for the self-tests
Posted by Paul E. McKenney 4 years, 3 months ago
On Mon, Mar 21, 2022 at 06:33:06PM +0100, Willy Tarreau wrote:
> Hello Paul,
> 
> while developing the nolibc self-tests, I naturally faced a few
> limitations ranging from missing POLL* flags to missing strcmp() or
> getenv(), as well as the ability for printf() to print "(null)" on
> "%s" instead of crashing.
> 
> This series adds a makefile and a headers installation target that
> creates a sysroot made of kernel headers and nolibc headers, which
> significantly ease building programs.
> 
> I already have some test code with roughly 75 tests, but I find it
> misplaced in the nolibc dir, I need to move it to testing/selftests/
> before sending it to you.
> 
> This series is intended to be an add-on to what you already have in your
> dev branch. I don't intend to send you much more stuff on top of this,
> but I expect to see an update from Ammar's patch set (CCed). With all
> this I think we'll have a good basis to easily add new tests.

I have pulled this series in for review and testing, thank you!

It won't go into -next until v5.18-rc1 comes out, in about two weeks,
but it will at least be in -rcu.

I removed an ostensibly extraneous blank line from the end of
tools/include/nolibc/Makefile.  So please let me know if that blank line
is actually necessary.

							Thanx, Paul

> Thanks!
> Willy
> 
> ---
> Willy Tarreau (8):
>   tools/nolibc/stdio: make printf(%s) accept NULL
>   tools/nolibc/stdlib: add a simple getenv() implementation
>   tools/nolibc/stdio: add support for '%p' to vfprintf()
>   tools/nolibc/string: add strcmp() and strncmp()
>   tools/nolibc/sys: add syscall definition for getppid()
>   tools/nolibc/types: add poll() and waitpid() flag definitions
>   tools/nolibc: add a makefile to install headers
>   tools/nolibc: add the nolibc subdir to the common Makefile
> 
>  tools/Makefile                |  4 ++++
>  tools/include/nolibc/Makefile | 43 +++++++++++++++++++++++++++++++++++
>  tools/include/nolibc/stdio.h  | 32 +++++++++++++++++---------
>  tools/include/nolibc/stdlib.h | 23 +++++++++++++++++++
>  tools/include/nolibc/string.h | 23 +++++++++++++++++++
>  tools/include/nolibc/sys.h    | 17 ++++++++++++++
>  tools/include/nolibc/types.h  | 10 ++++++++
>  7 files changed, 141 insertions(+), 11 deletions(-)
>  create mode 100644 tools/include/nolibc/Makefile
> 
> -- 
> 2.35.1
>
Re: [PATCH 0/8] nolibc: small updates required for the self-tests
Posted by Willy Tarreau 4 years, 3 months ago
On Mon, Mar 21, 2022 at 01:29:08PM -0700, Paul E. McKenney wrote:
> On Mon, Mar 21, 2022 at 06:33:06PM +0100, Willy Tarreau wrote:
> > Hello Paul,
> > 
> > while developing the nolibc self-tests, I naturally faced a few
> > limitations ranging from missing POLL* flags to missing strcmp() or
> > getenv(), as well as the ability for printf() to print "(null)" on
> > "%s" instead of crashing.
> > 
> > This series adds a makefile and a headers installation target that
> > creates a sysroot made of kernel headers and nolibc headers, which
> > significantly ease building programs.
> > 
> > I already have some test code with roughly 75 tests, but I find it
> > misplaced in the nolibc dir, I need to move it to testing/selftests/
> > before sending it to you.
> > 
> > This series is intended to be an add-on to what you already have in your
> > dev branch. I don't intend to send you much more stuff on top of this,
> > but I expect to see an update from Ammar's patch set (CCed). With all
> > this I think we'll have a good basis to easily add new tests.
> 
> I have pulled this series in for review and testing, thank you!
> 
> It won't go into -next until v5.18-rc1 comes out, in about two weeks,
> but it will at least be in -rcu.

Perfect, thank you!

> I removed an ostensibly extraneous blank line from the end of
> tools/include/nolibc/Makefile.  So please let me know if that blank line
> is actually necessary.

Oh I'm very sorry, that the type of thing I'm very careful about so it
has definitely escaped my checks.

Thanks,
Willy
Re: [PATCH 0/8] nolibc: small updates required for the self-tests
Posted by Paul E. McKenney 4 years, 3 months ago
On Mon, Mar 21, 2022 at 09:33:19PM +0100, Willy Tarreau wrote:
> On Mon, Mar 21, 2022 at 01:29:08PM -0700, Paul E. McKenney wrote:
> > On Mon, Mar 21, 2022 at 06:33:06PM +0100, Willy Tarreau wrote:
> > > Hello Paul,
> > > 
> > > while developing the nolibc self-tests, I naturally faced a few
> > > limitations ranging from missing POLL* flags to missing strcmp() or
> > > getenv(), as well as the ability for printf() to print "(null)" on
> > > "%s" instead of crashing.
> > > 
> > > This series adds a makefile and a headers installation target that
> > > creates a sysroot made of kernel headers and nolibc headers, which
> > > significantly ease building programs.
> > > 
> > > I already have some test code with roughly 75 tests, but I find it
> > > misplaced in the nolibc dir, I need to move it to testing/selftests/
> > > before sending it to you.
> > > 
> > > This series is intended to be an add-on to what you already have in your
> > > dev branch. I don't intend to send you much more stuff on top of this,
> > > but I expect to see an update from Ammar's patch set (CCed). With all
> > > this I think we'll have a good basis to easily add new tests.
> > 
> > I have pulled this series in for review and testing, thank you!
> > 
> > It won't go into -next until v5.18-rc1 comes out, in about two weeks,
> > but it will at least be in -rcu.
> 
> Perfect, thank you!
> 
> > I removed an ostensibly extraneous blank line from the end of
> > tools/include/nolibc/Makefile.  So please let me know if that blank line
> > is actually necessary.
> 
> Oh I'm very sorry, that the type of thing I'm very careful about so it
> has definitely escaped my checks.

"To err is human!"  ;-)

							Thanx, Paul