Open
Description
I am writing bare metal code for a mipsel cpu. Since there is no readily available target for hat in rustc I use cargo xbuild
to build one from a target specification that I derived from the mipsel linux target. This works great and the resulting code runs on the CPU. The CPU I am using supports mips16 ISA to improve code density. However, when I enable the feature in my target spec I get the follwing error when compiling the core crate:
LLVM ERROR: Not supported instr: <MCInst 351 <MCOperand Reg:321> <MCOperand Imm:2147483647> <MCOperand Imm:-1>>
error: Could not compile `core`.
To learn more, run the command again with --verbose.
error: `"/Users/alexander/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/var/folders/8g/_rkmq65n0qnf70c41xvp174h0000gn/T/xargo.cfTitdX9TS2Q/Cargo.toml" "--target" "mipsel-unknown-none" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
make: *** [target/mipsel-unknown-none/release/mipswififw] Error 1
This is my spec:
{
"llvm-target": "mipsel-unknown-none",
"arch": "mips",
"cpu": "mips32r2",
"data-layout": "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64",
"executables": true,
"features": "+mips32r2,+mips16,+soft-float",
"linker-flavor": "ld.lld",
"linker": "rust-lld",
"panic-strategy": "abort",
"max-atomic-width": 32,
"os": "none",
"target-c-int-width": "32",
"target-endian": "little",
"target-pointer-width": "32"
}
When I remove the mips16 feature the error is gone.