Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1516556rdh; Mon, 25 Sep 2023 15:39:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJDwg4zjhWk+Y2n3k5H3dMflHNAkfOv/ZYB94aBIWja7YBxzv/h43GJcwODOqSJIC52eW0 X-Received: by 2002:a05:6a21:329d:b0:149:2fd0:a4ac with SMTP id yt29-20020a056a21329d00b001492fd0a4acmr10627594pzb.42.1695681559853; Mon, 25 Sep 2023 15:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695681559; cv=none; d=google.com; s=arc-20160816; b=QiJVh6+lrCxEAYihPjG70BY7kIywOZjsXDXtGQT4IqM2paj6UwDMrEdJ9RIsC1IRbj hDGaru6eErZIH0AdNl8LSrGHUnWXGRR9j2hqi3LFMpP7rOV0NLBJNZb44Ru2Kii8t1gG igQHKdoLkILnDr2lxUH3OBFweXvE8dqNDENqiRUMWYaVXKmFSX9J8cPv52bXgolibI/+ 51SnruvEfgnOCJy+MdgT1Q/y/dVhTwEZ1jEQQLKqT+jUpALI8223oJc8ofGdnhUBUcfM x4+P/uoJWfItkmsg9EzHIO+xa3FB2tYdtanqnbG5MAz91MhBwEyX8cVQmafPEZJ3cC+y jIJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=QnbjMyPBjfadxLgGw400c203c4JJzA3SbuSzbqVGG/0=; fh=Hu5Z85mCjwbIpQ6O7J4KtGQomc/bitxjLDlxDRGGJ5w=; b=gG3UTpHheYzMAq5hl4CL5BIW6ejrLVMwGwu5h0Z72TJNKTmkFo9AH4oA3YfPUUBkYO /gQ5F6wSOKMuPd07A9ujqEWZDcuSnb4lnTMAT2ttnUDIEJHFsijxalZjXJbg7NOsLhW6 d6EXbz24A536gIN/dm4fZ9Q5Ig9K2yN7we5IK8fTT8Z8DbhlSoqCUDa3r7hgPgcn5cjN hlj69bReQ8A4vILknfZtlpVLOeR90es3SlYv6gXouol6Phzp0fWoBxDaxvZ04/UEyLOp WHwgq5xxnyZyFTgO9q3kpoRQjCs63rVd2wRisxAiPYrNRCMJYcC4vFI7iC2P62QuOcmT syjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bo13-20020a17090b090d00b00273e2f407casi12828527pjb.76.2023.09.25.15.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 15:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C42A2826C4DD; Mon, 25 Sep 2023 15:39:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230044AbjIYWjU (ORCPT + 99 others); Mon, 25 Sep 2023 18:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjIYWjT (ORCPT ); Mon, 25 Sep 2023 18:39:19 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0EBB9C; Mon, 25 Sep 2023 15:39:11 -0700 (PDT) X-QQ-mid: bizesmtp62t1695681542tdrh3qq7 Received: from linux-lab-host.localdomain ( [116.30.124.152]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 26 Sep 2023 06:38:56 +0800 (CST) X-QQ-SSF: 01200000002000E0Y000B00A0000000 X-QQ-FEAT: SFhf6fKhx//PtbsvyVYEL/gCYQ5xMD8J6LwaCKhulpVEfmJppGRkMmjMj3Bxv 8wdytKPzLVFJlPA82FjC2Ti02tsIHXGhP+Tb7KY7NXZeQX14PHTRUwY1uNtWxj7nVvdw5N8 ypB+bBYPZTiHwLTOfPVZ2o3kvUQu/slgqaqTTvxwiXKKuRoubwr8vyOsZC+zpBmOn8ghMQm AG5bLu8EeQJF77jcZcCDh8tBPzUgxyBcq+ybkOO584JaaHxdkRqP9QMqdLVLQkwKUzkpjRx 8jfcH0gidHmiUdV76m98gNAlJ0swOV9yXGIUaa85PdpJ4c+AiLAPLqrLnY0hvGmFDffugib /YpU8n7ZB5APg72lHoVQhLN1V/LOaRguiP/XLXevf0Z/Nx5UZypKAyBjtff2CMVyBvswmd1 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11640928319628299727 From: Zhangjin Wu To: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, Arnd Bergmann Cc: falcon@tinylab.org, palmer@rivosinc.com, paul.walmsley@sifive.com, paulburton@kernel.org, paulmck@kernel.org, tsbogend@alpha.franken.de, w@1wt.eu, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Tim Bird Subject: [PATCH v1 3/7] DCE/DSE: Add a new scripts/Makefile.syscalls Date: Tue, 26 Sep 2023 06:38:56 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: Yes, score=6.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_PBL,RCVD_IN_SBL_CSS, RCVD_IN_VALIDITY_RPBL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Report: * 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL * [43.154.54.12 listed in zen.spamhaus.org] * 3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS * 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to * DNSWL was blocked. See * http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block * for more information. * [43.154.54.12 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, * https://senderscore.org/blocklistlookup/ * [43.154.54.12 listed in bl.score.senderscore.com] * -0.0 SPF_PASS SPF: sender matches SPF record * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Spam-Level: ****** 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 15:39:17 -0700 (PDT) When CONFIG_TRIM_UNUSED_SYSCALLS is enabled, get used syscalls from CONFIG_USED_SYSCALLS. CONFIG_USED_SYSCALLS may be a list of used syscalls or a file to store such a list. If CONFIG_USED_SYSCALLS is configured as a list of the used syscalls, directly record them in a used_syscalls variable, if it is a file to store the list, record the file name to the used_syscalls_file variable and put its content to the used_syscalls variable. Signed-off-by: Zhangjin Wu --- scripts/Makefile.syscalls | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 scripts/Makefile.syscalls diff --git a/scripts/Makefile.syscalls b/scripts/Makefile.syscalls new file mode 100644 index 000000000000..5864d3a85996 --- /dev/null +++ b/scripts/Makefile.syscalls @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0 + +ifndef SCRIPTS_MAKEFILE_SYSCALLS + SCRIPTS_MAKEFILE_SYSCALLS = 1 + + ifdef CONFIG_TRIM_UNUSED_SYSCALLS + ifneq ($(wildcard $(CONFIG_USED_SYSCALLS)),) + used_syscalls_file = $(CONFIG_USED_SYSCALLS) + ifeq ($(shell test -s $(used_syscalls_file); echo $$?),0) + used_syscalls != cat $(CONFIG_USED_SYSCALLS) + endif + else + ifeq ($(subst /,,$(CONFIG_USED_SYSCALLS)),$(CONFIG_USED_SYSCALLS)) + used_syscalls = $(CONFIG_USED_SYSCALLS) + else + $(error No such file: $(CONFIG_USED_SYSCALLS)) + endif + endif + + ifneq ($(used_syscalls),) + used_syscalls := $(subst $(space),|,$(strip $(used_syscalls))) + endif + + used_syscalls_deps = $(used_syscalls_file) $(objtree)/.config + + export used_syscalls used_syscalls_deps + endif # CONFIG_TRIM_UNUSED_SYSCALLS + +endif # SCRIPTS_MAKEFILE_SYSCALLS -- 2.25.1