Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"LLVM ERROR: Not supported instr" on 'mips64-poky-linux-gnun32-gnu' target #489

Closed
sundeep-kokkonda opened this issue Aug 16, 2022 · 4 comments

Comments

@sundeep-kokkonda
Copy link

I am getting this error when compiling the rust application for mips n32 arch abi on Yocto project.

Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: Using rust targets from /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rust-targets/
| NOTE: cargo = /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot-native/usr/bin/cargo
| NOTE: rustc =
| NOTE: cargo build -v --target mips64-poky-linux-gnun32-gnu --release --manifest-path=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/library/std//Cargo.toml --features 'panic-unwind backtrace'
| warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
| package:   /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/src/tools/rls/racer/Cargo.toml
| workspace: /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/Cargo.toml
|    Compiling core v0.0.0 (/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/library/core)
|        Fresh cc v1.0.69
| warning: target json file contains unused fields: has-elf-tls
....
....
....
|      Running `rustc --crate-name rustc_demangle /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/vendor/rustc-demangle/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="compiler_builtins"' --cfg 'feature="core"' --cfg 'feature="rustc-dep-of-std"' -C metadata=b0744d1bbf6f1c66 -C extra-filename=-b0744d1bbf6f1c66 --out-dir /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps --target mips64-poky-linux-gnun32-gnu -C linker=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/wrapper/target-rust-ccld -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/release/deps --extern compiler_builtins=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps/libcompiler_builtins-3cb14fed722f45eb.rmeta --extern core=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps/librustc_std_workspace_core-1588482532069bec.rmeta --cap-lints allow -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32/rustlib/mips64-poky-linux-gnun32-gnu/lib --remap-path-prefix=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0=/usr/src/debug/libstd-rs/1.62.1-r0 -Cembed-bitcode=yes -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32 -C link-arg=-Wl,-soname,libstd.so`
| warning: `cfg-if` (lib) generated 2 warnings (2 duplicates)
|     Building [==========>                ] 13/31: libc, compiler_builtins, ...
| LLVM ERROR: Not supported instr: <MCInst 0 <MCOperand Reg:30> <MCOperand Reg:1>>
| warning: `adler` (lib) generated 2 warnings (2 duplicates)
| error: could not compile `adler`; 2 warnings emitted
|
| Caused by:
|   process didn't exit successfully: `rustc --crate-name adler /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/vendor/adler-0.2.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 --cfg 'feature="compiler_builtins"' --cfg 'feature="core"' --cfg 'feature="rustc-dep-of-std"' -C metadata=49e9881f5b101600 -C extra-filename=-49e9881f5b101600 --out-dir /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps --target mips64-poky-linux-gnun32-gnu -C linker=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/wrapper/target-rust-ccld -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/release/deps --extern compiler_builtins=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps/libcompiler_builtins-3cb14fed722f45eb.rmeta --extern core=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps/librustc_std_workspace_core-1588482532069bec.rmeta --cap-lints allow -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32/rustlib/mips64-poky-linux-gnun32-gnu/lib --remap-path-prefix=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0=/usr/src/debug/libstd-rs/1.62.1-r0 -Cembed-bitcode=yes -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32 -C link-arg=-Wl,-soname,libstd.so` (exit status: 101)
| warning: build failed, waiting for other jobs to finish...
|     Building [===========>               ] 14/31: libc, compiler_builtins, ...
| LLVM ERROR: Not supported instr: <MCInst 0 <MCOperand Reg:433> <MCOperand Reg:338>>
| warning: `core` (lib) generated 2 warnings (2 duplicates)
| error: could not compile `core`; 2 warnings emitted
|
| Caused by:
|   process didn't exit successfully: `rustc --crate-name core --edition=2021 library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=e2fb70f62d4d21c6 -C extra-filename=-e2fb70f62d4d21c6 --out-dir /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps --target mips64-poky-linux-gnun32-gnu -C linker=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/wrapper/target-rust-ccld -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/release/deps -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32/rustlib/mips64-poky-linux-gnun32-gnu/lib --remap-path-prefix=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0=/usr/src/debug/libstd-rs/1.62.1-r0 -Cembed-bitcode=yes -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32 -C link-arg=-Wl,-soname,libstd.so` (exit status: 101)
|     Building [============>              ] 15/31: libc, compiler_builtins, ...
| LLVM ERROR: Not supported instr: <MCInst 0 <MCOperand Reg:380> <MCOperand Reg:22>>
| LLVM ERROR: Not supported instr: <MCInst 0 <MCOperand Reg:30> <MCOperand Reg:1>>
| /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot-native/usr/lib/librustc_driver-f73c9c7b2d50741f.so(+0xa85d12)[0x7f19a2a85d12]
| /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/sysroots-uninative/x86_64-linux/lib/libc.so.6(+0x36e20)[0x7f19a9f17e20]
| /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/sysroots-uninative/x86_64-linux/lib/libc.so.6(__cxa_finalize+0x40)[0x7f19a9f19960]
| /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot-native/usr/lib/librustc_driver-f73c9c7b2d50741f.so(+0xa17bc3)[0x7f19a2a17bc3]
| warning: `compiler_builtins` (lib) generated 2 warnings (2 duplicates)
| error: could not compile `compiler_builtins`; 2 warnings emitted
|
| Caused by:
|   process didn't exit successfully: `rustc --crate-name compiler_builtins /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/vendor/compiler_builtins/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=10000 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' -C metadata=3cb14fed722f45eb -C extra-filename=-3cb14fed722f45eb --out-dir /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps --target mips64-poky-linux-gnun32-gnu -C linker=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/wrapper/target-rust-ccld -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/release/deps --extern core=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps/librustc_std_workspace_core-1588482532069bec.rmeta --cap-lints allow -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32/rustlib/mips64-poky-linux-gnun32-gnu/lib --remap-path-prefix=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0=/usr/src/debug/libstd-rs/1.62.1-r0 -Cembed-bitcode=yes -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32 -C link-arg=-Wl,-soname,libstd.so --cfg 'feature="unstable"'` (signal: 11, SIGSEGV: invalid memory reference)
|     Building [============>              ] 16/31: libc, alloc, memchr, rust...
| LLVM ERROR: Not supported instr: <MCInst 0 <MCOperand Reg:440> <MCOperand Reg:1>>
| warning: `libc` (lib) generated 2 warnings (2 duplicates)
| error: could not compile `libc`; 2 warnings emitted
|
| Caused by:
|   process didn't exit successfully: `rustc --crate-name libc /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/rustc-1.62.1-src/vendor/libc/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="align"' --cfg 'feature="rustc-dep-of-std"' --cfg 'feature="rustc-std-workspace-core"' -C metadata=0bb8cd4dab13899e -C extra-filename=-0bb8cd4dab13899e --out-dir /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps --target mips64-poky-linux-gnun32-gnu -C linker=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/wrapper/target-rust-ccld -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps -L dependency=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/release/deps --extern rustc_std_workspace_core=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/build/mips64-poky-linux-gnun32-gnu/release/deps/librustc_std_workspace_core-1588482532069bec.rmeta --cap-lints allow -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32/rustlib/mips64-poky-linux-gnun32-gnu/lib --remap-path-prefix=/ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0=/usr/src/debug/libstd-rs/1.62.1-r0 -Cembed-bitcode=yes -L /ala-lpggp31/skokkonda/14877/poky/buildA/tmp/work/mips64-n32-poky-linux-gnun32/libstd-rs/1.62.1-r0/recipe-sysroot/usr/lib32 -C link-arg=-Wl,-soname,libstd.so --cfg freebsd11 --cfg libc_priv_mod_use --cfg libc_union --cfg libc_const_size_of --cfg libc_align --cfg libc_int128 --cfg libc_core_cvoid --cfg libc_packedN --cfg libc_cfg_target_vendor --cfg libc_non_exhaustive --cfg libc_ptr_addr_of --cfg libc_underscore_const_names --cfg libc_thread_local` (exit status: 101)
|     Building [=============>             ] 17/31: alloc, memchr, rustc-dema...
| LLVM ERROR: LLVM ERROR: Not supported instr: <MCInst 0 <MCOperand Reg:440> <MCOperand Reg:1>>Not supported instr: <MCInst 0 <MCOperand Reg:30> <MCOperand Reg:1>>
...
...
...

