Re: [PATCH v6 6/6] s390: Enable Rust support
From: Nathan Chancellor
Date: Mon Jun 15 2026 - 12:42:43 EST
Hi all,
On Mon, Jun 08, 2026 at 08:14:51PM +0200, Jan Polensky wrote:
> Enable building Rust code on s390 by wiring the architecture into the
> kernel Rust infrastructure.
>
> Add s390 to the Rust arch support documentation, provide the s390 Rust
> target and required compiler flags, and set the bindgen target for
> arch/s390. Adjust the Rust target generation and minimum rustc version
> gating so the s390 setup is handled explicitly.
>
> The Rust toolchain uses the "s390x" triple naming for the 64 bit target.
>
> Rust support is currently incompatible with CONFIG_EXPOLINE, which
> relies on compiler support for the -mindirect-branch= and
> -mfunction_return= options. Therefore, select HAVE_RUST only when
> EXPOLINE is disabled.
>
> Acked-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> Acked-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
> Signed-off-by: Jan Polensky <japo@xxxxxxxxxxxxx>
...
> diff --git a/arch/s390/Makefile b/arch/s390/Makefile
> index 297976b41088..8b712cd85fcd 100644
> --- a/arch/s390/Makefile
> +++ b/arch/s390/Makefile
> @@ -35,25 +35,31 @@ 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
With Rust 1.96.0, I see the following warning several times when
building Rust code in -next:
warning: unstable feature specified for `-Ctarget-feature`: `backchain`
|
= note: this feature is not stably supported; its behavior can change in the future
warning: 1 warning emitted
I assume this is expected? If so, is there a way to silence this warning?
--
Cheers,
Nathan