From: Boqun Feng <boqun.feng@gmail.com>
To: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
rust-for-linux@vger.kernel.org, Miguel Ojeda <ojeda@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
steve.capper@arm.com, Asahi Lina <lina@asahilina.net>
Subject: Re: [PATCH v2 0/3] Rust enablement for AArch64
Date: Fri, 9 Jun 2023 11:34:05 -0700 [thread overview]
Message-ID: <ZINwnUWOlZ5W3Kam@boqun-archlinux> (raw)
In-Reply-To: <20230606145606.1153715-1-Jamie.Cunliffe@arm.com>
On Tue, Jun 06, 2023 at 03:56:03PM +0100, Jamie Cunliffe wrote:
> Enable Rust support for the AArch64 architecture.
>
With the following diff on the whole series:
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 4a2c807d65db..4562a8173e90 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -41,7 +41,7 @@ KBUILD_CFLAGS += -mgeneral-regs-only \
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
KBUILD_AFLAGS += $(compat_vdso)
-KBUILD_RUSTFLAGS += --target aarch64-unknown-none -C target-feature="-neon,-fp-armv8"
+KBUILD_RUSTFLAGS += --target aarch64-unknown-none -C target-feature="-neon"
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
I've built with RUST=y and boot it in one ARM64 Hyper-V VM. Also I tried
load/unload rust_minimal and rust_print modules, they all worked.
Tested-by: Boqun Feng <boqun.feng@gmail.com>
Regards,
Boqun
> 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
>
>
prev parent reply other threads:[~2023-06-09 18:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 14:56 [PATCH v2 0/3] Rust enablement for AArch64 Jamie Cunliffe
2023-06-06 14:56 ` [PATCH v2 1/3] arm64: rust: Enable Rust support " Jamie Cunliffe
2023-06-09 17:47 ` Boqun Feng
2023-06-12 15:26 ` Jamie Cunliffe
2023-06-29 19:46 ` Boqun Feng
2023-08-15 18:00 ` Boqun Feng
2023-06-06 14:56 ` [PATCH v2 2/3] arm64: rust: Enable PAC support for Rust Jamie Cunliffe
2023-06-06 14:56 ` [PATCH v2 3/3] arm64: Restrict Rust support to little endian only Jamie Cunliffe
2023-06-06 15:25 ` [PATCH v2 0/3] Rust enablement for AArch64 Miguel Ojeda
2023-06-09 18:34 ` Boqun Feng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZINwnUWOlZ5W3Kam@boqun-archlinux \
--to=boqun.feng@gmail.com \
--cc=Jamie.Cunliffe@arm.com \
--cc=catalin.marinas@arm.com \
--cc=lina@asahilina.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=steve.capper@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).