Re: [PATCH v3 4/4] s390: Enable Rust support
From: Alice Ryhl
Date: Wed May 27 2026 - 02:00:53 EST
On Thu, May 21, 2026 at 06:56:22PM +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.
>
> Signed-off-by: Jan Polensky <japo@xxxxxxxxxxxxx>
> diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh
> index b96ec2d379b6..296acf8f71aa 100755
> --- a/scripts/min-tool-version.sh
> +++ b/scripts/min-tool-version.sh
> @@ -31,7 +31,11 @@ llvm)
> fi
> ;;
> rustc)
> - echo 1.85.0
> + if [ "$SRCARCH" = "s390" ]; then
> + echo 1.96.0
> + else
> + echo 1.85.0
> + fi
For other version constraints we have listed them in the Kconfig file to
guard the select HAVE_RUST or similar annotations instead of here. Is
this the best place to add this constraint?
Alice