All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/rustc: fix BR2_PACKAGE_HOST_RUSTC_ARCH for ARMv5
@ 2022-01-08 16:51 Arnout Vandecappelle
  2022-01-27  7:53 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Arnout Vandecappelle @ 2022-01-08 16:51 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=1ed4147e76fe56322c47468be8a222204c459adf
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

BR2_PACKAGE_HOST_RUSTC_ARCH only had a special value for
BR2_ARM_CPU_ARMV7A, but it also needs a special value for
BR2_ARM_CPU_ARMV5, as the pre-compiled Rust standard library for
ARMv5TE is identified with the "armv5te" architecture name, see
https://doc.rust-lang.org/nightly/rustc/platform-support.html.

We noticed this because Rust binaries wouldn't work on an ARMv5
platform (Illegal instruction). This was due to the usage of the
arm-unknown-linux-gnueabi variant of the Rust standard library, which
is for ARMv6. Thanks to this commit, we correctly use the
armv5te-unknown-linux-gnueabi variant, and Rust binaries work properly
on ARMv5TE.

A better approach would be to do the conversion from architecture
options to Rust tuples in a single string symbol that also defines the
supported architectures, similar to how it's done in e.g. openblas.
However, that's a much bigger change. So for now, just do the easy thing
and fix this one issue.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/rustc/Config.in.host | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
index 90ea56f626..fe7404b3bd 100644
--- a/package/rustc/Config.in.host
+++ b/package/rustc/Config.in.host
@@ -102,8 +102,9 @@ config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
 
 config BR2_PACKAGE_HOST_RUSTC_ARCH
 	string
+	default "armv5te" if BR2_ARM_CPU_ARMV5
 	default "armv7"  if BR2_ARM_CPU_ARMV7A
-	default BR2_ARCH if !BR2_ARM_CPU_ARMV7A
+	default BR2_ARCH
 
 config BR2_PACKAGE_HOST_RUSTC_ABI
 	string
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [git commit] package/rustc: fix BR2_PACKAGE_HOST_RUSTC_ARCH for ARMv5
  2022-01-08 16:51 [Buildroot] [git commit] package/rustc: fix BR2_PACKAGE_HOST_RUSTC_ARCH for ARMv5 Arnout Vandecappelle
@ 2022-01-27  7:53 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2022-01-27  7:53 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 > commit: https://git.buildroot.net/buildroot/commit/?id=1ed4147e76fe56322c47468be8a222204c459adf
 > branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

 > BR2_PACKAGE_HOST_RUSTC_ARCH only had a special value for
 > BR2_ARM_CPU_ARMV7A, but it also needs a special value for
 > BR2_ARM_CPU_ARMV5, as the pre-compiled Rust standard library for
 > ARMv5TE is identified with the "armv5te" architecture name, see
 > https://doc.rust-lang.org/nightly/rustc/platform-support.html.

 > We noticed this because Rust binaries wouldn't work on an ARMv5
 > platform (Illegal instruction). This was due to the usage of the
 > arm-unknown-linux-gnueabi variant of the Rust standard library, which
 > is for ARMv6. Thanks to this commit, we correctly use the
 > armv5te-unknown-linux-gnueabi variant, and Rust binaries work properly
 > on ARMv5TE.

 > A better approach would be to do the conversion from architecture
 > options to Rust tuples in a single string symbol that also defines the
 > supported architectures, similar to how it's done in e.g. openblas.
 > However, that's a much bigger change. So for now, just do the easy thing
 > and fix this one issue.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Committed to 2021.11.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-01-27  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08 16:51 [Buildroot] [git commit] package/rustc: fix BR2_PACKAGE_HOST_RUSTC_ARCH for ARMv5 Arnout Vandecappelle
2022-01-27  7:53 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.