From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Andrew Jeffery <andrew@aj.id.au>,
openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [RFC PATCH 1/8] rust: Migrate arch_to_rust_target_arch() to rust-common class
Date: Tue, 22 Feb 2022 10:05:02 +0000 [thread overview]
Message-ID: <0ee2484cba7068b4b43330ff2d371ccf14bc94b4.camel@linuxfoundation.org> (raw)
In-Reply-To: <20220222035234.463162-2-andrew@aj.id.au>
On Tue, 2022-02-22 at 14:22 +1030, Andrew Jeffery wrote:
> This will allow us to use it elsewhere for architecture name
> translation. This move is motivated by powerpc64le support.
>
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
> ---
> meta/classes/rust-common.bbclass | 16 ++++++++++++++++
> meta/recipes-devtools/rust/rust-common.inc | 16 ----------------
> 2 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass
> index 98d65970e8c0..2f2a31867ad0 100644
> --- a/meta/classes/rust-common.bbclass
> +++ b/meta/classes/rust-common.bbclass
> @@ -1,5 +1,21 @@
> inherit python3native
>
> +# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something
> +# rust's internals won't choke on.
> +def arch_to_rust_target_arch(arch):
> + if arch == "i586" or arch == "i686":
> + return "x86"
> + elif arch == "mipsel":
> + return "mips"
> + elif arch == "mip64sel":
> + return "mips64"
> + elif arch == "armv7":
> + return "arm"
> + elif arch == "powerpc64le":
> + return "powerpc64"
> + else:
> + return arch
> +
> # Common variables used by all Rust builds
> export rustlibdir = "${libdir}/rust"
> FILES:${PN} += "${rustlibdir}/*.so"
If we're moving this, it may be a good candidate to move to a new
meta/lib/oe/rust.py python function library for rust. I appreciate that is
slightly move involved and will likely need the imports in base.bbclass to be
tweaked but is probably the better long term fix.
Cheers,
Richard
next prev parent reply other threads:[~2022-02-22 10:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 3:52 [RFC PATCH 0/8] rust: Fix powerpc64le support Andrew Jeffery
2022-02-22 3:52 ` [RFC PATCH 1/8] rust: Migrate arch_to_rust_target_arch() to rust-common class Andrew Jeffery
2022-02-22 10:05 ` Richard Purdie [this message]
2022-02-23 0:41 ` [OE-core] " Andrew Jeffery
2022-02-22 3:52 ` [RFC PATCH 2/8] rust: Rename arch_to_rust_target_arch() for generality Andrew Jeffery
2022-02-22 3:52 ` [RFC PATCH 3/8] rust: Handle Power arch variants in arch_to_rust_arch() Andrew Jeffery
2022-02-22 3:52 ` [RFC PATCH 4/8] rust: Consistently use RUST_{BUILD,HOST,TARGET}_{ARCH,SYS} Andrew Jeffery
2022-02-22 3:52 ` [RFC PATCH 5/8] rust: libstd-rs: Install deps under {RUST_,}TARGET_SYS mismatch Andrew Jeffery
2022-02-22 3:52 ` [RFC PATCH 6/8] rust: Mitigate duplicate sections on matching architectures Andrew Jeffery
2022-02-22 9:57 ` [OE-core] " Alexander Kanavin
2022-02-23 0:38 ` Andrew Jeffery
2022-02-28 0:13 ` Andrew Jeffery
2022-02-28 8:21 ` Alexander Kanavin
2022-02-28 13:57 ` Andrew Jeffery
2022-02-22 3:52 ` [RFC PATCH 7/8] rust: Add snapshot checksums for powerpc64le Andrew Jeffery
2022-02-22 9:59 ` [OE-core] " Alexander Kanavin
2022-02-22 12:28 ` Richard Purdie
2022-02-22 14:23 ` Alexander Kanavin
2022-02-22 18:34 ` Khem Raj
2022-02-22 23:41 ` Andrew Jeffery
2022-02-23 0:17 ` Andrew Jeffery
2022-02-22 23:49 ` Andrew Jeffery
2022-02-23 0:03 ` Richard Purdie
2022-02-23 0:27 ` Andrew Jeffery
2022-02-23 0:43 ` Richard Purdie
2022-02-22 3:52 ` [RFC PATCH 8/8] rust: Introduce RUST_BUILD_ARCH Andrew Jeffery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ee2484cba7068b4b43330ff2d371ccf14bc94b4.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=andrew@aj.id.au \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).