Bug 14877 - rust: n32 mips rust fails in libstd-rs
Summary: rust: n32 mips rust fails in libstd-rs
Status: RESOLVED INVALID
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 0.0.0
Hardware: x86 Multiple
: Medium normal
Target Milestone: 4.3
Assignee: Sundeep Kokkonda
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2022-08-09 13:17 UTC by Richard Purdie
Modified: 2023-08-11 19:32 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2022-08-09 13:17:58 UTC
libstd-rs fails to build for MIPS n32. Currently we've just disabled that build to work around the issue.
Comment 1 Randy MacLeod 2022-08-11 14:43:10 UTC
Only n32 is affected. It could be that our input specs are just wrong.
Comment 2 Sundeep KOKKONDA 2022-08-18 07:24:14 UTC
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 'llvm-ir' 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.
Comment 3 Sundeep KOKKONDA 2022-08-23 07:03:01 UTC
Hello,

I did further analysis on this issue, the 'libstd-rs' pkg was not built before enabling rust target build. The build with latest sources has 'poky/build/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs' 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 'pn-buildlist' for 'bitbake -g rust' shows dependency on 'libstd-rs' where as the old sources gave error ' Nothing PROVIDES 'rust''. 

Any pointers would be helpful for further debugging / how to fix.
Comment 4 Sundeep KOKKONDA 2022-09-01 05:50:09 UTC
Bug https://github.com/rust-lang/rust/issues/100687 created on rust community.
Comment 5 Randy MacLeod 2023-01-09 15:43:52 UTC
We don't expect to fix this but we'll keep the defect open until mips64-n32 support is dropped in Yocto.
Comment 6 Sundeep Kokkonda 2023-07-03 06:11:15 UTC
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?
Comment 7 Randy MacLeod 2023-08-11 19:32:21 UTC
Not a supported target as per Sundeep's comment.