Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH v1 1/1] s390/rust: Use -Cforce-frame-pointers instead of -Ctarget-feature=+backchain
@ 2026-12-02 16:37 Jan Polensky
  2026-12-02 16:48 ` Miguel Ojeda
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Polensky @ 2026-12-02 16:37 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev
  Cc: Christian Borntraeger, Sven Schnelle, Miguel Ojeda, linux-s390,
	rust-for-linux

Newer rustc releases reject -Ctarget-feature=+backchain on s390x with

  error: target feature `backchain` cannot be enabled with
  `-Ctarget-feature`: use `-Cforce-frame-pointers` compiler flag instead

On s390x, -Cforce-frame-pointers now enables the "backchain" LLVM function
attribute instead of the generic "frame-pointer" attribute.

Switch the Rust flags to -Cforce-frame-pointers=y. The target stays
s390x-unknown-none-softfloat, which is required to combine backchain with
-Zpacked-stack.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
 arch/s390/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 8b712cd85fcd..3ec7e6d7a783 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -35,7 +35,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
 KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
 KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)
 
-KBUILD_RUSTFLAGS += --target=s390x-unknown-none-softfloat -Zpacked-stack -Ctarget-feature=+backchain
+KBUILD_RUSTFLAGS += --target=s390x-unknown-none-softfloat -Zpacked-stack -Cforce-frame-pointers=y
 
 UTS_MACHINE	:= s390x
 STACK_SIZE	:= $(if $(CONFIG_KASAN),65536,$(if $(CONFIG_KMSAN),65536,16384))
-- 
2.53.0


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

* Re: [PATCH v1 1/1] s390/rust: Use -Cforce-frame-pointers instead of -Ctarget-feature=+backchain
  2026-12-02 16:37 [PATCH v1 1/1] s390/rust: Use -Cforce-frame-pointers instead of -Ctarget-feature=+backchain Jan Polensky
@ 2026-12-02 16:48 ` Miguel Ojeda
  2026-12-02 17:05   ` Gary Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Miguel Ojeda @ 2026-12-02 16:48 UTC (permalink / raw)
  To: Jan Polensky
  Cc: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Miguel Ojeda, linux-s390,
	rust-for-linux

On Wed, Dec 2, 2026 at 5:37 PM Jan Polensky <japo@linux.ibm.com> wrote:
>
> Newer rustc releases reject -Ctarget-feature=+backchain on s390x with
>
>   error: target feature `backchain` cannot be enabled with
>   `-Ctarget-feature`: use `-Cforce-frame-pointers` compiler flag instead
>
> On s390x, -Cforce-frame-pointers now enables the "backchain" LLVM function
> attribute instead of the generic "frame-pointer" attribute.

But it didn't before, no? So what about older versions?

i.e. should we switch based on the version like we do often with these flags?

Thanks!

Cheers,
Miguel

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

* Re: [PATCH v1 1/1] s390/rust: Use -Cforce-frame-pointers instead of -Ctarget-feature=+backchain
  2026-12-02 16:48 ` Miguel Ojeda
@ 2026-12-02 17:05   ` Gary Guo
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Guo @ 2026-12-02 17:05 UTC (permalink / raw)
  To: Miguel Ojeda, Jan Polensky
  Cc: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, Miguel Ojeda, linux-s390,
	rust-for-linux

On Wed Dec 2, 2026 at 4:48 PM GMT, Miguel Ojeda wrote:
> On Wed, Dec 2, 2026 at 5:37 PM Jan Polensky <japo@linux.ibm.com> wrote:
>>
>> Newer rustc releases reject -Ctarget-feature=+backchain on s390x with
>>
>>   error: target feature `backchain` cannot be enabled with
>>   `-Ctarget-feature`: use `-Cforce-frame-pointers` compiler flag instead
>>
>> On s390x, -Cforce-frame-pointers now enables the "backchain" LLVM function
>> attribute instead of the generic "frame-pointer" attribute.
>
> But it didn't before, no? So what about older versions?
>
> i.e. should we switch based on the version like we do often with these flags?

Or switch on probe so that as long as `-Ctarget-feature=+backchain` is accepted
then still pass it.

We can unconditionally enable -Cforce-frame-pointers.

Best,
Gary


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

end of thread, other threads:[~2026-12-02 17:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 16:37 [PATCH v1 1/1] s390/rust: Use -Cforce-frame-pointers instead of -Ctarget-feature=+backchain Jan Polensky
2026-12-02 16:48 ` Miguel Ojeda
2026-12-02 17:05   ` Gary Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox