<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16132</bug_id>
          
          <creation_ts>2026-01-14 10:16:01 +0000</creation_ts>
          <short_desc>rust-native: sstate is not reused between risc-v and any other target</short_desc>
          <delta_ts>2026-01-15 15:38:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexander Kanavin">alex.kanavin</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>103879</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2026-01-14 10:16:01 +0000</bug_when>
    <thetext>I&apos;ve noticed that rust-native is being rebuilt when MACHINE is set to qemurisv64, even though a suitable rust-native is in sstate (and is used for other targets).

Via task signatures this has been traced to the following code in meta/classes-recipe/rust-target-config.bbclass

    if &quot;riscv64&quot; in tspec[&apos;llvm-target&apos;]:
        tspec[&apos;llvm-abiname&apos;] = d.getVar(&apos;TUNE_RISCV_ABI&apos;)
    if &quot;riscv32&quot; in tspec[&apos;llvm-target&apos;]:
        tspec[&apos;llvm-abiname&apos;] = d.getVar(&apos;TUNE_RISCV_ABI&apos;)


Unfortunately this adds a dependency on TUNE_RISCV_ABI (which is set only if the target is a risc-v machine) to rust-native&apos;s rust_gen_targets task, breaking sstate reuse for it between risc-v and any other target. I can imagine other native pieces written in rust will have the same issue.

It&apos;s not immediately obvious to me how to address this, so I&apos;d really appreciate suggestions. The code is hairy (i.e. tricky and brittle).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103881</commentid>
    <comment_count>1</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2026-01-14 13:46:37 +0000</bug_when>
    <thetext>Patches: https://patchwork.yoctoproject.org/project/oe-core/list/?series=42264</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103915</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2026-01-15 15:38:29 +0000</bug_when>
    <thetext>https://git.openembedded.org/openembedded-core/commit/?id=483005f752d89dacb869236a4941981f2698c29e
https://git.openembedded.org/openembedded-core/commit/?id=9993e62f35c96aa8fce39a583f6cc391c0cbba99</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>