From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8EC43D1D89D for ; Thu, 4 Dec 2025 09:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xNBlY8CX+MzE55aKksUcfS1NCuMPtwm1M2RGh8MGzAA=; b=nZFyC0ReNGHScW VzKVEmE0m7z/krQ8Nrjt+Sp0c7yJmC932Mc7RLU10tEqWcPs+zcN9bufoz7olz0nlAQaRRGQxfBL0 jv4g0DRqrwVZvpkZO+B+RYImcqs9J/j2/e1IpL1AqyQJtEBH30uXVJLSOgW2Kc+QEU1lXKiZExxTk jx74PnoRvB0HPujtgyhGMZDTVb7VGy0lAudfHV1L24qD2GwzE6wVieEhu9YLeC1lgww2TI4RDy/TO ObFBgTGXWMFEZiOKbb3mlZ66Lw/WRsPv+TRRSsb9mlV55AK1tIrCh81P40ghDMvVzpoNZ+/9YwS9K fmhw9EYBJYEn3ImShOdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vR5ID-00000007jbR-0m8o; Thu, 04 Dec 2025 09:06:29 +0000 Received: from smtp21.cstnet.cn ([159.226.251.21] helo=cstnet.cn) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vR5I9-00000007jai-2Kpt for linux-riscv@lists.infradead.org; Thu, 04 Dec 2025 09:06:28 +0000 Received: from [192.168.0.107] (unknown [114.241.82.59]) by APP-01 (Coremail) with SMTP id qwCowAAnwdD+TjFpm+0MAw--.960S2; Thu, 04 Dec 2025 17:06:06 +0800 (CST) Message-ID: <1a6bb8cd-cc08-458f-a6f6-cdfefd327320@iscas.ac.cn> Date: Thu, 4 Dec 2025 17:06:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 3/4] rust: add a Kconfig function to test for support of bindgen options To: Asuna Yang , Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Nick Desaulniers , Bill Wendling , Justin Stitt , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Jonathan Corbet , Jason Montleon , Han Gao , Conor Dooley Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev, linux-riscv@lists.infradead.org, linux-doc@vger.kernel.org References: <20251204-gcc-rust-v5-v5-0-2d4f20d86c24@gmail.com> <20251204-gcc-rust-v5-v5-3-2d4f20d86c24@gmail.com> Content-Language: en-US From: Vivian Wang In-Reply-To: <20251204-gcc-rust-v5-v5-3-2d4f20d86c24@gmail.com> X-CM-TRANSID: qwCowAAnwdD+TjFpm+0MAw--.960S2 X-Coremail-Antispam: 1UD129KBjvJXoW7ZrWUWr4rtFWrCry7tw1fJFb_yoW8Xw1fpr yvkF1q9rW8J3W8Aw17CFW0qF13ua1xtrWfW34kt347JrW7Xw40gaySkr47try8CFWv9ry2 vF4F9as09F4UCw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvvb7Iv0xC_Cr1lb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I 8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8Jw Am72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l c7CjxVAaw2AFwI0_GFv_Wryl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr 1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE 14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7 IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E 87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73Uj IFyTuYvjxUVhL0UUUUU X-Originating-IP: [114.241.82.59] X-CM-SenderInfo: pzdqw2pxlnt03j6l2u1dvotugofq/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251204_010625_965021_E16A42A2 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 12/4/25 15:54, Asuna Yang wrote: > From: Asuna Yang > > Add a new `bindgen-backend-option` Kconfig function to test whether the > bindgen backend supports a given flag. > > A subsequent commit will use this function to test for RISC-V extension > flags. > > Signed-off-by: Asuna Yang > --- > scripts/Kconfig.include | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include > index d42042b6c9e2..5d4d29eed0b3 100644 > --- a/scripts/Kconfig.include > +++ b/scripts/Kconfig.include > @@ -78,3 +78,8 @@ rustc-llvm-version := $(shell,$(srctree)/scripts/rustc-llvm-version.sh $(RUSTC)) > # If you are testing for unstable features, consider testing RUSTC_VERSION > # instead, as features may have different completeness while available. > rustc-option = $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(RUSTC) $(1) --crate-type=rlib /dev/null --out-dir=.tmp_$$ -o .tmp_$$/tmp.rlib) > + > +# $(bindgen-backend-option,) > +# Return y if bindgen backend supports , n otherwise > +# For now, the backend refers only to libclang, so more specifically, this function tests whether the given flag is recognized by the libclang used by bindgen. > +bindgen-backend-option = $(success,trap "rm -f .tmp_$$.h" EXIT; touch .tmp_$$.h; $(BINDGEN) .tmp_$$.h -- --target=$(BINDGEN_TARGET) $(1)) > Can probably be simplified down to: $(BINDGEN) /dev/null -- -x c --target=$(BINDGEN_TARGET) $(1) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv