rust: kbuild: support `-Cjump-tables=n` for Rust 1.93.0
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
@@ -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
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-tablesThus support the upcoming version.
Quoted 10 lines
Reviewed-by Alice Ryhl <[email protected]>Reviewed-by Trevor Gross <[email protected]>Acked-by Nicolas Schier <[email protected]>Signed-off-by Miguel Ojeda <[email protected]>(cherry picked from commit 789521b4717fd6bd85164ba5c131f621a79c9736)Signed-off-by Alyssa Ross <[email protected]>
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
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-tablesThus support the upcoming version.
Quoted 10 lines
Reviewed-by Alice Ryhl <[email protected]>Reviewed-by Trevor Gross <[email protected]>Acked-by Nicolas Schier <[email protected]>Signed-off-by Miguel Ojeda <[email protected]>(cherry picked from commit 789521b4717fd6bd85164ba5c131f621a79c9736)Signed-off-by Alyssa Ross <[email protected]>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
b4did, 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
Greg KH
maintainerQuoted 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-tablesThus support the upcoming version.
Quoted 10 lines
Reviewed-by Alice Ryhl <[email protected]>Reviewed-by Trevor Gross <[email protected]>Acked-by Nicolas Schier <[email protected]>Signed-off-by Miguel Ojeda <[email protected]>(cherry picked from commit 789521b4717fd6bd85164ba5c131f621a79c9736)Signed-off-by Alyssa Ross <[email protected]>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
b4did, 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
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-tablesThus support the upcoming version.
Quoted 10 lines
Reviewed-by Alice Ryhl <[email protected]>Reviewed-by Trevor Gross <[email protected]>Acked-by Nicolas Schier <[email protected]>Signed-off-by Miguel Ojeda <[email protected]>(cherry picked from commit 789521b4717fd6bd85164ba5c131f621a79c9736)Signed-off-by Alyssa Ross <[email protected]>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
b4did, 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.
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
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.
Quoted 2 lines · Greg KH
It doesn't apply to the 6.12.y tree cleanly :(
Yeah, that is why it wasn't applied in the past -- I was just bringing it up again to keep the "chain of dependencies" we would need going in case LoongArch decides to apply it. This is the past thread:
https://lore.kernel.org/stable/CANiq72kEzOa60EhLQ2YnBOD6bsAHc7qA9v9-MP2FtxMa04Q5PQ@mail.gmail.com/
Cheers,
Miguel