Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org,
	thomas@t-8ch.de
Subject: Re: [PATCH v5 1/5] tools/nolibc: fix up #error compile failures with -ENOSYS
Date: Sun, 2 Jul 2023 18:51:27 +0200	[thread overview]
Message-ID: <20230702165127.GC16233@1wt.eu> (raw)
In-Reply-To: <1a823ba7b250ba5190f802dfc4428d4e248f71b3.1687176996.git.falcon@tinylab.org>

Hi Zhangjin,

On Mon, Jun 19, 2023 at 08:24:15PM +0800, Zhangjin Wu wrote:
> Compiling nolibc for rv32 got such errors:
> 
>     In file included from nolibc/sysroot/riscv/include/nolibc.h:99,
>                      from nolibc/sysroot/riscv/include/errno.h:26,
>                      from nolibc/sysroot/riscv/include/stdio.h:14,
>                      from tools/testing/selftests/nolibc/nolibc-test.c:12:
>     nolibc/sysroot/riscv/include/sys.h:946:2: error: #error Neither __NR_ppoll nor __NR_poll defined, cannot implement sys_poll()
>       946 | #error Neither __NR_ppoll nor __NR_poll defined, cannot implement sys_poll()
>           |  ^~~~~
>     nolibc/sysroot/riscv/include/sys.h:1062:2: error: #error None of __NR_select, __NR_pselect6, nor __NR__newselect defined, cannot implement sys_select()
>      1062 | #error None of __NR_select, __NR_pselect6, nor __NR__newselect defined, cannot implement sys_select()
> 
> If a syscall is not supported by a target platform, 'return -ENOSYS' is
> better than '#error', which lets the other syscalls work as-is and
> allows developers to fix up the test failures reported by nolibc-test
> one by one later.
> 
> This converts all of the '#error' to 'return -ENOSYS', so, all of the
> '#error' failures are fixed.

Yeah, I like this! Initially we wanted the ifdef to spot include file
issues (which were the major concern at the beginning), and the selftest
was very limited. But now the coverage has significantly improved, the
major concern is cross-platform support and we know we won't get all of
it at once, so -ENOSYS is far better.

Thanks for this!
Willy

  reply	other threads:[~2023-07-02 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 12:22 [PATCH v5 0/5] nolibc: add part2 of support for rv32 Zhangjin Wu
2023-06-19 12:24 ` [PATCH v5 1/5] tools/nolibc: fix up #error compile failures with -ENOSYS Zhangjin Wu
2023-07-02 16:51   ` Willy Tarreau [this message]
2023-06-19 12:25 ` [PATCH v5 2/5] tools/nolibc: fix up undeclared syscall macros with #ifdef and -ENOSYS Zhangjin Wu
2023-06-19 12:27 ` [PATCH v5 3/5] selftests/nolibc: allow customize kernel specific ARCH variable Zhangjin Wu
2023-06-19 12:28 ` [PATCH v5 4/5] tools/nolibc: add kernel and nolibc specific ARCH variables Zhangjin Wu
2023-06-19 12:29 ` [PATCH v5 5/5] selftests/nolibc: riscv: customize makefile for rv32 Zhangjin Wu
2023-07-02 17:17   ` Willy Tarreau
2023-07-03 15:51     ` Zhangjin Wu
2023-07-02 17:19 ` [PATCH v5 0/5] nolibc: add part2 of support " Willy Tarreau

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=20230702165127.GC16233@1wt.eu \
    --to=w@1wt.eu \
    --cc=arnd@arndb.de \
    --cc=falcon@tinylab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=thomas@t-8ch.de \
    /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