From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 E74A637C0EB for ; Sun, 19 Apr 2026 14:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607568; cv=none; b=Hr0YTlgqCcCKB2H/d+8G7NRq29NMk4+dbIgawapdeQaQ8YBLC3rIrxaThy4npxGXLPD2xO1JBDJeEHAyakt+rwWE1ibwEJp1WoIim0fJ7yj6iFT9+jrqIHxK9z9Iab/gUI0ndQLbgYIuGzw5Ubz6vOgpp+lF0P1gsUy+JZK9M+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776607568; c=relaxed/simple; bh=RkV2A4r75HXuxD8QxkqtPSd3I5Hi+PWFKHt1H+BH2rw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uvlalkQH/GOBc5p+WaTsbBOHgSDf4duCTW+AoOYLPg+Evzy20QG5cetRDbeA6/bJk+f9vzBmloznYVNJC/qVBQb8oJiH0aN4K63yXwptJhlC6dO4T8b+OVNsmRSOB4qEiznCW+R1xguxWibvdGCJ8jGC9M77svtcYHHYYHzQJnE= 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=dtAa0/vq; arc=none smtp.client-ip=209.85.210.180 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="dtAa0/vq" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-82f69a286dbso1721217b3a.2 for ; Sun, 19 Apr 2026 07:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776607566; x=1777212366; 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=dtAa0/vqDi4chnbjopfSXz2pJxhk8domfh9vOveJBNkS3oi6RXkZCrWQdwXXfiKFWZ flIG8IIM9vfBfvkcNybv5Z0aPBA7oNNn2ClqOAaSPKgZtoCt7ieo7wk38xGf3U8PM5CJ i4E4TZNvfo8AdzM3kdBfpAVe5LsXSVJYtxGlgBd4FIoOzIt/GBp2g9wBM3iR7hhHdavt so5Fd1HmJEKM+/LBKwnwBWRkshjbwXx95SbCKtPMun3WBDx/5UkrNgNu7zKcgGx+9WJp R306PtYv/NdswMP++sDL8mHcimmIw+13kZwC6m6dsASI02sYVlKoLgENFgiRj08/PNwc y1PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776607566; x=1777212366; 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=FD/p1gXLl5I6E7a43Qmja/u4T/E1f61bsQ/P5UcN9lWk+cXzlZYv3pcwlx0PS7aqfd QPNRT5iuAPEg00+pC9Y8yXGAFydVwABLhbAFn72xDm0V25WW2a9OcKCcIdvHVFl8xX9w rbwmy21iPEI+UGLfZzbRxDir7skgN2lose1ALjoQ6sOG4Ch13GJm1m3xLmSGQvnErX+x iLLRH635XsQ0svQ2TZBwmp/5tTg0h7JJqWhE18Jl8//vc3b0e/izPfQpfoxViOnL3h8/ hxguf8N2UjIVUSgu+DlMjUUNGpgBpbJaPmxioMDuQOiSXIMdyBw0L4/LcuDKIJ5alPfu MMzg== X-Forwarded-Encrypted: i=1; AFNElJ97Myw5YSiaT/35owtYb2gun6zsjNI1wW+4ks2GaOQu05RNqW02NBy1jASn9HAZQ0PtpcLg0nzJlIRR7iA=@vger.kernel.org X-Gm-Message-State: AOJu0YyP5FdYVTcJcqrwQP1sOSjmKJZRm7B88F5D/KBePiOwws0Jvl7K /EGoLtitegN/5bpoPRGMiKGLcWnO37M/aWrJ6/8T1EY9uUrQjKqS+ks1 X-Gm-Gg: AeBDieuC1tj382Ht9kfmixjmKjBFKvV8cEsCnJ1ycE/4vJ2GVNz75dpOpDmjWbyc3P0 1m09KPNbpqn9aZYvhT46XqwLz1uxI4CjXmCSXa6Sm7WqHondH4VKxqZSJEnAtaoWlqgXH7/MMUh gP+mIz8m8mfR8Hpsh4Jny3GYOwwdbcQdJXhzKdLuMaNKywkxUG+XsTuF43iDloDl16wJVIQWAkO KScaBEHDaCgBkdey/z5d36YJ6onyzu4kd9LcL+V8bG83AQIRbEx9fypA/6Hus7u6dN2a3orzqub P2FxFEIop6coqlvnbumWNakAoONaKWDe+EUisRaor8AF8Efno80P0CidFDP3uN2mj8dKBW1oksP Y1FnOaGM6sfQYFkdh09/hjv5t265AIXIMZ4wts9Pg9VvHRpWnjBDXp25vRg/f3LwjS7eXp3R0Rq BscCbqcPVEhWdDOiF4SS3yOBf7qFL6kdE87ne3 X-Received: by 2002:a05:6a00:1995:b0:82a:6ef8:cb43 with SMTP id d2e1a72fcca58-82f8c84b34emr10387529b3a.19.1776607566240; Sun, 19 Apr 2026 07:06:06 -0700 (PDT) Received: from misys ([58.120.241.145]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f8ebe6642sm9667974b3a.45.2026.04.19.07.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 07:06:05 -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:05:54 +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: 8bit The `-Cunsafe-allow-abi-mismatch=fixed-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@garyguo.net/ Suggested-by: Miguel Ojeda Link: https://lore.kernel.org/rust-for-linux/CANiq72nnuKJaKrxrut6+noR13PUiSoWWyyp-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 := \ --extern macros \ $(call cfgs-to-flags,$(pin_init-cfgs)) -# `rustdoc` did not save the target modifiers, thus workaround for -# the time being (https://github.com/rust-lang/rust/issues/144521). -rustdoc_modifiers_workaround := $(if $(call rustc-min-version,108800),-Cunsafe-allow-abi-mismatch=fixed-x18) - -# Similarly, for doctests (https://github.com/rust-lang/rust/issues/146465). -doctests_modifiers_workaround := $(rustdoc_modifiers_workaround)$(if $(call 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,109000)),y) +rustdoc_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18 +doctests_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18 +else ifeq ($(and $(call rustc-min-version,109000),$(call rustc-lt-version,109100)),y) +doctests_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18 +else ifeq ($(and $(call rustc-min-version,109100),$(call rustc-lt-version,109200)),y) +doctests_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18,sanitizer +endif # `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 -- 2.52.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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: 8bit Message-ID: <20260419140613.onH8_jZSGl6Rloo8P3ihVGg3zaC4v73SB-lBwc_UkGA@z> The `-Cunsafe-allow-abi-mismatch=fixed-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@garyguo.net/ Suggested-by: Miguel Ojeda Link: https://lore.kernel.org/rust-for-linux/CANiq72nnuKJaKrxrut6+noR13PUiSoWWyyp-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 := \ --extern macros \ $(call cfgs-to-flags,$(pin_init-cfgs)) -# `rustdoc` did not save the target modifiers, thus workaround for -# the time being (https://github.com/rust-lang/rust/issues/144521). -rustdoc_modifiers_workaround := $(if $(call rustc-min-version,108800),-Cunsafe-allow-abi-mismatch=fixed-x18) - -# Similarly, for doctests (https://github.com/rust-lang/rust/issues/146465). -doctests_modifiers_workaround := $(rustdoc_modifiers_workaround)$(if $(call 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,109000)),y) +rustdoc_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18 +doctests_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18 +else ifeq ($(and $(call rustc-min-version,109000),$(call rustc-lt-version,109100)),y) +doctests_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18 +else ifeq ($(and $(call rustc-min-version,109100),$(call rustc-lt-version,109200)),y) +doctests_modifiers_workaround := -Cunsafe-allow-abi-mismatch=fixed-x18,sanitizer +endif # `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 -- 2.52.0