From nobody Sat Feb 7 19:41:39 2026 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.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 5C1F8394481 for ; Tue, 3 Feb 2026 14:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770130135; cv=none; b=S7NK5TS1R+DyXrtARjpuAFLkYXYU3TpjOw5pAPTA/HGuZO1XhzFK7EYDYu4zWRjr+5gc7Y2AWEppsuqiCe2hwPZTaOvBUnx3eZEBrhmY5OCk7OwyWvBhqXzDaVcPcAOE1JuBbXePsn+qCm5Z65QVeE8GhNroRJ2YlryR3qXMy9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770130135; c=relaxed/simple; bh=ZWNMIok2mtbaI2PfdQpsK+ox9X80WS5ALkwyK2qpfR0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jgp4/WM+rudybCC3Pf1bWStNmsjzbFprfQP83gJ/RBLMyYUjIlJyic2CxauNmlVUXtfvct9xQMLhFZchtJf8YQSJIv8Bdx4avtba0wWnDn2wjTRrp9mOji87r7p9YvIkAg6vTf8+jFuAFA4Ipp6I6Hc0y5r4w8R37Fs268Eutq8= 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=VJXmnnbG; arc=none smtp.client-ip=209.85.167.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="VJXmnnbG" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-45f04f1348cso3462975b6e.1 for ; Tue, 03 Feb 2026 06:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770130133; x=1770734933; 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=V8iLbQX1XIXI1v0KLe0qd86D4q9L/49u2ODU5DqPEiU=; b=VJXmnnbGQZkZ6Yt2HNy1Qy/Ioy19C7bhNXIKKtsE3JaAzOBzdowBHJg1ZGpk6vjvvQ cxO+KNxPvnxLpg8qnAWwno1CXvuoPTnEMzObYrnM1YaTjljGKXTRYkIDvvTAsdvuvuTs F9QuXm1B/VqessOMrtsLyrljzfbsr9RHRNhsx8hJKEGX6KZoQ3GxymGuZEeHU92NziG5 TNyIt8sWNEgXj40Q355kNXcNtQ8WacbE1WOff/079Nx6InW2UZWuZHnOdpwmpAbggAct 2vt7+XsHX4VRlazsYNidMFX34dIoh8gbJHQHkVt1aTSLZqhHY4JWroBrlIl6ck9uoCB9 l+iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770130133; x=1770734933; 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=V8iLbQX1XIXI1v0KLe0qd86D4q9L/49u2ODU5DqPEiU=; b=jabVl/SGfs/794FXGnBN3BHRONnqA7QesbwLp/BOl3/yRdq3xQHdC5z6pw9teMlD0T qP8aHP3INYkhs1pfWZPNk5wWiTbCriAxFKWM5E3WETu1aTqA6TYoE9rm4zz6IP9pFfYV 2Dw10zi61fbk1XZLigHqk8hH3/Xh6lKvyLNzVW/PwO0oUxsWsXQRMEBepu8hXVP9Ms2Z lYYIKHb/3RTJwzr/PGSDAC1fleVmtFGxQo2o/mgrK0S6hQjR5YN7kjCXpZn8toNnMIZ0 oSSBG3JxGHgs4jCd4r5HdT7YP8xrovBmWn/fLaSS5SHz9Xy9iKb2LrpHyUF+578aos59 O9Ww== X-Forwarded-Encrypted: i=1; AJvYcCVg7+ERg3WgRfLHj2Qe03XUcA5WJsYRn1C4nv5Fr1Lbr/8awaCO1gSe5ww2DZTbzW8CNzJOnygJTrdEb1M=@vger.kernel.org X-Gm-Message-State: AOJu0YyvxBkOr3nSJQaJ/ge9XWgSqTakowOxRVvmWQWVQLnnmF8Yj+3V 0skYUNCFNfs5rr9Ug6WPnCz8PmFv/34IAXB79i+tirKMvYT2h6DZnPr3 X-Gm-Gg: AZuq6aIl0y0gTk+HUepZYNKmU1rftCl8g6HBZvGe7fnt2fsXoLXDZ3X3RKxOYe0k5fC SMs+cRNeMUTE1c1GShjmjCkM40Jy8vMHevku61cbMU4ZRN8kD+ycfnVgMl++sDAHTMaDwolIIS8 2dDJvPSWJugrXyD6Z2Pc1rpsrJ/KNdXLxoiLygSVUSRQK4iltWpXJIX0xgtzWDMC5M1zxI7DEvR +EMWaSGVFZe4cxNt0+VtzEL0VSbTjKHt7jv4Hk5LTr50+sX6pWW9Lf+DAWPReC2RGTMzPPnWZtP xMHp3clmS1wgPgF8lQKCClqjpGi6ndjHvsoPdUgLKZffSfJxjCvwZ18byWPPboZ7BivgPFhGLvF IS2w92B2S0wY81WIjf3VPPCC16w/BuVcOTmF1Kym1tvGPC/fKH+GKm9rp98Scql/+TfWASNAWns oai8qMOOz9aR9M8g== X-Received: by 2002:a05:6808:4702:b0:459:9961:5114 with SMTP id 5614622812f47-45f34bcc989mr6716499b6e.16.1770130133211; Tue, 03 Feb 2026 06:48:53 -0800 (PST) Received: from misys ([58.120.241.145]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-409575f6551sm13788352fac.22.2026.02.03.06.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Feb 2026 06:48:52 -0800 (PST) From: HeeSu Kim To: nathan@kernel.org 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, miguel.ojeda.sandonis@gmail.com, nsc@kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, tmgross@umich.edu, HeeSu Kim , stable@vger.kernel.org Subject: [PATCH v4] rust: Makefile: bound rustdoc workaround to affected versions Date: Wed, 4 Feb 2026 08:48:43 +0900 Message-ID: <20260203234843.2834885-1-mlksvender@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260203005627.GB52989@ax162> References: <20260203005627.GB52989@ax162> 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 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]. This bug was fixed in Rust 1.90.0 [2]. Restrict the workaround to only apply for Rust 1.88.x and 1.89.x versions that are affected by the bug, preserving ABI compatibility checks on newer compiler versions. Add `rustc-max-version` macro to `scripts/Makefile.compiler` for version upper bound checks, mirroring the existing `rustc-min-version`. Link: https://github.com/rust-lang/rust/issues/144521 [1] Link: https://github.com/rust-lang/rust/pull/144523 [2] 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/CANiq72n39eU9WE=3DYh0_yJzmqMxo= =3DQAaU2pN0UqP9jZ7bT7rhgA@mail.gmail.com/ Cc: stable@vger.kernel.org # Useful in 6.18.y and later. Signed-off-by: HeeSu Kim Acked-by: Nathan Chancellor --- Changes in v4: - Add rustc-max-version macro for cleaner version bounds - Use rustc-max-version instead of test-lt for readability Changes in v3: - Remove Fixes: tag (this is a feature, not a fix) - Use full URLs with Link: tags instead of GitHub-style references - Add Link: to lore.kernel.org for Suggested-by attribution - Add Cc: stable for potential backporting to 6.18.y Changes in v2: - Change approach: bound to affected Rust versions instead of ARM64-only (the flag is simply ignored on non-ARM64 architectures) rust/Makefile | 3 ++- scripts/Makefile.compiler | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rust/Makefile b/rust/Makefile index 5c0155b83454..1e8a75bc2878 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -136,7 +136,8 @@ pin_init-flags :=3D \ =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) +# The bug was fixed in Rust 1.90.0, so only apply for 1.88.x and 1.89.x. +rustdoc_modifiers_workaround :=3D $(if $(call rustc-min-version,108800),$(= if $(call rustc-max-version,108999),-Cunsafe-allow-abi-mismatch=3Dfixed-x18= )) =20 # 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) 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 =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-max-version +# Usage: rustc-$(call rustc-max-version, 109000) +=3D -Cfoo +rustc-max-version =3D $(call test-le, $(CONFIG_RUSTC_VERSION), $1) + # 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