Skip to contentSkip to conversation

rust: kbuild: support `-Cjump-tables=n` for Rust 1.93.0

PATCH In review Alyssa Ross 3 participants 8 messages Jan 29 – Feb 6 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: kbuild: support `-Cjump-tables=n` for Rust 1.93.0

From: Miguel Ojeda <[email protected]>

Rust 1.93.0 (expected 2026-01-22) is stabilizing -Zno-jump-tables [1][2] as -Cjump-tables=n [3].

Without this change, one would eventually see:

RUSTC L rust/core.o
error: unknown unstable option: no-jump-tables

Thus support the upcoming version.

---
 arch/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/Makefile +1 -1
index 5b773b34768d1..7c921514c6d0f 100644
@@ -109,7 +109,7 @@ ifeq ($(CONFIG_X86_KERNEL_IBT),y)
 #   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104816
 #
 KBUILD_CFLAGS += $(call cc-option,-fcf-protection=branch -fno-jump-tables)
-KBUILD_RUSTFLAGS += -Zcf-protection=branch -Zno-jump-tables
+KBUILD_RUSTFLAGS += -Zcf-protection=branch $(if $(call rustc-min-version,109300),-Cjump-tables=n,-Zno-jump-tables)
 else
 KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
 endif

base-commit: abf529abd660d8ccad46dd8c8f20e93db6134f5f

Signature · 1 line
2.52.0
#1 lore raw
Quoted 13 lines · Alyssa Ross

From: Miguel Ojeda <[email protected]>

Rust 1.93.0 (expected 2026-01-22) is stabilizing -Zno-jump-tables [1][2] as -Cjump-tables=n [3].

Without this change, one would eventually see:

RUSTC L rust/core.o
error: unknown unstable option: no-jump-tables

Thus support the upcoming version.

Quoted 10 lines

Thanks!

Greg, Sasha: yes, please take this one -- this commit should have had:

Cc: [email protected] # Needed in 6.12.y and later (Rust is
pinned in older LTSs).

which was in the email thread, but I didn't pick it up and neither b4 did, my mistake.

Cheers,
Miguel

#2 lore raw
Quoted 28 lines · Miguel Ojeda
Quoted 13 lines · Alyssa Ross

From: Miguel Ojeda <[email protected]>

Rust 1.93.0 (expected 2026-01-22) is stabilizing -Zno-jump-tables [1][2] as -Cjump-tables=n [3].

Without this change, one would eventually see:

RUSTC L rust/core.o
error: unknown unstable option: no-jump-tables

Thus support the upcoming version.

Quoted 10 lines

Thanks!

Quoted 7 lines

Greg, Sasha: yes, please take this one -- this commit should have had:

Cc: [email protected] # Needed in 6.12.y and later (Rust is
pinned in older LTSs).

which was in the email thread, but I didn't pick it up and neither b4 did, my mistake.

By the way, if LoongArch (Cc'd) would like to backport commit

74f8295c6fb8 ("LoongArch: Handle jump tables options for RUST")

then this would be a good chance to do so, since the one here would go on top of that one (Alyssa backported the x86 subset of the patch -- for the future, by the way, it would be nice to note it in the commit message in between [ ... ]).

Thanks!

Cheers,
Miguel

maintainer
#3 lore raw
Quoted 38 lines · Miguel Ojeda
Quoted 28 lines · Miguel Ojeda
Quoted 13 lines · Alyssa Ross

From: Miguel Ojeda <[email protected]>

Rust 1.93.0 (expected 2026-01-22) is stabilizing -Zno-jump-tables [1][2] as -Cjump-tables=n [3].

Without this change, one would eventually see:

RUSTC L rust/core.o
error: unknown unstable option: no-jump-tables

Thus support the upcoming version.

Quoted 10 lines

Thanks!

Quoted 7 lines

Greg, Sasha: yes, please take this one -- this commit should have had:

Cc: [email protected] # Needed in 6.12.y and later (Rust is
pinned in older LTSs).

which was in the email thread, but I didn't pick it up and neither b4 did, my mistake.

Quoted 8 lines

By the way, if LoongArch (Cc'd) would like to backport commit

74f8295c6fb8 ("LoongArch: Handle jump tables options for RUST")

then this would be a good chance to do so, since the one here would go on top of that one (Alyssa backported the x86 subset of the patch -- for the future, by the way, it would be nice to note it in the commit message in between [ ... ]).

It doesn't apply to the 6.12.y tree cleanly :(

thanks,

greg k-h

#4 lore raw
Quoted 41 lines · Greg KH
Quoted 40 lines · Miguel Ojeda
Quoted 28 lines · Miguel Ojeda
Quoted 13 lines · Alyssa Ross

From: Miguel Ojeda <[email protected]>

Rust 1.93.0 (expected 2026-01-22) is stabilizing -Zno-jump-tables [1][2] as -Cjump-tables=n [3].

Without this change, one would eventually see:

RUSTC L rust/core.o
error: unknown unstable option: no-jump-tables

Thus support the upcoming version.

Quoted 10 lines

Thanks!

Quoted 7 lines

Greg, Sasha: yes, please take this one -- this commit should have had:

Cc: [email protected] # Needed in 6.12.y and later (Rust is
pinned in older LTSs).

which was in the email thread, but I didn't pick it up and neither b4 did, my mistake.

By the way, if LoongArch (Cc'd) would like to backport commit

Quoted 8 lines
Quoted 6 lines

74f8295c6fb8 ("LoongArch: Handle jump tables options for RUST")

then this would be a good chance to do so, since the one here would go on top of that one (Alyssa backported the x86 subset of the patch -- for the future, by the way, it would be nice to note it in the commit message in between [ ... ]).

It doesn't apply to the 6.12.y tree cleanly :(

Doesn't need to be AFAICT, because -Zno-jump-tables isn't used on 6.12.

#5 lore raw
Quoted 2 lines · Alyssa Ross

Doesn't need to be AFAICT, because -Zno-jump-tables isn't used on 6.12.

I am not sure what you mean -- the commit I referenced is the one that introduces -Zno-jump-tables.

Cheers,
Miguel

#6 lore raw
Quoted 6 lines · Miguel Ojeda
Quoted 2 lines · Alyssa Ross

Doesn't need to be AFAICT, because -Zno-jump-tables isn't used on 6.12.

I am not sure what you mean -- the commit I referenced is the one that introduces -Zno-jump-tables.

Sorry, I got mixed up.