lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYS9bRugxr1rUvA3@levanger>
Date: Thu, 5 Feb 2026 16:55:25 +0100
From: Nicolas Schier <nsc@...nel.org>
To: HeeSu Kim <mlksvender@...il.com>
Cc: nathan@...nel.org, a.hindborg@...nel.org, aliceryhl@...gle.com,
	bjorn3_gh@...tonmail.com, boqun@...gle.com, charmitro@...teo.net,
	dakr@...nel.org, gary@...yguo.net, linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org, lossin@...nel.org,
	miguel.ojeda.sandonis@...il.com, ojeda@...nel.org,
	rust-for-linux@...r.kernel.org, stable@...r.kernel.org,
	tmgross@...ch.edu
Subject: Re: [PATCH v5 1/2] kbuild: add rustc-max-version macro

On Thu, Feb 05, 2026 at 10:18:14PM +0900, HeeSu Kim wrote:
> Add `rustc-max-version` macro to `scripts/Makefile.compiler` for
> version upper bound checks, mirroring the existing `rustc-min-version`.
> 
> This will be used to bound workarounds to specific compiler version
> ranges.
> 
> Suggested-by: Miguel Ojeda <ojeda@...nel.org>
> Link: https://lore.kernel.org/rust-for-linux/CANiq72n39eU9WE=Yh0_yJzmqMxo=QAaU2pN0UqP9jZ7bT7rhgA@mail.gmail.com/
> Acked-by: Nathan Chancellor <nathan@...nel.org>
> Signed-off-by: HeeSu Kim <mlksvender@...il.com>
> ---
> Changes in v5:
> - Split rustc-max-version macro into separate patch for easier backporting
>   (was part of the workaround patch in v4)
> 
>  scripts/Makefile.compiler | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler
> index ef91910de265..85268f6f1494 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-max-version
> +# Usage: rustc-$(call rustc-max-version, 109000) += -Cfoo
> +rustc-max-version = $(call test-le, $(CONFIG_RUSTC_VERSION), $1)
> +

Acked-by: Nicolas Schier <nsc@...nel.org>



(nit-picking; not crucial for this very patch set)

For readability, a less-than version check might be easier to read; and
that would probably better match the suggested version range check:

    rustc-lt-version = $(if $(call rustc-min-version, $(1)),,y)
    rustc-version-range = $(and $(call rustc-lt-version,$(2)), $(call rustc-min-version,$(1)))

so that the actual version check could become

    # The bug was fixed in Rust 1.90.0, so only apply for 1.88.x to < 1.90.0
    rustdoc_modifiers_workaround := $(if $(call rustc-version-range, 108800, 109000), \
    		-Cunsafe-allow-abi-mismatch=fixed-x18)

or:

    ifeq ($(call rustc-version-range, 108800, 109000),y)
    rustdoc_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18
    endif


-- 
Nicolas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