From nobody Sat Apr 25 12:19:16 2026 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: quoted-printable Message-ID: <20260419140612.5zAiR8Y4GTRAhfiOUcADEsCnh-P3LnS-QuLurhKUGpA@z> Content-Type: text/plain; charset="utf-8" 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-mlksven= der@gmail.com/ [2] https://lore.kernel.org/rust-for-linux/CANiq72n-z0v_deUVPWeg1h0c6KQ+r6x= fNDf72o29_0yy6KbqGA@mail.gmail.com/ Suggested-by: Miguel Ojeda Link: https://lore.kernel.org/rust-for-linux/CANiq72n39eU9WE=3DYh0_yJzmqMxo= =3DQAaU2pN0UqP9jZ7bT7rhgA@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 =3D $(call test-ge, $(CONFIG_CLANG_VER= SION), $1) # Usage: rustc-$(call rustc-min-version, 108500) +=3D -Cfoo rustc-min-version =3D $(call test-ge, $(CONFIG_RUSTC_VERSION), $1) =20 +# rustc-lt-version +# Usage: rustc-$(call rustc-lt-version, 109000) +=3D -Cfoo +rustc-lt-version =3D $(if $(call rustc-min-version,$1),,y) + # ld-option # Usage: KBUILD_LDFLAGS +=3D $(call ld-option, -X, -Y) ld-option =3D $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(= 3)) --=20 2.52.0 From nobody Sat Apr 25 12:19:16 2026 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (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 F00E437F001 for ; Sun, 19 Apr 2026 14:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607586; cv=none; b=oD1WavPdHLLv/ttzAQjcZTD2gnp3s5fghwpmQJjjvhyZkv261bTPCW9BlUuEFdBB1lBEAAUaBqp4CoHosyfMD6iwOVcfDsB5lwpxaXlBIiEjpSMXk3D140qAq2vu2dPN02kSEAeKmqUjvxTo8QgjOpdmzuConOVa4GBYOXMc60c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607586; c=relaxed/simple; bh=RkV2A4r75HXuxD8QxkqtPSd3I5Hi+PWFKHt1H+BH2rw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mq/PBB3oco57OGihtYKwOB87W9iJiAAi3LlyWbr4nwraYm/tnT7KK7HEerVuG9b/s2sXaVncn++5RF9TjbljU8t4bHSzEgbi1DRxVjCrrAwC0HqWjLXyAWKSoLciQ3FyMO5hwca4WYEvKc8t8xubu8Mi6Vc2gzkNhEJVXsJB24M= 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=UCVgnu3j; arc=none smtp.client-ip=209.85.216.43 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="UCVgnu3j" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-3614826eca4so1546301a91.1 for ; Sun, 19 Apr 2026 07:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776607584; x=1777212384; 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=eaRy4aad6uNSW8d1fddO1COP7MLdRx4c3DXic/8Oog0=; b=UCVgnu3jrZxAzO8r5CgxU+MCpVETYbYsTfl8lqLhkZEy+/g0TECLv5hd/qy3Feh356 0VrALkSjdxhK/HK+xy4T9zy10OQC6BP+VpI/t+vifXdPTREznk/Bh5EKmdhN/POyIQXU 3r40Xs04Xs8/q6Y5bnT3eCiwRtsDbGiSBztcJ0ZhtxuRFpRmc//MT4NMPRKxAx/9Q2xg 1RPJTMRR15hjtI44KvV6W8ngbODj9sfCxYs4PTLb+JDyiO1woxEExYyFB4pde657SSo7 tMNAjb6477vHQeqgN4RDZoAf9YpgfR0adN6N0jG6uvP1SrFghvuNpnQCCt6P96z9/4jx fy+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776607584; x=1777212384; 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=eaRy4aad6uNSW8d1fddO1COP7MLdRx4c3DXic/8Oog0=; b=AG1eAvCimRcynrR0YHvncKpSfuVjThM4l2CDnePDuKtueParMWbaSiJWWYV7eilg5U 0ySiRfU3patPuPm6zHbJu3sqc1cj/iy2qmhgZpTcYhvjOeckRbbzH1F9Q8AXuUysNjgq 8I0Wrek5Ex/ff9EduQ2al0hh/D6ixX9hM+QXJbUWc/QQEzJrGkul4szCmyyqmhnUveD7 rb5KkQtLmSSd+1sEwK1hfrA/P0UulqKz75rQIz6H3+jotzlxfklu6yzu+gbPoNFS6RO4 14DGTNePznX0VOEWSmpMuL3RYVCcKCUa95QSZx+peWczqAsRBDnllNprGchwU/VFlNyY c+Zw== X-Forwarded-Encrypted: i=1; AFNElJ9RliRa3GRS+V1qKjdVOE6zTiDlp0R18ajFAAjkkgTOXcp9Ql85V9lEApKNOdBdXmj3xWwhDRqTrzaMuWA=@vger.kernel.org X-Gm-Message-State: AOJu0YxzeftsOxjTyHlcHIxpHfa5oIEXeK7cI4mEmgQ7D2A+5dZCSqti 2XLpmGKFWijChmvSqpphgvGSzmovZOscQhF/f9pAsEaa/1bsNMe1XI3k X-Gm-Gg: AeBDiet4jKDLeFK2Q3E43WttMoL8DbWDwRWiE8CsxfY3r2fGXzT+zXVZaWOhlh+I9Mu +elQsvu1mCxmxFKehUCG9SF5qhuKQEhhOW4/Cs7HslJTrHpMx2sH5O5ZWGdztatOVlE3wVNV7p3 PHyZy+/0tTX0pSwEIJDgSNaRIy62pJkO5YhlyOstfo9HhyzRNXNV2ul46wrNcsl3t7D0+S2jCKW 9kd92KThBy9yIq6uk9aCiN6+PZya0opEkyb2d6l+LGkRs9m20IU/io2qXD+4aGOq9l0hlN4EeeO 5bbATIIToiWHwbtl9q69XTRtoUM8xUOQRAuue8b2XB+wwX44Qi6D3UKpt4Dx1j9X6neRGF92v6c xSISAuyRxSUeFDTEYK8fx7bRaUXYuUgXUeHv48+S897/eeCoDDSSGrZJusYZBQCXr0mKEn7FatX up4JnD8SPBxbwBiabbZh1py2mvEA== X-Received: by 2002:a17:90b:4c52:b0:35c:30a8:31f with SMTP id 98e67ed59e1d1-361403bdd28mr11318429a91.2.1776607584360; Sun, 19 Apr 2026 07:06:24 -0700 (PDT) Received: from misys ([58.120.241.145]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36141898ebasm7718121a91.7.2026.04.19.07.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 07:06:24 -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 2/2] rust: Makefile: bound rustdoc workaround to affected versions Date: Sun, 19 Apr 2026 23:06:13 +0900 Message-ID: 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: quoted-printable Message-ID: <20260419140613.onH8_jZSGl6Rloo8P3ihVGg3zaC4v73SB-lBwc_UkGA@z> Content-Type: text/plain; charset="utf-8" The `-Cunsafe-allow-abi-mismatch=3Dfixed-x18` workaround was added to handle a rustdoc bug where target modifiers were not properly saved [1]. An analogous workaround for doctests was added later [2]; since Rust 1.91.0 the `sanitizer` modifier is also appended. The rustdoc bug is fixed in Rust 1.90.0 [3] and the doctests one is fixed in Rust 1.92.0, so restrict each workaround to the compiler versions that are actually affected, letting ABI compatibility checks run again on newer compilers. Split the cases into explicit version ranges using `rustc-min-version` + `rustc-lt-version` combined inline: the rustdoc workaround applies to 1.88.x and 1.89.x, the doctests workaround to 1.88.x through 1.91.x, and the `sanitizer` modifier is only added from 1.91.x onwards (when rustc started recognizing it). This layout makes it easy to drop each entry as the minimum toolchain version is bumped past the affected range. [1] https://github.com/rust-lang/rust/issues/144521 [2] https://github.com/rust-lang/rust/issues/146465 [3] https://github.com/rust-lang/rust/pull/144523 Suggested-by: Gary Guo Link: https://lore.kernel.org/rust-for-linux/DG4JM9PU51M0.1YRGM9HVTY24U@gar= yguo.net/ Suggested-by: Miguel Ojeda Link: https://lore.kernel.org/rust-for-linux/CANiq72nnuKJaKrxrut6+noR13PUiS= oWWyyp-pGx-fe_2O6ayFA@mail.gmail.com/ Cc: stable@vger.kernel.org # Useful in 6.18.y and later. Signed-off-by: HeeSu Kim --- rust/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 5c0155b83454..14acc9c57c60 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -134,12 +134,18 @@ pin_init-flags :=3D \ --extern macros \ $(call cfgs-to-flags,$(pin_init-cfgs)) =20 -# `rustdoc` did not save the target modifiers, thus workaround for -# the time being (https://github.com/rust-lang/rust/issues/144521). -rustdoc_modifiers_workaround :=3D $(if $(call rustc-min-version,108800),-C= unsafe-allow-abi-mismatch=3Dfixed-x18) - -# Similarly, for doctests (https://github.com/rust-lang/rust/issues/146465= ). -doctests_modifiers_workaround :=3D $(rustdoc_modifiers_workaround)$(if $(c= all rustc-min-version,109100),$(comma)sanitizer) +# `rustdoc` did not save the target modifiers +# (https://github.com/rust-lang/rust/issues/144521, fixed in Rust 1.90.0). +# Similarly, for doctests +# (https://github.com/rust-lang/rust/issues/146465, fixed in Rust 1.92.0). +ifeq ($(and $(call rustc-min-version,108800),$(call rustc-lt-version,10900= 0)),y) +rustdoc_modifiers_workaround :=3D -Cunsafe-allow-abi-mismatch=3Dfixed-x18 +doctests_modifiers_workaround :=3D -Cunsafe-allow-abi-mismatch=3Dfixed-x18 +else ifeq ($(and $(call rustc-min-version,109000),$(call rustc-lt-version,= 109100)),y) +doctests_modifiers_workaround :=3D -Cunsafe-allow-abi-mismatch=3Dfixed-x18 +else ifeq ($(and $(call rustc-min-version,109100),$(call rustc-lt-version,= 109200)),y) +doctests_modifiers_workaround :=3D -Cunsafe-allow-abi-mismatch=3Dfixed-x18= ,sanitizer +endif =20 # `rustc` recognizes `--remap-path-prefix` since 1.26.0, but `rustdoc` only # since Rust 1.81.0. Moreover, `rustdoc` ICEs on out-of-tree builds since = Rust --=20 2.52.0