From: HeeSu Kim <mlksvender@gmail.com>
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 [thread overview]
Message-ID: <498f49f1c0b34535309f9dedf87ac4de8e7c132b.1776607331.git.mlksvender@gmail.com> (raw)
In-Reply-To: <cover.1776607331.git.mlksvender@gmail.com>
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 <ojeda@kernel.org>
Link: https://lore.kernel.org/rust-for-linux/CANiq72n39eU9WE=Yh0_yJzmqMxo=QAaU2pN0UqP9jZ7bT7rhgA@mail.gmail.com/
Acked-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Nicolas Schier <nsc@kernel.org>
Signed-off-by: HeeSu Kim <mlksvender@gmail.com>
---
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
WARNING: multiple messages have this Message-ID (diff)
From: HeeSu Kim <mlksvender@gmail.com>
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 [thread overview]
Message-ID: <498f49f1c0b34535309f9dedf87ac4de8e7c132b.1776607331.git.mlksvender@gmail.com> (raw)
Message-ID: <20260419140612.5zAiR8Y4GTRAhfiOUcADEsCnh-P3LnS-QuLurhKUGpA@z> (raw)
In-Reply-To: <cover.1776607331.git.mlksvender@gmail.com>
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 <ojeda@kernel.org>
Link: https://lore.kernel.org/rust-for-linux/CANiq72n39eU9WE=Yh0_yJzmqMxo=QAaU2pN0UqP9jZ7bT7rhgA@mail.gmail.com/
Acked-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Nicolas Schier <nsc@kernel.org>
Signed-off-by: HeeSu Kim <mlksvender@gmail.com>
---
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
next prev parent reply other threads:[~2026-04-19 14:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 22:21 [PATCH] rust: Makefile: apply fixed-x18 workaround only on arm64 HeeSu Kim
2026-02-02 13:59 ` Charalampos Mitrodimas
2026-02-02 23:17 ` HeeSu Kim
2026-02-02 14:20 ` Miguel Ojeda
2026-02-02 14:24 ` Gary Guo
2026-02-02 23:45 ` HeeSu Kim
2026-02-03 0:21 ` [PATCH v2] rust: Makefile: bound rustdoc workaround to affected versions HeeSu Kim
2026-02-02 16:00 ` Miguel Ojeda
2026-02-03 0:56 ` Nathan Chancellor
2026-02-03 23:48 ` [PATCH v4] " HeeSu Kim
2026-02-03 22:12 ` Nathan Chancellor
2026-02-05 13:15 ` HeeSu Kim
2026-02-05 13:18 ` [PATCH v5 1/2] kbuild: add rustc-max-version macro HeeSu Kim
2026-02-05 13:18 ` [PATCH v5 2/2] rust: Makefile: bound rustdoc workaround to affected versions HeeSu Kim
2026-03-12 14:12 ` Miguel Ojeda
2026-04-19 14:05 ` [PATCH v6 0/2] " HeeSu Kim
2026-04-19 14:05 ` HeeSu Kim [this message]
2026-04-19 14:06 ` [PATCH v6 1/2] kbuild: add rustc-lt-version macro HeeSu Kim
2026-04-19 14:05 ` [PATCH v6 2/2] rust: Makefile: bound rustdoc workaround to affected versions HeeSu Kim
2026-04-19 14:06 ` HeeSu Kim
2026-04-19 14:06 ` [PATCH v6 0/2] " HeeSu Kim
2026-02-05 15:55 ` [PATCH v5 1/2] kbuild: add rustc-max-version macro Nicolas Schier
2026-03-10 22:45 ` Miguel Ojeda
2026-02-03 1:46 ` [PATCH v2] rust: Makefile: bound rustdoc workaround to affected versions HeeSu Kim
2026-02-03 9:17 ` [PATCH v3] " HeeSu Kim
2026-02-03 14:56 ` [PATCH v2] " Gary Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=498f49f1c0b34535309f9dedf87ac4de8e7c132b.1776607331.git.mlksvender@gmail.com \
--to=mlksvender@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@google.com \
--cc=charmitro@posteo.net \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox