All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Peter Bergin <peter@berginkonsult.se>, yocto@lists.yoctoproject.org
Subject: Re: [yocto] Regression in rust-cross-canadian-aarch64
Date: Tue, 28 Jun 2022 12:38:45 +0100	[thread overview]
Message-ID: <2d04b7d16c6c6552b897f1ff73d34995023e311b.camel@linuxfoundation.org> (raw)
In-Reply-To: <58c0ec3e-a06a-7829-1168-ef7e70b365f0@berginkonsult.se>

On Tue, 2022-06-28 at 11:00 +0200, Peter Bergin wrote:
> When building rust-cross-canadian-aarch64 the file 
> 'tmp/work/x86_64-nativesdk-pokysdk-linux/rust-cross-canadian-aarch64/1.60.0-r0/targets/aarch64-poky-linux.json' 
> will be populated with the information '"llvm-target": 
> "x86_64-unknown-linux-gnu"'. This will lead to object files in wrong 
> format during 'Building stage2 std artifacts (x86_64-unknown-linux-gnu 
> -> aarch64-poky-linux)' in the do_compile step.
> 
> In 'meta/recipes-devtools/rust/rust-common.inc':
> 
>      # build tspec
>      tspec = {}
>      if bb.data.inherits_class('cross-canadian', d):
>          tspec['llvm-target'] = d.getVar('RUST_HOST_SYS', arch_abi)
>      else:
>          tspec['llvm-target'] = d.getVar('RUST_TARGET_SYS', arch_abi)
> 
> So for some reason it seems intentional to set 'llvm-target' to HOST_SYS 
> when 'cross-canadian'. The behavior has changed with this patch. Before 
> 'llvm-target' was set to RUST_TARGET_SYS for all target archs other than 
> x86_64 where it was set to RUST_HOST_SYS. I guess this change has to do 
> with the commit message 'This might even help cross-canadian work on 
> something which isn't x86-64.'? But unfortunately it seems to break the 
> case building on x86_64 for aarch64. It would be good to get some help 
> here to sort this out.

I've spent an age staring at this code this morning. I don't think
cross-canadian has ever worked properly. It might happen that some
combinations build but there are also some that don't and clearly never
have.

SDKMACHINE = "aarch64", MACHINE = "qemuarm64" certainly doesn't work.
It appears to be missing a ninja-native dependency and when that is
added, it can't find rust-llvm.

Looking at the do_configure from rust.inc, it considers BUILD triplets
and TARGET triplets but not HOST ones, which probably dooms cross-
canadian to failure since there, BUILD != HOST != TARGET.

Someone is going to have to step up and sort out the canadian cross
rust pieces properly. Whilst my patch probably did regress one config,
I think there are much deeper issues in there.

Cheers,

Richard





  parent reply	other threads:[~2022-06-28 11:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <16FA2096B2BC4C47.21247@lists.yoctoproject.org>
     [not found] ` <58c0ec3e-a06a-7829-1168-ef7e70b365f0@berginkonsult.se>
2022-06-28 10:09   ` [yocto] Regression in rust-cross-canadian-aarch64 Richard Purdie
2022-06-28 11:38   ` Richard Purdie [this message]
2022-06-28 15:54     ` Randy MacLeod

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=2d04b7d16c6c6552b897f1ff73d34995023e311b.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=peter@berginkonsult.se \
    --cc=yocto@lists.yoctoproject.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 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.