Fix broken commit
070961b377b3 ("MIPS: Set r6 as default arch if vendor
is img") that sets up GAS in an inconsistent way where "img" vendor has
been used with a 64-bit configuration, such as `mips64-img-linux-gnu'.
In that case GAS is set up to use a 64-bit ABI by default combined with
the MIPS32r6 CPU, which is 32-bit.
Consequently GAS always fails to assemble even trivial input, producing
a message such as:
Assembler messages:
Error: -march=mips32r6 is not compatible with the selected ABI
.../gas/testsuite/gas/all/nop.s:2: Error: `gp=32' used with a 64-bit ABI
unless the defaults have been suitably overridden either for the ABI or
the CPU.
Set the default CPU to MIPS64r6 for 64-bit "img" vendor configurations
then and adjust the GAS testsuite accordingly, removing 1048 FAIL and 3
ERROR regression test results for the `mips64-img-linux-gnu' and
`mips64el-img-linux-gnu' targets each.
esac
# If Vendor is IMG, then MIPSr6 is used
case ${target} in
+ mips64*-img-*)
+ mips_cpu=mips64r6
+ ;;
mips*-img-*)
mips_cpu=mips32r6
;;
esac
# If Vendor is IMG, then MIPSr6 is used
case ${target} in
+ mips64*-img-*)
+ mips_cpu=mips64r6
+ ;;
mips*-img-*)
mips_cpu=mips32r6
;;
mips_arch_create mips32r6 32 mips32r5 { fpisa3 fpisa4 fpisa5 ror } \
{ -march=mips32r6 -mtune=mips32r6 --defsym r6=} \
{ -mmips:isa32r6 } \
- { mipsisa32r6-*-* mipsisa32r6el-*-* mips*-img-* }
+ { mipsisa32r6-*-* mipsisa32r6el-*-*
+ !mips64*-img-* mips*-img-* }
mips_arch_create mips64 64 mips5 { mips32 } \
{ -march=mips64 -mtune=mips64 } { -mmips:isa64 } \
{ mipsisa64-*-* mipsisa64el-*-* }
mips_arch_create mips64r6 64 mips64r5 { mips32r6 ror } \
{ -march=mips64r6 -mtune=mips64r6 --defsym r6=} \
{ -mmips:isa64r6 } \
- { mipsisa64r6-*-* mipsisa64r6el-*-* }
+ { mipsisa64r6-*-* mipsisa64r6el-*-* mips64*-img-* }
mips_arch_create mips16-32 32 {} {} \
{ -march=mips1 -mips16 } { -mmips:3000 }
mips_arch_create mips16-64 64 mips16-32 {} \