public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rust: Makefile: apply fixed-x18 workaround only on arm64
@ 2026-02-02 22:21 HeeSu Kim
  2026-02-02 13:59 ` Charalampos Mitrodimas
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: HeeSu Kim @ 2026-02-02 22:21 UTC (permalink / raw)
  To: ojeda
  Cc: boqun, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl, tmgross,
	dakr, rust-for-linux, linux-kernel, HeeSu Kim

The `-Cunsafe-allow-abi-mismatch=fixed-x18` option is a workaround for
a rustdoc issue (rust-lang/rust#144521) where target modifiers were not
properly saved. This affects both rustdoc and doctests builds.

However, `fixed-x18` is an ARM64-specific ABI modifier related to the
x18 register reservation (used for Shadow Call Stack). Currently, this
workaround is applied unconditionally on all architectures, which is
incorrect and may cause issues on non-ARM64 builds.

Restrict the workaround to only apply when building for arm64
(SRCARCH=arm64).

Fixes: 68e8e79e1bdc ("rust: fix `rustdoc` target modifiers")
Signed-off-by: HeeSu Kim <mlksvender@gmail.com>
---
 rust/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rust/Makefile b/rust/Makefile
index 5c0155b83..2bd547611 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -136,7 +136,8 @@ pin_init-flags := \
 
 # `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)
+# The `fixed-x18` modifier is ARM64-specific, so only apply it there.
+rustdoc_modifiers_workaround := $(if $(filter arm64,$(SRCARCH)),$(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)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-03-12 14:12 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox