On Tue, 22 Feb 2022, at 20:35, Richard Purdie wrote:
> 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 <[email protected]>
>> ---
>>  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.

I'll take a look.

Andrew
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162237): 
https://lists.openembedded.org/g/openembedded-core/message/162237
Mute This Topic: https://lists.openembedded.org/mt/89310355/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to