Skip to contentSkip to conversation

ARM: rust: Generate unwind tables for Rust code with ARM_UNWIND

PATCH In review FUJITA Tomonori 2 participants 5 messages Oct 9 – Nov 3

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: rust: Generate unwind tables for Rust code with ARM_UNWIND

From: FUJITA Tomonori <[email protected]>

When CONFIG_ARM_UNWIND=y, C code is built with -funwind-tables, but Rust code is built with -Cforce-unwind-tables=n. As a result, the unwinder stops at the first Rust frame.

Pass -Cforce-unwind-tables=y to rustc in that case, as arm64 does.

Fixes ccb8ce526807 ("ARM: 9441/1: rust: Enable Rust support for ARMv7")
Assisted-by LLM
---
 arch/arm/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Makefile +1 -0
index 573813ef5e77..d59b8daf4f4e 100644
@@ -117,6 +117,7 @@ endif
 
 ifeq ($(CONFIG_ARM_UNWIND),y)
 CFLAGS_ABI	+=-funwind-tables
+KBUILD_RUSTFLAGS += -Cforce-unwind-tables=y
 endif
 
 ifeq ($(CONFIG_CC_IS_CLANG),y)

base-commit: a90ee4305c4a5df72c11b31dacfdc76e00fcf78a

Signature · 1 line
2.43.0
#1 lore raw

Hi Russell, Miguel,

Quoted 28 lines · On Fri, 9 Oct 2026 21:41:24 +0900 FUJITA Tomonori <[email protected]> wrote:

From: FUJITA Tomonori <[email protected]>

When CONFIG_ARM_UNWIND=y, C code is built with -funwind-tables, but Rust code is built with -Cforce-unwind-tables=n. As a result, the unwinder stops at the first Rust frame.

Pass -Cforce-unwind-tables=y to rustc in that case, as arm64 does.

Fixes ccb8ce526807 ("ARM: 9441/1: rust: Enable Rust support for ARMv7")
Assisted-by LLM
---
 arch/arm/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Makefile +1 -0
index 573813ef5e77..d59b8daf4f4e 100644
@@ -117,6 +117,7 @@ endif
 
 ifeq ($(CONFIG_ARM_UNWIND),y)
 CFLAGS_ABI	+=-funwind-tables
+KBUILD_RUSTFLAGS += -Cforce-unwind-tables=y
 endif
 
 ifeq ($(CONFIG_CC_IS_CLANG),y)
Quoted 1 line

base-commit: a90ee4305c4a5df72c11b31dacfdc76e00fcf78a

Gentle ping. The patch still applies cleanly on top of v7.4-rc1.

Which tree should this go through?

#2 lore raw
Quoted 4 lines · FUJITA Tomonori

Gentle ping. The patch still applies cleanly on top of v7.4-rc1.

Which tree should this go through?

I guess arm's ideally, but I am happy to take it with their OK (do you want this Cc: stable@?)

A review/test by Christian would be nice. Rudraksha may want to test too (Cc'd).

Thanks!

Cheers,
Miguel

#3 lore raw
Quoted 8 lines · On Tue, 3 Nov 2026 10:34:59 +0100 Miguel Ojeda…
Quoted 4 lines · FUJITA Tomonori

Gentle ping. The patch still applies cleanly on top of v7.4-rc1.

Which tree should this go through?

I guess arm's ideally, but I am happy to take it with their OK (do you want this Cc: stable@?)

I don't think it needs Cc: stable. It only affects the backtrace in an Oops or a WARNING, not how the kernel runs.

#4 lore raw
Quoted 3 lines · FUJITA Tomonori

I don't think it needs Cc: stable. It only affects the backtrace in an Oops or a WARNING, not how the kernel runs.

Thanks Tomo -- I was mainly asking arm, since I didn't want to pick the wrong choice for them if I were to apply it.

i.e. I agree it it doesn't fix a bug in that sense, and it is safer to not backport it. Having said that, it could help downstream kernels, i.e. it fixes something unexpected in the backtraces, so it could be a candidate (the stable team picks sometimes things that are even less of an effect). And thus my question for arm.

Cheers,
Miguel