linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* make ARCH=arm64 rustdoc fails on a x86 host with SCS enabled
@ 2025-07-22 10:52 Konrad Dybcio
  2025-07-22 12:40 ` Miguel Ojeda
  0 siblings, 1 reply; 4+ messages in thread
From: Konrad Dybcio @ 2025-07-22 10:52 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, lkml

Trying to build rustdoc as part of an arm64 kernel build on an x86
host results in a number of errors. Looks like we're ignoring the
-Zfixed-18 flag (arch/arm64/Makefile) at some point in the build
process, but I wasn't able to track it down it myself. Found on
next-20250722 (today).

Disabling SCS works around the issue, but that's less than ideal.

$ rustc --version
rustc 1.88.0 (6b00bc388 2025-06-23)

Error log below (CONFIG_SHADOW_CALL_STACK=y):

$ make ARCH=arm64 LLVM=1 -j24 rustdoc

[...]

error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `ffi`
 --> rust/ffi.rs:3:1
  |
3 | //! Foreign function interface (FFI) types.
  | ^
  |
  = help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `core`
  = help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `core`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error

error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `ffi`
 --> rust/ffi.rs:3:1
  |
3 | //! Foreign function interface (FFI) types.
  | ^
  |
  = help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `compiler_builtins`
  = help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `compiler_builtins`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error

error: aborting due to 2 previous errors
error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `compiler_builtins`
 --> rust/compiler_builtins.rs:3:1
  |
3 | //! Our own `compiler_builtins`.
  | ^

  |
  = help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `core`
  = help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `core`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error

error: aborting due to 1 previous error

Konrad

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

* Re: make ARCH=arm64 rustdoc fails on a x86 host with SCS enabled
  2025-07-22 10:52 make ARCH=arm64 rustdoc fails on a x86 host with SCS enabled Konrad Dybcio
@ 2025-07-22 12:40 ` Miguel Ojeda
  2025-07-27  9:25   ` Miguel Ojeda
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2025-07-22 12:40 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, lkml

On Tue, Jul 22, 2025 at 12:53 PM Konrad Dybcio
<konrad.dybcio@oss.qualcomm.com> wrote:
>
> Trying to build rustdoc as part of an arm64 kernel build on an x86
> host results in a number of errors. Looks like we're ignoring the
> -Zfixed-18 flag (arch/arm64/Makefile) at some point in the build
> process, but I wasn't able to track it down it myself. Found on
> next-20250722 (today).
>
> Disabling SCS works around the issue, but that's less than ideal.

Thanks, I can reproduce it -- I will send a patch.

Cheers,
Miguel

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

* Re: make ARCH=arm64 rustdoc fails on a x86 host with SCS enabled
  2025-07-22 12:40 ` Miguel Ojeda
@ 2025-07-27  9:25   ` Miguel Ojeda
  2025-07-28  9:01     ` Konrad Dybcio
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2025-07-27  9:25 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, lkml

On Tue, Jul 22, 2025 at 2:40 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Thanks, I can reproduce it -- I will send a patch.

It turns out it is a Rust compiler (`rustdoc`) bug -- filled:

    https://github.com/rust-lang/rust/issues/144521

I also sent a fix upstream, with a test similar to the kernel case:

    https://github.com/rust-lang/rust/pull/144523

And this is the patch to workaround it in the kernel for the time being:

    https://lore.kernel.org/rust-for-linux/20250727092317.2930617-1-ojeda@kernel.org/

Cheers,
Miguel

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

* Re: make ARCH=arm64 rustdoc fails on a x86 host with SCS enabled
  2025-07-27  9:25   ` Miguel Ojeda
@ 2025-07-28  9:01     ` Konrad Dybcio
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2025-07-28  9:01 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, lkml

On 7/27/25 11:25 AM, Miguel Ojeda wrote:
> On Tue, Jul 22, 2025 at 2:40 PM Miguel Ojeda
> <miguel.ojeda.sandonis@gmail.com> wrote:
>>
>> Thanks, I can reproduce it -- I will send a patch.
> 
> It turns out it is a Rust compiler (`rustdoc`) bug -- filled:
> 
>     https://github.com/rust-lang/rust/issues/144521
> 
> I also sent a fix upstream, with a test similar to the kernel case:
> 
>     https://github.com/rust-lang/rust/pull/144523
> 
> And this is the patch to workaround it in the kernel for the time being:
> 
>     https://lore.kernel.org/rust-for-linux/20250727092317.2930617-1-ojeda@kernel.org/

Thanks for taking care of this!

Konrad

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

end of thread, other threads:[~2025-07-28  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 10:52 make ARCH=arm64 rustdoc fails on a x86 host with SCS enabled Konrad Dybcio
2025-07-22 12:40 ` Miguel Ojeda
2025-07-27  9:25   ` Miguel Ojeda
2025-07-28  9:01     ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).