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

Boqun Feng
2023-06-29T19:47:18Z

On Mon, Jun 12, 2023 at 04:26:39PM +0100, Jamie Cunliffe wrote:
> > I don't think you need "-fp-armv8" here, because "aarch64-unknown-none"
> > target doesn't have the target-feature "fp-arm64":
> >
> > rustc +1.68.2 --print cfg --target aarch64-unknown-none | grep target_feature
> >
> > target_feature="neon"
> >
> > , and having the "-fp-armv8" gave me a warning at compile time:
> >
> > RUSTC L rust/core.o warning: unknown feature specified for `-Ctarget-feature`: `fp-armv8`
> > |
> > = note: it is still passed through to the codegen backend
> > = help: consider filing a feature request
>
> Rust removed the fp feature for arm64 and tied it with Neon. However
> this initially had a bug that meant it couldn't be disabled. This has
> now been fixed in https://github.com/rust-lang/rust/pull/107294 so
> once we can update rustc we can fix that warning by removing the
> `-fp-armv8`. Until we do that we still need the `-fp-armv8` otherwise
> we will get some floating point usage. This can be seen by doing an
> objdump of core.o if you build after removing the `-fp-armv8`.
>

Thanks for the information (and the fix)! That's good to know. Looks
like the fix will be in 1.71, then agree, we should keep `-fp-armv8`
until we update to 1.71 or later.

Regards,
Boqun

>
> You can also see that fp-armv8 is enabled in the aarch64-unknown-none target
> here: https://raw.githubusercontent.com/rust-lang/rust/master/compiler/rustc_target/src/spec/aarch64_unknown_none.rs
>
>
> Thanks,
> Jamie.