Re: [RFC PATCH 3/3] LoongArch: Handle table jump option for RUST
From: Miguel Ojeda
Date: Wed Sep 03 2025 - 06:29:02 EST
On Wed, Sep 3, 2025 at 11:53 AM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
>
> When compiling with LLVM and CONFIG_RUST is set, there exist objtool
> warnings "sibling call from callable instruction with modified stack
> frame" in rust/core.o and rust/kernel.o.
Thanks for fixing this! I have seen it for a long time in my CI:
I think this is:
Reported-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
Closes: https://lore.kernel.org/rust-for-linux/CANiq72mNeCuPkCDrG2db3w=AX+O-zYrfprisDPmRac_qh65Dmg@xxxxxxxxxxxxxx/
Perhaps consider adding an example of the warning in the log for
future Lore searches:
rust/core.o: warning: objtool:
_RNvXs1_NtNtCs5QSdWC790r4_4core5ascii10ascii_charNtB5_9AsciiCharNtNtB9_3fmt5Debug3fmt+0x54:
sibling call from callable instruction with modified stack frame
> (1) Please install rustc 1.78.0 (without annotate-tablejump option) or
> 1.87.0 (with annotate-tablejump option), do not use the latest version
> for now, otherwise there may be build error:
Nightly is not a released version, and it is expected that it breaks
from time to time. Even beta may break. We are ~2 months away from
that release.
In any case, I don't think this information is related to this commit.
> +config RUSTC_HAS_ANNOTATE_TABLEJUMP
> + depends on RUST
> + def_bool $(rustc-option,-Cllvm-args=--loongarch-annotate-tablejump)
I think this may be fine given it is `-Cllvm-args` and anyway
LoongArch doesn't use a `target.json` (which is great!), but please
double-check reading what I wrote in 46e24a545cdb ("rust:
kasan/kbuild: fix missing flags on first build") just in case.
I hope this helps!
Cheers,
Miguel