* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-25 16:37 ` [PATCH 1/3] arm64: rust: Enable Rust support " Jamie Cunliffe
@ 2023-01-25 19:50 ` Vincenzo Palazzo
2023-01-25 19:56 ` Vincenzo Palazzo
` (3 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Vincenzo Palazzo @ 2023-01-25 19:50 UTC (permalink / raw)
To: Jamie Cunliffe, linux-arm-kernel, rust-for-linux
Cc: Miguel Ojeda, Catalin Marinas, Will Deacon, steve.capper
On Wed Jan 25, 2023 at 5:37 PM CET, Jamie Cunliffe wrote:
> From: Miguel Ojeda <ojeda@kernel.org>
>
> This commit provides the build flags for Rust for AArch64. The core Rust
> support already in the kernel does the rest.
>
> The Rust samples have been tested with this commit.
>
> [jcunliffe: Arm specific parts taken from Miguel's upstream tree]
>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> Co-developed-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
> ---
> Documentation/rust/arch-support.rst | 1 +
> arch/arm64/Kconfig | 1 +
> scripts/generate_rust_target.rs | 13 ++++++++++++-
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-support.rst
> index 6982b63775da..3776059a385a 100644
> --- a/Documentation/rust/arch-support.rst
> +++ b/Documentation/rust/arch-support.rst
> @@ -15,5 +15,6 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
> ============ ================ ==============================================
> Architecture Level of support Constraints
> ============ ================ ==============================================
> +``arm64`` Maintained None.
> ``x86`` Maintained ``x86_64`` only.
> ============ ================ ==============================================
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 03934808b2ed..fc3800e82802 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -209,6 +209,7 @@ config ARM64
> select HAVE_FUNCTION_ARG_ACCESS_API
> select MMU_GATHER_RCU_TABLE_FREE
> select HAVE_RSEQ
> + select HAVE_RUST
> select HAVE_STACKPROTECTOR
> select HAVE_SYSCALL_TRACEPOINTS
> select HAVE_KPROBES
> diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
> index 3c6cbe2b278d..fe0e4ba54492 100644
> --- a/scripts/generate_rust_target.rs
> +++ b/scripts/generate_rust_target.rs
> @@ -148,7 +148,18 @@ fn main() {
> let mut ts = TargetSpec::new();
>
> // `llvm-target`s are taken from `scripts/Makefile.clang`.
> - if cfg.has("X86_64") {
> + if cfg.has("ARM64") {
> + ts.push("arch", "aarch64");
> + ts.push(
> + "data-layout",
> + "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
> + );
> + ts.push("disable-redzone", true);
> + ts.push("features", "+strict-align,+neon,+fp-armv8");
> + ts.push("llvm-target", "aarch64-linux-gnu");
> + ts.push("max-atomic-width", 128);
> + ts.push("target-pointer-width", "64");
> + } else if cfg.has("X86_64") {
> ts.push("arch", "x86_64");
> ts.push(
> "data-layout",
> --
> 2.30.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-25 16:37 ` [PATCH 1/3] arm64: rust: Enable Rust support " Jamie Cunliffe
2023-01-25 19:50 ` Vincenzo Palazzo
@ 2023-01-25 19:56 ` Vincenzo Palazzo
2023-01-26 16:35 ` Will Deacon
` (2 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Vincenzo Palazzo @ 2023-01-25 19:56 UTC (permalink / raw)
To: Jamie Cunliffe, linux-arm-kernel, rust-for-linux
Cc: Miguel Ojeda, Catalin Marinas, Will Deacon, steve.capper
On Wed Jan 25, 2023 at 5:37 PM CET, Jamie Cunliffe wrote:
> From: Miguel Ojeda <ojeda@kernel.org>
>
> This commit provides the build flags for Rust for AArch64. The core Rust
> support already in the kernel does the rest.
>
> The Rust samples have been tested with this commit.
>
> [jcunliffe: Arm specific parts taken from Miguel's upstream tree]
>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> Co-developed-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
P.S: wrong answer template in the prev mail :)
> ---
> Documentation/rust/arch-support.rst | 1 +
> arch/arm64/Kconfig | 1 +
> scripts/generate_rust_target.rs | 13 ++++++++++++-
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-support.rst
> index 6982b63775da..3776059a385a 100644
> --- a/Documentation/rust/arch-support.rst
> +++ b/Documentation/rust/arch-support.rst
> @@ -15,5 +15,6 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
> ============ ================ ==============================================
> Architecture Level of support Constraints
> ============ ================ ==============================================
> +``arm64`` Maintained None.
> ``x86`` Maintained ``x86_64`` only.
> ============ ================ ==============================================
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 03934808b2ed..fc3800e82802 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -209,6 +209,7 @@ config ARM64
> select HAVE_FUNCTION_ARG_ACCESS_API
> select MMU_GATHER_RCU_TABLE_FREE
> select HAVE_RSEQ
> + select HAVE_RUST
> select HAVE_STACKPROTECTOR
> select HAVE_SYSCALL_TRACEPOINTS
> select HAVE_KPROBES
> diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
> index 3c6cbe2b278d..fe0e4ba54492 100644
> --- a/scripts/generate_rust_target.rs
> +++ b/scripts/generate_rust_target.rs
> @@ -148,7 +148,18 @@ fn main() {
> let mut ts = TargetSpec::new();
>
> // `llvm-target`s are taken from `scripts/Makefile.clang`.
> - if cfg.has("X86_64") {
> + if cfg.has("ARM64") {
> + ts.push("arch", "aarch64");
> + ts.push(
> + "data-layout",
> + "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
> + );
> + ts.push("disable-redzone", true);
> + ts.push("features", "+strict-align,+neon,+fp-armv8");
> + ts.push("llvm-target", "aarch64-linux-gnu");
> + ts.push("max-atomic-width", 128);
> + ts.push("target-pointer-width", "64");
> + } else if cfg.has("X86_64") {
> ts.push("arch", "x86_64");
> ts.push(
> "data-layout",
> --
> 2.30.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-25 16:37 ` [PATCH 1/3] arm64: rust: Enable Rust support " Jamie Cunliffe
2023-01-25 19:50 ` Vincenzo Palazzo
2023-01-25 19:56 ` Vincenzo Palazzo
@ 2023-01-26 16:35 ` Will Deacon
2023-01-26 17:56 ` Miguel Ojeda
2023-01-27 14:09 ` Gary Guo
2023-05-02 13:41 ` Asahi Lina
4 siblings, 1 reply; 21+ messages in thread
From: Will Deacon @ 2023-01-26 16:35 UTC (permalink / raw)
To: Jamie Cunliffe
Cc: linux-arm-kernel, rust-for-linux, Miguel Ojeda, Catalin Marinas,
steve.capper
On Wed, Jan 25, 2023 at 04:37:37PM +0000, Jamie Cunliffe wrote:
> From: Miguel Ojeda <ojeda@kernel.org>
>
> This commit provides the build flags for Rust for AArch64. The core Rust
> support already in the kernel does the rest.
>
> The Rust samples have been tested with this commit.
>
> [jcunliffe: Arm specific parts taken from Miguel's upstream tree]
>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> Co-developed-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> ---
> Documentation/rust/arch-support.rst | 1 +
> arch/arm64/Kconfig | 1 +
> scripts/generate_rust_target.rs | 13 ++++++++++++-
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-support.rst
> index 6982b63775da..3776059a385a 100644
> --- a/Documentation/rust/arch-support.rst
> +++ b/Documentation/rust/arch-support.rst
> @@ -15,5 +15,6 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
> ============ ================ ==============================================
> Architecture Level of support Constraints
> ============ ================ ==============================================
> +``arm64`` Maintained None.
> ``x86`` Maintained ``x86_64`` only.
> ============ ================ ==============================================
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 03934808b2ed..fc3800e82802 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -209,6 +209,7 @@ config ARM64
> select HAVE_FUNCTION_ARG_ACCESS_API
> select MMU_GATHER_RCU_TABLE_FREE
> select HAVE_RSEQ
> + select HAVE_RUST
> select HAVE_STACKPROTECTOR
> select HAVE_SYSCALL_TRACEPOINTS
> select HAVE_KPROBES
> diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
> index 3c6cbe2b278d..fe0e4ba54492 100644
> --- a/scripts/generate_rust_target.rs
> +++ b/scripts/generate_rust_target.rs
> @@ -148,7 +148,18 @@ fn main() {
> let mut ts = TargetSpec::new();
>
> // `llvm-target`s are taken from `scripts/Makefile.clang`.
> - if cfg.has("X86_64") {
> + if cfg.has("ARM64") {
> + ts.push("arch", "aarch64");
> + ts.push(
> + "data-layout",
> + "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
> + );
> + ts.push("disable-redzone", true);
> + ts.push("features", "+strict-align,+neon,+fp-armv8");
> + ts.push("llvm-target", "aarch64-linux-gnu");
> + ts.push("max-atomic-width", 128);
> + ts.push("target-pointer-width", "64");
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?
Will
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-26 16:35 ` Will Deacon
@ 2023-01-26 17:56 ` Miguel Ojeda
2023-01-31 16:19 ` Will Deacon
0 siblings, 1 reply; 21+ messages in thread
From: Miguel Ojeda @ 2023-01-26 17:56 UTC (permalink / raw)
To: Will Deacon
Cc: Jamie Cunliffe, linux-arm-kernel, rust-for-linux, Miguel Ojeda,
Catalin Marinas, steve.capper
On Thu, Jan 26, 2023 at 5:35 PM Will Deacon <will@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).
For context, upstream Rust so far has been willing to merge support
for flags and target features that we needed, which is great.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-26 17:56 ` Miguel Ojeda
@ 2023-01-31 16:19 ` Will Deacon
2023-01-31 16:49 ` Björn Roy Baron
2023-01-31 18:55 ` Miguel Ojeda
0 siblings, 2 replies; 21+ messages in thread
From: Will Deacon @ 2023-01-31 16:19 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Jamie Cunliffe, linux-arm-kernel, rust-for-linux, Miguel Ojeda,
Catalin Marinas, steve.capper
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@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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-31 16:19 ` Will Deacon
@ 2023-01-31 16:49 ` Björn Roy Baron
2023-01-31 18:55 ` Miguel Ojeda
1 sibling, 0 replies; 21+ messages in thread
From: Björn Roy Baron @ 2023-01-31 16:49 UTC (permalink / raw)
To: Will Deacon
Cc: Miguel Ojeda, Jamie Cunliffe, linux-arm-kernel, rust-for-linux,
Miguel Ojeda, Catalin Marinas, steve.capper
On Tuesday, January 31st, 2023 at 17:19, Will Deacon <will@kernel.org> wrote:
> 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@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.
This lint exists because u/i128 are indeed not compatible with their C counterpart on many targets including x86_64 with the SysV ABI. As it turns out however, it is compatible on AArch64. A little under a year ago 128bit int type aliases were added to the libc crate on AArch64 (except on Windows) which are equal to u/i128 [1]. In addition it has const assertions for the correct size and alignment. As such if rustc every regresses on non-Windows AArch64, this will show up in a crater run and almost definitively be fixed. Because of this I don't think there will be any problem with assuming __uint128_t and u128 are compatible when compiling for AArch64.
>
> Will
Cheers,
Bjorn
[1]: https://github.com/rust-lang/libc/pull/2719/files
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-31 16:19 ` Will Deacon
2023-01-31 16:49 ` Björn Roy Baron
@ 2023-01-31 18:55 ` Miguel Ojeda
2023-04-18 15:06 ` Jamie Cunliffe
1 sibling, 1 reply; 21+ messages in thread
From: Miguel Ojeda @ 2023-01-31 18:55 UTC (permalink / raw)
To: Will Deacon
Cc: Jamie Cunliffe, linux-arm-kernel, rust-for-linux, Miguel Ojeda,
Catalin Marinas, steve.capper
On Tue, Jan 31, 2023 at 5:19 PM Will Deacon <will@kernel.org> wrote:
>
> 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.
Let's see what Jamie thinks and if he can give it a try.
> 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.
Thanks for giving it a go. With what Björn has explained (I see the PR
he linked has `user_fpsimd_struct` as a test case, which is nice), I
guess it should be fine. We could also add some tests on our side to
make sure (which we probably want to do anyway for other reasons).
Added to https://github.com/Rust-for-Linux/linux/issues/355.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-31 18:55 ` Miguel Ojeda
@ 2023-04-18 15:06 ` Jamie Cunliffe
0 siblings, 0 replies; 21+ messages in thread
From: Jamie Cunliffe @ 2023-04-18 15:06 UTC (permalink / raw)
To: miguel.ojeda.sandonis
Cc: Jamie.Cunliffe, catalin.marinas, linux-arm-kernel, ojeda,
rust-for-linux, steve.capper, will
On Tue, Jan 31, 2023 at 5:19 PM Will Deacon <will@kernel.org> wrote:
> 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.
The json that we generate looks to be almost equivalent (that's why patch 3
exists, to answer your question on that patch). The only difference is the
`aarch64-unknown-none` rustc target sets the LLVM target to also be
`aarch64-unknown-none`, whereas the current target.json uses the
`aarch64-linux-gnu` LLVM target as does Makefile.clang for C code. As you have
been talking about the unknown-none target throughout this thread, I just wanted
to double check that's your intention?
Happy to switch over to using the rustc definition though. I just did it this
way to keep it consistent with the other architectures and not add any more
complexity into the build. On a quick test it does seem to be OK, but I'll
prepare a patch and do some proper testing that it's actually fine to use the
rustc definition though.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-25 16:37 ` [PATCH 1/3] arm64: rust: Enable Rust support " Jamie Cunliffe
` (2 preceding siblings ...)
2023-01-26 16:35 ` Will Deacon
@ 2023-01-27 14:09 ` Gary Guo
2023-05-02 13:41 ` Asahi Lina
4 siblings, 0 replies; 21+ messages in thread
From: Gary Guo @ 2023-01-27 14:09 UTC (permalink / raw)
To: Jamie Cunliffe
Cc: linux-arm-kernel, rust-for-linux, Miguel Ojeda, Catalin Marinas,
Will Deacon, steve.capper
On Wed, 25 Jan 2023 16:37:37 +0000
Jamie Cunliffe <Jamie.Cunliffe@arm.com> wrote:
> From: Miguel Ojeda <ojeda@kernel.org>
>
> This commit provides the build flags for Rust for AArch64. The core Rust
> support already in the kernel does the rest.
>
> The Rust samples have been tested with this commit.
>
> [jcunliffe: Arm specific parts taken from Miguel's upstream tree]
>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> Co-developed-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> Documentation/rust/arch-support.rst | 1 +
> arch/arm64/Kconfig | 1 +
> scripts/generate_rust_target.rs | 13 ++++++++++++-
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-support.rst
> index 6982b63775da..3776059a385a 100644
> --- a/Documentation/rust/arch-support.rst
> +++ b/Documentation/rust/arch-support.rst
> @@ -15,5 +15,6 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
> ============ ================ ==============================================
> Architecture Level of support Constraints
> ============ ================ ==============================================
> +``arm64`` Maintained None.
> ``x86`` Maintained ``x86_64`` only.
> ============ ================ ==============================================
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 03934808b2ed..fc3800e82802 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -209,6 +209,7 @@ config ARM64
> select HAVE_FUNCTION_ARG_ACCESS_API
> select MMU_GATHER_RCU_TABLE_FREE
> select HAVE_RSEQ
> + select HAVE_RUST
> select HAVE_STACKPROTECTOR
> select HAVE_SYSCALL_TRACEPOINTS
> select HAVE_KPROBES
> diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
> index 3c6cbe2b278d..fe0e4ba54492 100644
> --- a/scripts/generate_rust_target.rs
> +++ b/scripts/generate_rust_target.rs
> @@ -148,7 +148,18 @@ fn main() {
> let mut ts = TargetSpec::new();
>
> // `llvm-target`s are taken from `scripts/Makefile.clang`.
> - if cfg.has("X86_64") {
> + if cfg.has("ARM64") {
> + ts.push("arch", "aarch64");
> + ts.push(
> + "data-layout",
> + "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
> + );
> + ts.push("disable-redzone", true);
> + ts.push("features", "+strict-align,+neon,+fp-armv8");
> + ts.push("llvm-target", "aarch64-linux-gnu");
> + ts.push("max-atomic-width", 128);
> + ts.push("target-pointer-width", "64");
> + } else if cfg.has("X86_64") {
> ts.push("arch", "x86_64");
> ts.push(
> "data-layout",
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] arm64: rust: Enable Rust support for AArch64
2023-01-25 16:37 ` [PATCH 1/3] arm64: rust: Enable Rust support " Jamie Cunliffe
` (3 preceding siblings ...)
2023-01-27 14:09 ` Gary Guo
@ 2023-05-02 13:41 ` Asahi Lina
4 siblings, 0 replies; 21+ messages in thread
From: Asahi Lina @ 2023-05-02 13:41 UTC (permalink / raw)
To: Jamie Cunliffe, linux-arm-kernel, rust-for-linux
Cc: Miguel Ojeda, Catalin Marinas, Will Deacon, steve.capper
Hi!
On 26/01/2023 01.37, Jamie Cunliffe wrote:
> From: Miguel Ojeda <ojeda@kernel.org>
>
> This commit provides the build flags for Rust for AArch64. The core Rust
> support already in the kernel does the rest.
>
> The Rust samples have been tested with this commit.
>
> [jcunliffe: Arm specific parts taken from Miguel's upstream tree]
>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> Co-developed-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
> ---
> Documentation/rust/arch-support.rst | 1 +
> arch/arm64/Kconfig | 1 +
> scripts/generate_rust_target.rs | 13 ++++++++++++-
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
I'm curious, do you have a timeline for submitting the next revision of
this patch? We're trying to aim to upstream the drm/asahi driver for 6.6
or so, but that would depend on CONFIG_ARM64, so it would be lovely if
we could get this in for 6.5 (and it looks like there shouldn't be too
many issues left) ^^
~~ Lina
^ permalink raw reply [flat|nested] 21+ messages in thread