[PATCH 0/3] Rust enablement for AArch64

Asahi Lina lina at asahilina.net
Tue Mar 7 01:32:20 PST 2023


On 26/01/2023 01.37, Jamie Cunliffe wrote:
> The first patch is from Miguel's tree to enable Rust support for
> AArch64. This has been tested with the Rust samples, and the generated
> code has also been manually inspected.
> 
> The second patch enables the PAC ret and BTI options in the Rust build
> flags to match the options that are used when building C.
> 
> The third patch disables the neon and fp target features to avoid fp &
> simd registers. The use of fp-armv8 will cause a warning from rustc
> about an unknown feature that is specified. The target feature is
> still passed through to LLVM, this behaviour is documented as part of
> the warning. This will be fixed in a future version of the rustc
> toolchain. This pull request should address it,
> https://github.com/rust-lang/rust/pull/107294
> 
> 
> Jamie Cunliffe (2):
>   arm64: rust: Enable PAC support for Rust.
>   arm64: rust: Disable neon and fp target features.
> 
> Miguel Ojeda (1):
>   arm64: rust: Enable Rust support for AArch64
> 
>  Documentation/rust/arch-support.rst |  1 +
>  arch/arm64/Kconfig                  |  1 +
>  arch/arm64/Makefile                 |  4 ++++
>  scripts/generate_rust_target.rs     | 13 ++++++++++++-
>  4 files changed, 18 insertions(+), 1 deletion(-)
> 

Just as a note, we ran into an issue with this patchset. There is a
missing `BINDGEN_TARGET_arm64` in rust/Makefile (around line 255).
Without that, bindgen fails.

 # Derived from `scripts/Makefile.clang`.
 BINDGEN_TARGET_x86     := x86_64-linux-gnu
+BINDGEN_TARGET_arm64   := aarch64-linux-gnu
 BINDGEN_TARGET         := $(BINDGEN_TARGET_$(SRCARCH))

(No need to credit us for that ^^)

Thanks!
~~ Lina



More information about the linux-arm-kernel mailing list