<?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>14877</bug_id>
          
          <creation_ts>2022-08-09 13:17:58 +0000</creation_ts>
          <short_desc>rust: n32 mips rust fails in libstd-rs</short_desc>
          <delta_ts>2023-08-11 19:32:21 +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>0.0.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Sundeep Kokkonda">sundeep.kokkonda</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>sundeep.kokkonda</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>93736</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-08-09 13:17:58 +0000</bug_when>
    <thetext>libstd-rs fails to build for MIPS n32. Currently we&apos;ve just disabled that build to work around the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93769</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-08-11 14:43:10 +0000</bug_when>
    <thetext>Only n32 is affected. It could be that our input specs are just wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93837</commentid>
    <comment_count>2</comment_count>
    <who name="Sundeep KOKKONDA">sundeep.kokkonda</who>
    <bug_when>2022-08-18 07:24:14 +0000</bug_when>
    <thetext>Hello,

I tried build for n32 abi by changing the data layout (by referring the https://irix7.com/techpubs/007-2816-004.pdf) but still the error is not resolved.

When a program is compiled, the &apos;llvm-ir&apos; will give the correct data layout used for the target it is compiled. So, I tried to compile a test prog for mips64-n32 abi and while doing this I found that the rust is currently not supporting the targets with n32 abi. I suspect this is the reason for this bug.

There is no n32 abi for mips in rust supported platforms https://doc.rust-lang.org/nightly/rustc/platform-support.html. Also, the supported target list also not having n32 abi for mips.

$ rustc --print target-list| grep mips
mips-unknown-linux-gnu
mips-unknown-linux-musl
mips-unknown-linux-uclibc
mips64-unknown-linux-gnuabi64
mips64-unknown-linux-muslabi64
mips64el-unknown-linux-gnuabi64
mips64el-unknown-linux-muslabi64
mipsel-sony-psp
mipsel-unknown-linux-gnu
mipsel-unknown-linux-musl
mipsel-unknown-linux-uclibc
mipsel-unknown-none
mipsisa32r6-unknown-linux-gnu
mipsisa32r6el-unknown-linux-gnu
mipsisa64r6-unknown-linux-gnuabi64
mipsisa64r6el-unknown-linux-gnuabi64


I raised this issue on rust community as well. Let me see if I get any solution there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93873</commentid>
    <comment_count>3</comment_count>
    <who name="Sundeep KOKKONDA">sundeep.kokkonda</who>
    <bug_when>2022-08-23 07:03:01 +0000</bug_when>
    <thetext>Hello,

I did further analysis on this issue, the &apos;libstd-rs&apos; pkg was not built before enabling rust target build. The build with latest sources has &apos;poky/build/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs&apos; build directory. 

I pulled some old commit before these rust upgrades and gave build with exact same build config as where we get this n32 build issue. Old sources build successfully without n32 llvm error but there is no such ../../mips64-n32-poky-linux-gnun32/libstd-rs build dir available.

Also, on latest sources the &apos;pn-buildlist&apos; for &apos;bitbake -g rust&apos; shows dependency on &apos;libstd-rs&apos; where as the old sources gave error &apos; Nothing PROVIDES &apos;rust&apos;&apos;. 

Any pointers would be helpful for further debugging / how to fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93945</commentid>
    <comment_count>4</comment_count>
    <who name="Sundeep KOKKONDA">sundeep.kokkonda</who>
    <bug_when>2022-09-01 05:50:09 +0000</bug_when>
    <thetext>Bug https://github.com/rust-lang/rust/issues/100687 created on rust community.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94647</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-01-09 15:43:52 +0000</bug_when>
    <thetext>We don&apos;t expect to fix this but we&apos;ll keep the defect open until mips64-n32 support is dropped in Yocto.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95876</commentid>
    <comment_count>6</comment_count>
    <who name="Sundeep Kokkonda">sundeep.kokkonda</who>
    <bug_when>2023-07-03 06:11:15 +0000</bug_when>
    <thetext>There is an update from community that Mips n32 is not supported.
https://github.com/rust-lang/rust/issues/100687#issuecomment-1617358303

Can we close this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96246</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-08-11 19:32:21 +0000</bug_when>
    <thetext>Not a supported target as per Sundeep&apos;s comment.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>