[PATCH 1/3] arm64: rust: Enable Rust support for AArch64

Will Deacon will at kernel.org
Tue Jan 31 08:19:06 PST 2023


On Thu, Jan 26, 2023 at 06:56:01PM +0100, Miguel Ojeda wrote:
> On Thu, Jan 26, 2023 at 5:35 PM Will Deacon <will at kernel.org> wrote:
> >
> > Why do we need to specify this stuff here? LLVM already knows about AArch64
> > and can compute the data-layout string in computeDataLayout(). Can we have
> > the tools figure this out for us instead, please?
> 
> I agree -- the reason we have this for the moment is to provide full
> control of the target spec, in particular for cases where `rustc` may
> not provide enough flags to customize exiting builtin target specs
> and/or may emit warnings for unknown target features etc.
> 
> If it is already enough for arm64 to use e.g. the
> `aarch64-unknown-none` target spec plus flags on top, then we should
> go for that, because that is the end goal: these target spec files are
> unstable in the Rust compiler (and not intended to become stable).

Please confirm that this is the case, but I really think we should be
aiming for that rather than starting off my specifying this stuff manually.

> For context, upstream Rust so far has been willing to merge support
> for flags and target features that we needed, which is great.

One thing I ran into while playing around is that 128-bit types aren't
supported with ffi unless '-A improper-ctypes' is passed. Given that we
use '__uint128_t' to represent the fpsimd state, I think this is probably
something which will crop up as an issue.

Will



More information about the linux-arm-kernel mailing list