From nobody Fri Dec 19 20:10:28 2025 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D583D3115A2 for ; Thu, 4 Dec 2025 07:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764834926; cv=none; b=CgvxJ77C7V82ZGPwBNbWDOmvtF2qyxXS2jnTHDte0FH2m2n/u/ZlXQ0rrABBxwxyQ7NiffX+qQ957BArRZdMceEECRPzx8yvTLwUtQkyhsgSmzgvUFNQwO3SBKrrdZy95f1/nPEeqt5Qw1F8wCCNjX+oKZme+UY7V1Y5SgJCScc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764834926; c=relaxed/simple; bh=iTlPMjznJPbXtJOmJD38qd13ozQfx2VEj/0hkHnAJ+8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q2zYjno80dto1zaUEr1l69pIER5c30zIqFiat1+l0gHvYLJ0AtK1XcPE5EYjbNK/fEfUio2jSEik1Of/lsUlx09bvs3p3J7pPJRbJk/A2r/iYdfhNdGBKbJVUZbdk7Dm15jfIVIi9t50yAFUoQBQHx4qLMUSTkNzhkf7ZnGfHdA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WVBfDhLn; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WVBfDhLn" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-59581e32163so675141e87.1 for ; Wed, 03 Dec 2025 23:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764834921; x=1765439721; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=l5CWhh0bivbAxLbPHjrdPNLbMwbFtGK6KhcOChIXS0I=; b=WVBfDhLnXSfCvsS1SAxp6E/otJpTNFOuveXhI8D1iYshreuNdrS800sKYNJDTC30Vq gHAZ3pZV73fhL5jPH9kw8tCcTKUBye+e5Qvud5yZg0RmDPogngx5ojRvjKZdGpeApKyw L7FQismbl6mDqUvAgJ8cMg4UbxBZkKKzmLZ4jB+wcxR+RrpVfSG8Bebjvt+b1UBzSrHt HbYJGJphm/RpRTx5PrPBcw9pRUmHd9AVwQ7FkkkS3dxlT2Yge9cLDyLPCJt8pNraUeh0 JsqAH21FDLra4YgzdM4mT8RSQKqdjikS2FcYhO+iN605wlJkPNlWoIMYHvTAF0W6YPTW xrvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764834921; x=1765439721; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=l5CWhh0bivbAxLbPHjrdPNLbMwbFtGK6KhcOChIXS0I=; b=h9zcc4Ntgdo+W6TPhoxvftUMsfs5XrE0Pni6F7XwZA0txVL3T+gD5YntDsMapgCTHn bt8WbBPhSSPj8vCaFlbxoRHAuYwLOBc10VEKt+C8RZepnzzdVNDM1DIw1Ca22ox3PR9b N6qEUkrUj+A1jBOXAjgUo3Zafd8IWb+rfgklJ+8DR2ZRMyQ5GTpMSWfxojR9ddd8gn8M IWrPNQOKJZ8twsqy9a+AOzRM2ARS22pxYUX/SxTAessgouTMtfTwTtJvV2k+ke1Zn/dv boe2imLUuM2cR68xltISVaFZyWTl3szJxydqtsLSoFKzgW1DO65ZipO1NE5RiplIY5jJ 185A== X-Forwarded-Encrypted: i=1; AJvYcCWD9cT4YjhdICH9YY3O+a+B3E89VgZ39HZsNg6tzkak/icwWi+e/xJN5r0gVQyqdF2UcPmZ0elqMrZuNrE=@vger.kernel.org X-Gm-Message-State: AOJu0YzFZatxJat5MSCQYUcmv/EhUGQzAW/HdRrCHWIjvPr9xDn2hbBJ Ztoz4A2er1IVMSFR/s/PLhCQZx3pB7oR9exP3aoPy7Nfg0PV1T13PZ6x X-Gm-Gg: ASbGnct15LatHkaSkz1ksjSZYi9ckdx7vCtqDCWIH0ZnbofrCFKbwK5kdn3GdXXZPKI H8YpcPjkPGpJphN/diM2fXqNfp9xKRWmz6oVqaIs/LKmQQveEE8PY0YDoNUWMdUDO79mhjLTL51 Tb8APtnslFjdvj1WFHSXueoK0rpGAAHyclOsphontkFvpNKUoZFSED+k/s7tbAb9+Ymo0gUe5Uk sOwJmhfHbyB+Oc6tmmJ7BWKlbZerQ39X+NI2h4fZO9RnyNWRekiBMBN8U4InJeGQxj7047NfSyz l0sLz+65WnKlLE5OcvDRk8f1bZvgjq11dApzFvasNh1NZdo8ZmUdJaGARoOV/iTA0Rb9kAiJ08Y 3hIJkxBwu32jCsY1/hPVy9HshkP7O4+OprQo8KnGRGiEBzzy7oki8c/j0j9dF8BvjsOXC/A== X-Google-Smtp-Source: AGHT+IHtNtKovriM8w2pLkDHwyMQApqeD8GW60UnConeyFy7gFY99L8zBySpoiS8naABTGPgdJC9Sw== X-Received: by 2002:a05:6512:159b:b0:592:f521:188a with SMTP id 2adb3069b0e04-597d6709d9emr571551e87.49.1764834921103; Wed, 03 Dec 2025 23:55:21 -0800 (PST) Received: from minun.felixc.at ([2a01:4f9:6b:1cc4::2]) by smtp.googlemail.com with ESMTPSA id 2adb3069b0e04-597d7c28019sm239190e87.69.2025.12.03.23.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Dec 2025 23:55:20 -0800 (PST) From: Asuna Yang X-Google-Original-From: Asuna Yang Date: Thu, 04 Dec 2025 08:54:53 +0100 Subject: [PATCH v5 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: <20251204-gcc-rust-v5-v5-3-2d4f20d86c24@gmail.com> References: <20251204-gcc-rust-v5-v5-0-2d4f20d86c24@gmail.com> In-Reply-To: <20251204-gcc-rust-v5-v5-0-2d4f20d86c24@gmail.com> 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 , Jason Montleon , Han Gao , Conor Dooley , Vivian Wang 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 , Asuna Yang X-Mailer: b4 0.14.3 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 :=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,trap "rm -f .tmp_$$.h" EXIT; touch .t= mp_$$.h; $(BINDGEN) .tmp_$$.h -- --target=3D$(BINDGEN_TARGET) $(1)) --=20 2.51.1