[PATCH v2 0/3] Rust enablement for AArch64

Jamie Cunliffe
2023-06-06T14:57:12Z

Enable Rust support for the AArch64 architecture.

The first patch enables the basic building of Rust for AArch64. Since
v1 this has been rewritten to avoid the use of a target.json file for
AArch64 and use the upstream rustc target definition. x86-64 still
uses the target.json approach though.

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 Rust support when building for big
endian. Currently there is no `aarch64_be-unknown-none` target which
would allow this. Support for this can come at a later time either by
using the target.json approach, or upstreaming a new target definition
to rustc (preferred). We also might be able to use the
`aarch64_be-unknown-linux-gnu` target, however, this can be done at a
later time. It's worth noting that in Makefile.clang, it's
recommended for arch/{arch}/Makefile to set the endianness based on
arguments rather than the target triple. It's currently not possible
to do this with rustc, a different target triple has to be used.

Jamie Cunliffe (3):
arm64: rust: Enable Rust support for AArch64
arm64: rust: Enable PAC support for Rust.
arm64: Restrict Rust support to little endian only.

Documentation/rust/arch-support.rst | 1 +
Makefile | 1 -
arch/arm64/Kconfig | 1 +
arch/arm64/Makefile | 4 ++++
arch/x86/Makefile | 1 +
rust/Makefile | 6 +++++-
scripts/Makefile | 5 +++--
scripts/generate_rust_target.rs | 4 +++-
8 files changed, 18 insertions(+), 5 deletions(-)

--
2.30.2