On 2022-06-28 17:54, Randy MacLeod wrote:
On 2022-06-28 07:38, Richard Purdie wrote:
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.

Sundeep and/or Naveen please take a look.

Peter,
Please open a Yocto bug and document the steps to reproduce the error.

I've sent a patch to oe-core to fix the regression in my setup: https://lists.openembedded.org/g/openembedded-core/message/167368

Opened a bugzilla entry for rust cross-canadian: https://bugzilla.yoctoproject.org/show_bug.cgi?id=14849

Great if you could look in to this.

Thanks!
/Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#57416): https://lists.yoctoproject.org/g/yocto/message/57416
Mute This Topic: https://lists.yoctoproject.org/mt/91864950/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to