From patchwork Mon Jun 20 23:13:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12888563 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2409ACCA480 for ; Mon, 20 Jun 2022 23:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346824AbiFTXRp (ORCPT ); Mon, 20 Jun 2022 19:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347094AbiFTXRP (ORCPT ); Mon, 20 Jun 2022 19:17:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DBBE222AA; Mon, 20 Jun 2022 16:13:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BEEB961515; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B9FAC3411C; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655766810; bh=PFW+nJeUjF0+z9b2ZiIQ19Ctf2Uib8uU1+Ln6e2nhDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hwiGTaw0+1uiz5RGyeKLUrv4A701/KRlUqZwqmCI5im1OvrE4Hl6ZA2ZbDBmurscf UL02wlNnUKAjN947vHf6bzqgrfN3bGr93Tv923/uXB1d6LDN+mgxSUO1wddxBF8Rep pt5vB3/27ynR6ecKJoIj1M+rQvyJIUd9TMIXE/pBuYRPNSnG6AuCvJQiMoxtwuddCt VIY/XlpbgcqwkgvbRxk1evIZCbdMsVcH8hUCk0WCLO+TX7MidGraZx3snt2yN/1RO+ NND9mWBkeGRHNxnqGQ8DddPZo03Vmj0aK1OyBU1qZtjAyZ9wjaUNGR+T9CpzD4V412 7PLYDXfuufBhg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DB69C5C05B9; Mon, 20 Jun 2022 16:13:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Ammar Faizi , Willy Tarreau , Alviro Iskandar Setiawan , "Paul E . McKenney" Subject: [PATCH rcu 1/5] tools/nolibc/stdlib: Support overflow checking for older compiler versions Date: Mon, 20 Jun 2022 16:13:24 -0700 Message-Id: <20220620231328.3845126-1-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> References: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Ammar Faizi Previously, we used __builtin_mul_overflow() to check for overflow in the multiplication operation in the calloc() function. However, older compiler versions don't support this built-in. This patch changes the overflow checking mechanism to make it work on any compiler version by using a division method to check for overflow. No functional change intended. While in there, remove the unused variable `void *orig`. Link: https://lore.kernel.org/lkml/20220330024114.GA18892@1wt.eu Suggested-by: Willy Tarreau Cc: Alviro Iskandar Setiawan Signed-off-by: Ammar Faizi Acked-by: Willy Tarreau Reviewed-by: Alviro Iskandar Setiawan Signed-off-by: Paul E. McKenney --- tools/include/nolibc/stdlib.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/include/nolibc/stdlib.h b/tools/include/nolibc/stdlib.h index 8fd32eaf80370..92378c4b96605 100644 --- a/tools/include/nolibc/stdlib.h +++ b/tools/include/nolibc/stdlib.h @@ -128,10 +128,9 @@ void *malloc(size_t len) static __attribute__((unused)) void *calloc(size_t size, size_t nmemb) { - void *orig; - size_t res = 0; + size_t x = size * nmemb; - if (__builtin_expect(__builtin_mul_overflow(nmemb, size, &res), 0)) { + if (__builtin_expect(size && ((x / size) != nmemb), 0)) { SET_ERRNO(ENOMEM); return NULL; } @@ -140,7 +139,7 @@ void *calloc(size_t size, size_t nmemb) * No need to zero the heap, the MAP_ANONYMOUS in malloc() * already does it. */ - return malloc(res); + return malloc(x); } static __attribute__((unused)) From patchwork Mon Jun 20 23:13:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12888564 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC734C433EF for ; Mon, 20 Jun 2022 23:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346313AbiFTXRq (ORCPT ); Mon, 20 Jun 2022 19:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346469AbiFTXRR (ORCPT ); Mon, 20 Jun 2022 19:17:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1ED5193E5; Mon, 20 Jun 2022 16:13:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 733C3B81648; Mon, 20 Jun 2022 23:13:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30992C341C4; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655766810; bh=9VTbdq8Y3NJlRy422lvZmfminBhIB8cPZE0sibkpfZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n0Bze04vMI8UvYDC1xb7N9YZJI8T5VDvIzOzoqAFF90fkBIL5m3IIGeGUqD/LVB3W hk50cugR5BIBMFv2CJgq/D4iopfHgT9/wqEomOvLrLmwHUK5aKTAoGoOcqcq3tR7VH u2mxDfnGW5EEOaNUdJH2DbT7koe5Xlz8+AccSErJFdPj1u3HlTVyeCMLz2suTQ/BPN mkckQY+KBOieO+D8qTGi77fiu9w+/g4kKwQD1FziXPDMsM1vL5Kx4N8qIt78LWozWy 2cFgxMGv5IFmMNJtQJjDN6c0Vgz1XWKifVpVxAOYst9LpKv21an6mKj/s1fmmToCz7 prjMQGuaqcNbQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DD74D5C05C8; Mon, 20 Jun 2022 16:13:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Alviro Iskandar Setiawan , Ammar Faizi , Willy Tarreau , "Paul E . McKenney" Subject: [PATCH rcu 2/5] tools/nolibc/stdio: Add format attribute to enable printf warnings Date: Mon, 20 Jun 2022 16:13:25 -0700 Message-Id: <20220620231328.3845126-2-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> References: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Alviro Iskandar Setiawan When we use printf and fprintf functions from the nolibc, we don't get any warning from the compiler if we have the wrong arguments. For example, the following calls will compile silently: ``` printf("%s %s\n", "aaa"); fprintf(stdout, "%s %s\n", "xxx", 1); ``` (Note the wrong arguments). Those calls are undefined behavior. The compiler can help us warn about the above mistakes by adding a `printf` format attribute to those functions declaration. This patch adds it, and now it yields these warnings for those mistakes: ``` warning: format `%s` expects a matching `char *` argument [-Wformat=] warning: format `%s` expects argument of type `char *`, but argument 4 has type `int` [-Wformat=] ``` [ ammarfaizi2: Simplify the attribute placement. ] Signed-off-by: Alviro Iskandar Setiawan Signed-off-by: Ammar Faizi Acked-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/include/nolibc/stdio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h index 15dedf8d0902d..a3cebc4bc3ac4 100644 --- a/tools/include/nolibc/stdio.h +++ b/tools/include/nolibc/stdio.h @@ -273,7 +273,7 @@ int vfprintf(FILE *stream, const char *fmt, va_list args) return written; } -static __attribute__((unused)) +static __attribute__((unused, format(printf, 2, 3))) int fprintf(FILE *stream, const char *fmt, ...) { va_list args; @@ -285,7 +285,7 @@ int fprintf(FILE *stream, const char *fmt, ...) return ret; } -static __attribute__((unused)) +static __attribute__((unused, format(printf, 1, 2))) int printf(const char *fmt, ...) { va_list args; From patchwork Mon Jun 20 23:13:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12888562 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D8C7C43334 for ; Mon, 20 Jun 2022 23:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347412AbiFTXRo (ORCPT ); Mon, 20 Jun 2022 19:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347125AbiFTXRN (ORCPT ); Mon, 20 Jun 2022 19:17:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C13D222A4; Mon, 20 Jun 2022 16:13:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BED6261507; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26660C3411B; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655766810; bh=clhv5Qd1GDJBQPjEqFH6Zt5RkEPLR+JAFjAQe43nj0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MXkYbmvt8BV/dBX0RLcs5/jqxU2xH28yQFp4GCasZZlkastzo/CWT0WR2NbN2/dBm ks+79uiRyuRxYxHr0we4+44o7gCCdieF5rZRNu74Gtg+IWWsDr5Wl9akerRDlthe9B M/AgpVUFeR3Fu+Vjv96ITH5foA/QDlGpqb+L4XKEvk2UOnFp7faCCmxYUZ8mnlaMHb 3t9kuWMZFj78ofm4iY/Um81MUqGHz8+gc3+2o62xNpDmZ9Ewx8LfcNyl9dJRkFsSra SkSJZikPTaP1FloNHuBPMbXZlMl+kFyAMP9EfHvSy1MIHyOOwyXfh75aGF9MTwIexn p1XRoPGckIS3w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DF9975C0A15; Mon, 20 Jun 2022 16:13:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Willy Tarreau , "Paul E . McKenney" Subject: [PATCH rcu 3/5] tools/nolibc: fix the makefile to also work as "make -C tools ..." Date: Mon, 20 Jun 2022 16:13:26 -0700 Message-Id: <20220620231328.3845126-3-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> References: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Willy Tarreau As reported by Linus, the nolibc's makefile is currently broken when invoked as per the documented method (make -C tools nolibc_), because it now relies on the ARCH and OUTPUT variables that are not set in this case. This patch addresses this by sourcing subarch.include, and by presetting OUTPUT to the current directory if not set. This is sufficient to make the commands work both as a standalone target and as a tools/ sub-target. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/include/nolibc/Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index 7a16d917c1859..e8bac6ef36538 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -7,6 +7,22 @@ ifeq ($(srctree),) srctree := $(patsubst %/tools/include/,%,$(dir $(CURDIR))) endif +# when run as make -C tools/ nolibc_ the arch is not set +ifeq ($(ARCH),) +include $(srctree)/scripts/subarch.include +ARCH = $(SUBARCH) +endif + +# OUTPUT is only set when run from the main makefile, otherwise +# it defaults to this nolibc directory. +OUTPUT ?= $(CURDIR)/ + +ifeq ($(V),1) +Q= +else +Q=@ +endif + nolibc_arch := $(patsubst arm64,aarch64,$(ARCH)) arch_file := arch-$(nolibc_arch).h all_files := ctype.h errno.h nolibc.h signal.h std.h stdio.h stdlib.h string.h \ @@ -36,7 +52,7 @@ headers: headers_standalone: headers $(Q)$(MAKE) -C $(srctree) headers - $(Q)$(MAKE) -C $(srctree) headers_install INSTALL_HDR_PATH=$(OUTPUT)/sysroot + $(Q)$(MAKE) -C $(srctree) headers_install INSTALL_HDR_PATH=$(OUTPUT)sysroot clean: $(call QUIET_CLEAN, nolibc) rm -rf "$(OUTPUT)sysroot" From patchwork Mon Jun 20 23:13:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12888565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11892C43334 for ; Mon, 20 Jun 2022 23:17:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347176AbiFTXRr (ORCPT ); Mon, 20 Jun 2022 19:17:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347131AbiFTXRR (ORCPT ); Mon, 20 Jun 2022 19:17:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CABC22523; Mon, 20 Jun 2022 16:13:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CE680614FB; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33909C341C5; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655766810; bh=1Srkx65V0c9fIsN8Z0dMTBAwhSk2DBTXR07RMoGi6c4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dq2ZBHdfTiwpVgxDlLftqae43xY/guqf/ZId2SSTTmCVujCRb4I/S7+GrshWoUVzh 6whwK6x/wNXmcXtC+GV5i57GpmUpyJd4O/yFN2TfrEWWMqbNXlHWlWAPqhqZXw2kki ASSCpnRW+9DNkYYZEL4ypv+wuMV9EyA+JwkrPc1OhwQsoj6pAWSmxQhRrCqF6OY9+y fo/4yxLbl70olO2g895b60j7zi8y/eJzDJi/WyhweTueQa3Hrh8BIG8AicwaBx0JmS K5tZUVS4u69Mc6C+P/tpYvohOsbTd4JRHRamFKzQlOXQFV9vgg56LvVJ6VCanY3sZC WTAQuYgFGKySg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E18295C0A33; Mon, 20 Jun 2022 16:13:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Willy Tarreau , "Paul E . McKenney" Subject: [PATCH rcu 4/5] tools/nolibc: make the default target build the headers Date: Mon, 20 Jun 2022 16:13:27 -0700 Message-Id: <20220620231328.3845126-4-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> References: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Willy Tarreau The help in "make -C tools" enumerates nolibc as a valid target so we must at least make it do something. Let's make it do the equivalent of "make headers" in that it will prepare a sysroot with the arch's headers, but will not install the kernel's headers. This is the minimum some tools will need when built with a full-blown toolchain anyway. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/Makefile | 3 +++ tools/include/nolibc/Makefile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index c074e42fd92f5..e497875fc7e3f 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -78,6 +78,9 @@ bpf/%: FORCE libapi: FORCE $(call descend,lib/api) +nolibc: FORCE + $(call descend,include/nolibc) + nolibc_%: FORCE $(call descend,include/nolibc,$(patsubst nolibc_%,%,$@)) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index e8bac6ef36538..9768819abd55d 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -29,7 +29,7 @@ all_files := ctype.h errno.h nolibc.h signal.h std.h stdio.h stdlib.h string.h \ sys.h time.h types.h unistd.h # install all headers needed to support a bare-metal compiler -all: +all: headers # Note: when ARCH is "x86" we concatenate both x86_64 and i386 headers: From patchwork Mon Jun 20 23:13:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12888566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC982CCA482 for ; Mon, 20 Jun 2022 23:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347211AbiFTXRs (ORCPT ); Mon, 20 Jun 2022 19:17:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347158AbiFTXRR (ORCPT ); Mon, 20 Jun 2022 19:17:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9E8B20F69; Mon, 20 Jun 2022 16:13:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84BFEB8125A; Mon, 20 Jun 2022 23:13:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E875C341C8; Mon, 20 Jun 2022 23:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655766810; bh=hQDDfCX6FrCbbHOOBzzqdZX9si4toBVrX232zBu3hPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pKbFH2f6v1EhhycIA1bhHU6Mr6VnY3KlF2ITwaZml3znskuB5lk/aHqTev5gUFcRL 5veMbV4mBKK2WpFjWmLHyLCQ+EjFKGq75NegtlJNOVz6KJTaG/WbSaADNndRK+w3hr g02s4enD3GZmugFmiVwG7jxDab1hRF8U2En+3HyU2zgzJGMpHdudZcmrNumHFE61Fs GIGQ8L/5m8+0ajcBvjICcadLc1JPciMt/qLkLaSIDFYibHwifQlefrHdo86h963kGu SkzdY6TJp89D8e9vYPbErYueu8Ms/0jZ/gtjnTUL3j4TtMYHJhhuvKFUW6do9OjMR2 v2L8NAHXGsbdg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E37125C0ADC; Mon, 20 Jun 2022 16:13:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Willy Tarreau , "Paul E . McKenney" Subject: [PATCH rcu 5/5] tools/nolibc: add a help target to list supported targets Date: Mon, 20 Jun 2022 16:13:28 -0700 Message-Id: <20220620231328.3845126-5-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> References: <20220620231325.GA3845036@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Willy Tarreau The "help" target simply presents the list of supported targets and the current set of variables being used to build the sysroot. Since the help in tools/ suggests to use "install", which is supported by most tools while such a target is not really relevant here, an "install" target was also added, redirecting to "help". Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/include/nolibc/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile index 9768819abd55d..cfd06764b5aee 100644 --- a/tools/include/nolibc/Makefile +++ b/tools/include/nolibc/Makefile @@ -31,6 +31,23 @@ all_files := ctype.h errno.h nolibc.h signal.h std.h stdio.h stdlib.h string.h \ # install all headers needed to support a bare-metal compiler all: headers +install: help + +help: + @echo "Supported targets under nolibc:" + @echo " all call \"headers\"" + @echo " clean clean the sysroot" + @echo " headers prepare a sysroot in tools/include/nolibc/sysroot" + @echo " headers_standalone like \"headers\", and also install kernel headers" + @echo " help this help" + @echo "" + @echo "These targets may also be called from tools as \"make nolibc_\"." + @echo "" + @echo "Currently using the following variables:" + @echo " ARCH = $(ARCH)" + @echo " OUTPUT = $(OUTPUT)" + @echo "" + # Note: when ARCH is "x86" we concatenate both x86_64 and i386 headers: $(Q)mkdir -p $(OUTPUT)sysroot