From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 CC02837E2EF for ; Sun, 19 Apr 2026 14:06:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607565; cv=none; b=IitHFohvb9WE0wlcsMNqDK4Ag3KWSPs4eKPX76N1P5RaP4Cl1SeD0TgqENal0bemSxmCxLskp3kT2wkRcrNxD/0f55jkB9uvWBODruFfssVsB1ij5A32pMaJTsKDvrEIzgaHgdd0xiEKGvZHbu5Q6NF68VlO5p5LwsnKBGJjsfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607565; c=relaxed/simple; bh=3WWp9rUozTrqD9jYJJIxf3iZIrIrmP3btVTinVMXXjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=II0346l0OQYKqjtjWRHp18cRi7ldpGHjASR4j/iRSShWOw3e7v2yIeDeR7Bnc3SzSRm+MjerpT83WRrkcUz+lrrekm5HNN1XnPwt3lMRyW00j6tqPS+LLXv3ZU0LOMS0BfRScH3214gKSw4SaY83BH3C7kYh8k6GFx5n1CAlyFI= 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=e6igzAJp; arc=none smtp.client-ip=209.85.210.178 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="e6igzAJp" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-82f431c0ab6so957071b3a.0 for ; Sun, 19 Apr 2026 07:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776607563; x=1777212363; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=au3wY7wHMTJZKx13iEN8EAIoe19OdnlK/RWrodbzRlg=; b=e6igzAJp8bKEpr2lr3+2LP6ZSnvTPdMrBjnszXlyd4gXd9jWisN+TDU762mpX1l3Fd 94jLIvepvcKfd+/LfTqD2+M+UKmtYMCtiuWBRUUWWgty681OV5FvszUHmrWZchBdrB0e OR873LrxxNo5Znmukn/8VjJLjqD9rQyx0lr3syFa/TWWDPAcJFlxO12oenX3qZOGSxD3 fMwfdYoH2t9REkP4y03gJGF5W6+Ekv6cWrXCxeGul3TIuo9cATFc0srD2WcO+w/ic61o gsGjlgg/JYpUMAkqGsLeQVngkiR5QFBsXXAa3haGKr1nNdqytKabNp1ib5Sd3JfKGhVR whPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776607563; x=1777212363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=au3wY7wHMTJZKx13iEN8EAIoe19OdnlK/RWrodbzRlg=; b=mezmYWGph4abemdPkuqhguaXbHwqk7VX5wO4Y82nYTf9Uvjox5s6RRcp6m4ViM6iMv SVvWU6jIVeCLzwFZ7JGeAY8s1K0buAck5174Uikial2vFgehiQd9wsvyHP6nAarLCjjO BlR9Hou/fX2DFWXSj2ixymG45k5bIFLN4NI/tN3pwj0o3JVkRFEv6trem0PTpVGgpus1 3G9mmR4SW/p3k01Dr+A20J3QadI1/ODBs9UvM71BtJCBkI88HJ6SXIrihvTRPMENkWNw H89UJ+sB/3bYhaFQm+6KgJIQukviKUrlm0hQb8UtYKO3pFhK0tDiYobYdu1U6RDeereg erMw== X-Forwarded-Encrypted: i=1; AFNElJ/BjRvuaCAmxIoVGPJEQ4kxKvc9zXhnorthj6wqOVEI2kc1I23dCdd1rNUuiMWhfn2sATRcVtsJxZJAbpc=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6zzZqfZLoz8javPOZEJN4ggLm/arRbW2Mk/MjtELaZWgAAswX wEKdb/OjChbqh/CUxua3TkNK9kIYBD63pkts0nMh0NWMBI6biZbZocPr X-Gm-Gg: AeBDiescI0c0IWVgI1hsUkqTuVdo2rT9WKTj8ClYijPTjsD1ij3GINjVOeYTxOQS2Z2 ITOf1ZPEHz2dNZMXeu/JsqHRB0gPVckGWwwlyOHL8BLm8MEKWsmUOf6WZgTj1lSk6PF1KwsM03V n5v3tC5a1RhjXpjBuhqD222QAtGwTGU++SmftRLxIEaGuqM8FUj0TtUNy3vIFB7yTEV7XtAfMX8 y83MF7lSQh7SzXTvcoxIff0ts7J/Jqnx/5y+OUGq6fX423AuYEpbdyunPYeMg9B691MmZqicov5 RG3tLmMVubZ8La6VDFPHZlKPsxcnzwGUDcPxVSfm7FV+R43xqHbFlRHhNaYJ8g07JQ4mtL9IQpM /jKZnza/lKJvTxW890iFBUCmOuZpY9pvmZ6CvAmidY5VBNXyypyMZdXM6LWru5mcvnB8r/ks+L8 GTtZPUt1EH/7qlKRjt7GYlQp0MYQ== X-Received: by 2002:a05:6a00:6de7:b0:824:a22c:c6d7 with SMTP id d2e1a72fcca58-82f8c8893abmr9989689b3a.18.1776607562984; Sun, 19 Apr 2026 07:06:02 -0700 (PDT) Received: from misys ([58.120.241.145]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f8ebe6642sm9667974b3a.45.2026.04.19.07.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 07:06:02 -0700 (PDT) From: HeeSu Kim To: miguel.ojeda.sandonis@gmail.com Cc: a.hindborg@kernel.org, aliceryhl@google.com, bjorn3_gh@protonmail.com, boqun@google.com, charmitro@posteo.net, dakr@kernel.org, gary@garyguo.net, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, lossin@kernel.org, mlksvender@gmail.com, nathan@kernel.org, nsc@kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, stable@vger.kernel.org, tmgross@umich.edu Subject: [PATCH v6 1/2] kbuild: add rustc-lt-version macro Date: Sun, 19 Apr 2026 23:05:53 +0900 Message-ID: <498f49f1c0b34535309f9dedf87ac4de8e7c132b.1776607331.git.mlksvender@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add `rustc-lt-version` macro to `scripts/Makefile.compiler` for version upper bound checks, mirroring the existing `rustc-min-version`. Use a non-inclusive (less-than) comparison so that callers can express clean version boundaries such as `109000` (Rust 1.90.0) rather than `108999`, which is also easier to remove once the toolchain minimum version is bumped past the bound. This will be used to bound workarounds to specific compiler version ranges. Originally posted as `rustc-max-version` in v5 [1]; renamed to `rustc-lt-version` on this respin per Miguel's direction to simplify the delta and avoid the `99` form [2]. [1] https://lore.kernel.org/rust-for-linux/20260205131522.2942928-1-mlksvender@gmail.com/ [2] https://lore.kernel.org/rust-for-linux/CANiq72n-z0v_deUVPWeg1h0c6KQ+r6xfNDf72o29_0yy6KbqGA@mail.gmail.com/ Suggested-by: Miguel Ojeda Link: https://lore.kernel.org/rust-for-linux/CANiq72n39eU9WE=Yh0_yJzmqMxo=QAaU2pN0UqP9jZ7bT7rhgA@mail.gmail.com/ Acked-by: Nathan Chancellor Acked-by: Nicolas Schier Signed-off-by: HeeSu Kim --- scripts/Makefile.compiler | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index ef91910de265..fd039e228800 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -71,6 +71,10 @@ clang-min-version = $(call test-ge, $(CONFIG_CLANG_VERSION), $1) # Usage: rustc-$(call rustc-min-version, 108500) += -Cfoo rustc-min-version = $(call test-ge, $(CONFIG_RUSTC_VERSION), $1) +# rustc-lt-version +# Usage: rustc-$(call rustc-lt-version, 109000) += -Cfoo +rustc-lt-version = $(if $(call rustc-min-version,$1),,y) + # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) -- 2.52.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 B001837E2F6 for ; Sun, 19 Apr 2026 14:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607582; cv=none; b=NJ2d1/t7OnHir62UPoPNSIta5YKi36qFzt78IT37U41wg2rkwvkpn04fOw5NNIeUVSlZbZh3hPj0PONPopEye4AsK8SHyFpKIPsAeGEpy8lGaW5cSyjustScX02lg3j9I+GVwEDLKYiHrtc8RC4KcN1afC8aj3XkFI+YVi7uHPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607582; c=relaxed/simple; bh=3WWp9rUozTrqD9jYJJIxf3iZIrIrmP3btVTinVMXXjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X43JCwhsnjt9Q/QX5aOVtphapzzzV8qxJOxDw5lgL0zATcce8YheJD+4YKC+VVddE4+BxrQJBSqoJn+Av3L+wMbT7wbNAZeOe3tQEdNbwIOUmHIbUed5+zfbYQeUUvKofhSiB9UOZeq0DWhc8cMaBWKVO+CWHgWfoxlBHdj41Y4= 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=J+xnDSv+; arc=none smtp.client-ip=209.85.216.47 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="J+xnDSv+" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-354bc7c2c46so1233865a91.0 for ; Sun, 19 Apr 2026 07:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776607581; x=1777212381; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=au3wY7wHMTJZKx13iEN8EAIoe19OdnlK/RWrodbzRlg=; b=J+xnDSv+u78mVhjouID8LyShxnk7yOdGHPy/vsXV0tS4t6S2DgPFdA2qYYi9tT/kUd 7V56H12W4WTpoKwO6QVSOvWfWhIcRjnaIRg8KSiXEJL3PYNICnrm7UwO37K9vY9aDhb0 kQXZqSXfqHck0CheFLhnTUaXCc0vy1kuBXNDHtjic+9UdeAlFL3/6fE5u2JwSJV4OEIZ 5e9NVY6sIQ90KKpZPmBUj/shW5iaiYSX0ixYxskYV8MkZnSmJlle6b7Nu7uY0uPJG7wl WPEudXqWW2912nkL14wbt4xpfE3cVNHoNCrpI/EkAhMIwLv67wKbd7/BjvjbHQS3jUVs EwJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776607581; x=1777212381; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=au3wY7wHMTJZKx13iEN8EAIoe19OdnlK/RWrodbzRlg=; b=eiXXPLyg+URteP9zUQolLy8MgFKWbWnZAEDikc/lkJcFU+RtoJhRpIHnE3oxNfGqga tlpTJkjwxEhic8/QyHvpvmRUCN/N5NI4bVbqDLAY7rKcc/KqF8sHpaIqWZwYId7sJET8 caKDdZuMJU78RzeDA6usE4PA3rsOhq6bnpYWgRecAdrz4F/ye7/QDFLs2Wga8/THceY6 mAp7pjc6BLRQHcat+Y0EXOmVpp8b4as69dK36bH2r46UBEmnXVsmnX88HN9J6SGqHwhJ 2NCHamcFBdt2PFTTc5rmxwTYKTyVm1QIfuusFaioXXZuZQBDDcCYyFybS6Hv1slCHDFG KBzg== X-Forwarded-Encrypted: i=1; AFNElJ9R5MMngkfk6OO109WhbEsllhFycbArsaKajz6NsbnyNI9RT9MK+qBw+xX7op9juYTZwC84oTwX2pAMXsM=@vger.kernel.org X-Gm-Message-State: AOJu0YxZisiMM6KyWunxGIbzHRmKeJ9ABz5/J+mXDCAWSg0kHm9+TeJ/ fFj7dBl12WRqbddYCUtng/HelLLAqLdS5DndfvaUJXA9efzD+fjOCuWW X-Gm-Gg: AeBDievYY9Zm0ohLrINA2MxSLQRVaTNMo/1F2Y4W5lXPcMZd/FwYmhMidzXDQsAmqal B6k2y0aFxVj1s51F3LmjmE9d7PaIunDi1irJVNGKG8gCyVZIaWrTbZxAPrenayEITf6YB/A+aoW tytIQAELAvYZLCqRzFc75gcBts7+v+Kr/0V9VlxsnYTW+PQXjP4xoNs0+1Yu8Lyazp3AL3bFeKd RfzYWg2H8Ns4rNSehM8RDWOmMjKjawANB8GfEkhK4DTW1I3rQT+u9SA8iTcyJgd1+lVqY8WDZQO JBSgRla5O2K++5/7Yp8wI1BqvRGKhjvv7oiMjPD98ZbASebFV050S+1/mpU1EMvZ6w1a38c+zy+ ifeKVkkNxOweA72EDv9wP62JuwWMLbVPwrQH+cAvRZaBnJO/3FTHG2kv6mKZlaByfWdevC9LZvv hxvT5bWmlriM/a04Nh2NavsRitgj7/22VSX3wn X-Received: by 2002:a17:90a:d09:b0:361:45df:102 with SMTP id 98e67ed59e1d1-36145df0c75mr5534160a91.17.1776607581141; Sun, 19 Apr 2026 07:06:21 -0700 (PDT) Received: from misys ([58.120.241.145]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36141898ebasm7718121a91.7.2026.04.19.07.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 07:06:20 -0700 (PDT) From: HeeSu Kim To: miguel.ojeda.sandonis@gmail.com Cc: a.hindborg@kernel.org, aliceryhl@google.com, bjorn3_gh@protonmail.com, boqun@google.com, charmitro@posteo.net, dakr@kernel.org, gary@garyguo.net, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, lossin@kernel.org, mlksvender@gmail.com, nathan@kernel.org, nsc@kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, stable@vger.kernel.org, tmgross@umich.edu Subject: [PATCH v6 1/2] kbuild: add rustc-lt-version macro Date: Sun, 19 Apr 2026 23:06:12 +0900 Message-ID: <498f49f1c0b34535309f9dedf87ac4de8e7c132b.1776607331.git.mlksvender@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: <20260419140612.5zAiR8Y4GTRAhfiOUcADEsCnh-P3LnS-QuLurhKUGpA@z> Add `rustc-lt-version` macro to `scripts/Makefile.compiler` for version upper bound checks, mirroring the existing `rustc-min-version`. Use a non-inclusive (less-than) comparison so that callers can express clean version boundaries such as `109000` (Rust 1.90.0) rather than `108999`, which is also easier to remove once the toolchain minimum version is bumped past the bound. This will be used to bound workarounds to specific compiler version ranges. Originally posted as `rustc-max-version` in v5 [1]; renamed to `rustc-lt-version` on this respin per Miguel's direction to simplify the delta and avoid the `99` form [2]. [1] https://lore.kernel.org/rust-for-linux/20260205131522.2942928-1-mlksvender@gmail.com/ [2] https://lore.kernel.org/rust-for-linux/CANiq72n-z0v_deUVPWeg1h0c6KQ+r6xfNDf72o29_0yy6KbqGA@mail.gmail.com/ Suggested-by: Miguel Ojeda Link: https://lore.kernel.org/rust-for-linux/CANiq72n39eU9WE=Yh0_yJzmqMxo=QAaU2pN0UqP9jZ7bT7rhgA@mail.gmail.com/ Acked-by: Nathan Chancellor Acked-by: Nicolas Schier Signed-off-by: HeeSu Kim --- scripts/Makefile.compiler | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index ef91910de265..fd039e228800 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -71,6 +71,10 @@ clang-min-version = $(call test-ge, $(CONFIG_CLANG_VERSION), $1) # Usage: rustc-$(call rustc-min-version, 108500) += -Cfoo rustc-min-version = $(call test-ge, $(CONFIG_RUSTC_VERSION), $1) +# rustc-lt-version +# Usage: rustc-$(call rustc-lt-version, 109000) += -Cfoo +rustc-lt-version = $(if $(call rustc-min-version,$1),,y) + # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) -- 2.52.0