Re: [PATCH 2/5] nolibc: add support for s390

From: Willy Tarreau
Date: Sat Dec 10 2022 - 04:13:21 EST


On Fri, Dec 09, 2022 at 03:19:36PM +0100, Sven Schnelle wrote:
> Use arch-x86_64 as a template. Not really different, but
> we have our own mmap syscall which takes a structure instead
> of discrete arguments.

I'm fine with placing the mmap syscall inside the arch-s390 file, though
it differs from what's done for other syscalls. But I admit that mmap is
one of these syscalls that differ between various archs and that it's not
shocking to leave it per-arch.

However you're having an issue here:

> diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h
> new file mode 100644
> index 000000000000..34b744e2f7d6
> --- /dev/null
> +++ b/tools/include/nolibc/arch-s390.h
^^^^^^^^^
vs:

> diff --git a/tools/include/nolibc/arch.h b/tools/include/nolibc/arch.h
> index 4c6992321b0d..fcded65b98d7 100644
> --- a/tools/include/nolibc/arch.h
> +++ b/tools/include/nolibc/arch.h
> @@ -27,6 +27,8 @@
> #include "arch-mips.h"
> #elif defined(__riscv)
> #include "arch-riscv.h"
> +#elif defined(__s390x__)
> +#include "arch-s390x.h"
^^^^^^^^^^

As you see the file is not the same so if you build by including nolibc.h
directly it will not work. The difference between s390 and s390x has never
been very clear to me, so I can't easily suggest which name is the most
suitable, but you'll definitely have to choose one :-) If it's just a
matter of dropping that trailing 'x' there, I think we can fix your patch
here without re-submitting, let us know.

Once this one is fixed, I'm fine with this:

Acked-by: Willy Tarreau <w@xxxxxx>

Willy