What could be the reason for this error and how to fix it? I suspect the data layout causing this issue. Below is the data layout used.

## mips64-n32-unknown-linux-{gnu, musl}
DATA_LAYOUT[mips64-n32] = "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128"
TARGET_ENDIAN[mips64-n32] = "big"
TARGET_POINTER_WIDTH[mips64-n32] = "32"
TARGET_C_INT_WIDTH[mips64-n32] = "32"
MAX_ATOMIC_WIDTH[mips64-n32] = "64"

How do I derive a correct data layout for a specific arch? (Like the one given in #400 (comment))

@sundeep-kokkonda
Copy link
Author

I tried changing the DATA_LAYOUT by referring https://llvm.org/docs/LangRef.html#data-layout & https://irix7.com/techpubs/007-2816-004.pdf docs but the error is still there.

@sundeep-kokkonda
Copy link
Author

My build is for mips64-n32 abi. I could not see that this abi on the rust supported target list in https://doc.rust-lang.org/nightly/rustc/platform-support.html. Does this error because of n32 is a not supported target arch of rust?

@Amanieu
Copy link
Member

Amanieu commented Aug 17, 2022

This probably isn't the right repo for this bug, you should submit this to rust-lang/rust.

I have no experience with MIPS, but you could check against the settings used by Clang on that target.

@tgross35
Copy link
Contributor

I am going to close this issue since there probably isn't anything to be done. As Amanieu noted the problems don't really look specific to compiler-builtins, so please open a rust-lang/rust bug if there are continued problems.

@tgross35 tgross35 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants