Linux clock framework development
 help / color / mirror / Atom feed
* Re: [PATCH v4 2/2] arm64: rust: Enable Rust support for AArch64
@ 2023-10-24 14:17 Pratham Patel
  2023-10-24 15:19 ` Miguel Ojeda
  0 siblings, 1 reply; 12+ messages in thread
From: Pratham Patel @ 2023-10-24 14:17 UTC (permalink / raw)
  To: boqun.feng
  Cc: Jamie.Cunliffe, andrew, catalin.marinas, lina, linux-arm-kernel,
	linux-clk, mturquette, ojeda, rust-for-linux, sboyd, steve.capper,
	will

On Fri, 20 Oct 2023 11:33:10 -0700, Boqun Feng wrote:
> FWIW, I tried the following:
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 8784284988e5..b697c2d7da68 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -227,7 +227,7 @@ config ARM64
>         select HAVE_FUNCTION_ARG_ACCESS_API
>         select MMU_GATHER_RCU_TABLE_FREE
>         select HAVE_RSEQ
> -       select HAVE_RUST if CPU_LITTLE_ENDIAN
> +       select HAVE_RUST
>         select HAVE_STACKPROTECTOR
>         select HAVE_SYSCALL_TRACEPOINTS
>         select HAVE_KPROBES
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 4562a8173e90..4621f1e00e06 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -41,7 +41,11 @@ KBUILD_CFLAGS        += -mgeneral-regs-only  \
>  KBUILD_CFLAGS  += $(call cc-disable-warning, psabi)
>  KBUILD_AFLAGS  += $(compat_vdso)
>
> +ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
> +KBUILD_RUSTFLAGS += --target aarch64_be-unknown-linux-gnu -C target-feature="-neon"
> +else
>  KBUILD_RUSTFLAGS += --target aarch64-unknown-none -C target-feature="-neon"
> +endif
>
>  KBUILD_CFLAGS  += $(call cc-option,-mabi=lp64)
>  KBUILD_AFLAGS  += $(call cc-option,-mabi=lp64)
>

This comes from a nobody (quite literally my first email on the kernel
mailing list), but I would rather that the support for AArch64 BE be
not added at all. My reasoning for this is because the rustc target
`aarch64_be-unknown-linux-gnu` is in the tier 3 of support. More
details can be found in the official documentation [0], but a few,
**select** key points from that section:

> At this tier, the Rust project provides no official support for a target, so we place minimal requirements on the introduction of targets.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

I am not an owner of any AArch64 BE machines, but if I were, this
would be concerning to _me_. I would prefer waiting for the Rust side
to be a bit more stable, at least in tier 2 support, for adding
AArch64 BE support. Though from the user of the Linux kernel, it may
not be that much of an issue, but from a developer's and packager's
perspective, this will lead to a few wasted hours until the
metaphorical person figures out why said Rust code failed to build for
AArch64 BE.

[0]: https://doc.rust-lang.org/rustc/target-tier-policy.html#tier-3-target-policy

P.S. This is my first time sending an email to a mailing list, sorry
if I mucked something up.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-11-01 15:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20231020155056.3495121-1-Jamie.Cunliffe@arm.com>
     [not found] ` <20231020155056.3495121-3-Jamie.Cunliffe@arm.com>
     [not found]   ` <3cc3b66d-7190-477c-af04-a5d06a0d50fe@lunn.ch>
2023-10-20 18:33     ` [PATCH v4 2/2] arm64: rust: Enable Rust support for AArch64 Boqun Feng
2023-10-20 18:47       ` Andrew Lunn
2023-10-21 12:50       ` Alice Ryhl
2023-10-21 13:41       ` Miguel Ojeda
2023-10-21 16:03         ` Andrew Lunn
2023-10-22 12:57           ` Miguel Ojeda
2023-10-24  0:57       ` Stephen Boyd
2023-10-25 23:55         ` Boqun Feng
2023-11-01 15:04       ` Linus Walleij
2023-10-24 14:17 Pratham Patel
2023-10-24 15:19 ` Miguel Ojeda
2023-10-25  2:01   ` Pratham Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox