Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25103495rwd; Sun, 2 Jul 2023 10:18:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Iev4S/s/AwYpyi3UtIYhQegm7olOJRLQts0v7W58570heXNKN8zEIH03SxVXQ1KwADE0y X-Received: by 2002:a05:6a20:1012:b0:12c:e2f6:e39 with SMTP id gs18-20020a056a20101200b0012ce2f60e39mr7131764pzc.7.1688318324309; Sun, 02 Jul 2023 10:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688318324; cv=none; d=google.com; s=arc-20160816; b=FPCoGpa2U9AeJoZbplqshVTyWRuPi4QGQgwZrFit2fLrSNDCbEbIV7AX/SW6CaOkyh fa7XR7YlmM3cY/PKVgLVWWFNYVcQrZm3FakNyTyHt5W3GJmd5SqVJ1H+tDDQ0M7n9Nwa RFBkE77mXUj0mKrwL7Ut8uQUGGIu8tLygB/bq2yUqdfVCFWIMFrggsgMbwvi9kKtswoG 8vgUBBXA3JEIZsjjg42Z8yJZAQc8PbaQ/w+lQeb6B5VCJpVZdBjyiqgpgV8flK+6jLTy egtUijnhC63+ZV38L+nWowKLEbMUNnr0h8F55CzpyyCJz1oYwCiJIzGwlPO8hfYC2jm8 sAwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=j/vbIg7XN+HranOP0bFN2s4nBv6AoHw+km6wVMqUNio=; fh=IWf1xLtU/AG1ZKh7TzW2/jouJfgdxmXnJyPbBHBMj/4=; b=B1is0hLnKW3r+8H10nFbfRKTXahQmzN7rMWSyx7Ol0ztmOPpVxa5Uo0QrJIuA0xP9z x6kS33mJ/yTmyjgQSKJ+BYKSZIr3SlQZxx2dARnfbRBjjjQKP/qEV0NO/eNnZyEH6gxt xaVJvIbnzKKCX6lqnyI3ZQ3Y1VT9dyANPl39keezl4CmLb/P6JYLumFIKbL9/PXyKv78 jSiL2nldCYJqDutatyyC2JZiUZ09du8GOHObv6qc7xQyIyASPy3UIxGKrM39ekYldC33 SNH6sBaQ/rJQxGKjnOCqI+g7/0lYYq9NiDXvMoKFkfuQBE6/GJyDYUCHgpuCTTCZfnMv 3GzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br12-20020a056a00440c00b0063b8a054e06si15461891pfb.259.2023.07.02.10.18.22; Sun, 02 Jul 2023 10:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjGBQvl (ORCPT + 99 others); Sun, 2 Jul 2023 12:51:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjGBQvk (ORCPT ); Sun, 2 Jul 2023 12:51:40 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1CBCB18B; Sun, 2 Jul 2023 09:51:38 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 362GpRrH016840; Sun, 2 Jul 2023 18:51:27 +0200 Date: Sun, 2 Jul 2023 18:51:27 +0200 From: Willy Tarreau To: Zhangjin Wu 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 Message-ID: <20230702165127.GC16233@1wt.eu> References: <1a823ba7b250ba5190f802dfc4428d4e248f71b3.1687176996.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a823ba7b250ba5190f802dfc4428d4e248f71b3.1687176996.git.falcon@tinylab.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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