From nobody Wed Feb 11 02:54:36 2026 Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0265B31ED89; Tue, 30 Dec 2025 16:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767113351; cv=none; b=VEf81gpNh4IBQztY/CI+9F0gDYx8r07xSbVYY7cUfqPApeJvskBY7k04MgqBgulGZWWcqnLuPHbM0dWA1zqjRroNiT1e7SeClaN+vxLx/77Qw8WsEnHig/SF2zovd01kcu2hKcrPAsdhJjQ4yYqdEjCB5Rh7+wKYff/o5oEYgpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767113351; c=relaxed/simple; bh=s0BZHr9peDpxS0tzWe3OwbWSlsNumx+H4d9Io60dTws=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jzD62C8dLMNamDD4jOw0BCTa5xtYrQaH5l574KSvW0zxd02v3PdELOQ5akCMkbElITfjVRFThfLo4ZsQQz3cj2fkPSq9nnFXZBeNdZyjNelUmVcTOgwLlWUhZdrjSGDXk1BPtsS69XFS6HU96N84mkFwPZ8rZJd85YJfnthWI5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=isrc.iscas.ac.cn; spf=pass smtp.mailfrom=isrc.iscas.ac.cn; arc=none smtp.client-ip=159.226.251.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=isrc.iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=isrc.iscas.ac.cn Received: from minun.felixc.at (unknown [65.108.105.71]) by APP-05 (Coremail) with SMTP id zQCowAA3yQw8AlRpUjKQAg--.63740S5; Wed, 31 Dec 2025 00:48:41 +0800 (CST) From: Asuna Yang Date: Tue, 30 Dec 2025 17:47:56 +0100 Subject: [PATCH v6 3/4] rust: add a Kconfig function to test for support of bindgen options Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251230-gcc-rust-v5-v6-3-2ac86ba728c8@isrc.iscas.ac.cn> References: <20251230-gcc-rust-v5-v6-0-2ac86ba728c8@isrc.iscas.ac.cn> In-Reply-To: <20251230-gcc-rust-v5-v6-0-2ac86ba728c8@isrc.iscas.ac.cn> To: 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 , Conor Dooley , Mingcong Bai , Han Gao , Vivian Wang , Jason Montleon 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, Asuna Yang X-Mailer: b4 0.14.3 X-CM-TRANSID: zQCowAA3yQw8AlRpUjKQAg--.63740S5 X-Coremail-Antispam: 1UD129KBjvJXoW7ZrW5Kw4xJw4rZF45Wr43GFg_yoW8Jw4rp3 4vkF1q9rW8J3W8tw17CFy0gF13Ca17trW7u348ta4UJrZrXw40q392kF4ayry8CFZYvryj vF4FgFyYvr1UCaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUHFb7Iv0xC_Zr1lb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6r1S6rWUM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI 8067AKxVWUWwA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF 64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcV CY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv 6xkF7I0E14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4 CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvj eVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I 1lFIxGxcIEc7CjxVA2Y2ka0xkIwI1lc7CjxVAaw2AFwI0_GFv_Wrylc2xSY4AK6IIF6r1l 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJV WxJr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvj4RT89ZUUUUU X-CM-SenderInfo: x0lq233loux21fy6x21ufox2xfdvhtffof0/ 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 Acked-by: Nathan Chancellor --- scripts/Kconfig.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index d42042b6c9e2..9954b8093fab 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -78,3 +78,8 @@ rustc-llvm-version :=3D $(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 =3D $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(RU= STC) $(1) --crate-type=3Drlib /dev/null --out-dir=3D.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 b= y bindgen. +bindgen-backend-option =3D $(success,$(BINDGEN) /dev/null -- -x c --target= =3D$(BINDGEN_TARGET) $(1)) --=20 2.51.1