]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
MIPS/GAS: Set default CPU to MIPS64r6 for 64-bit "img" configurations
authorMaciej W. Rozycki <macro@orcam.me.uk>
Sat, 15 Feb 2025 01:30:58 +0000 (01:30 +0000)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Sat, 15 Feb 2025 01:30:58 +0000 (01:30 +0000)
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.

gas/configure
gas/configure.ac
gas/testsuite/gas/mips/mips.exp

index aee531d47db887af979789e1b9095943c3ef52aa..d3a369863fc6e2e02b07c7108c0ce696b7345bed 100755 (executable)
@@ -12277,6 +12277,9 @@ _ACEOF
        esac
        # If Vendor is IMG, then MIPSr6 is used
        case ${target} in
+         mips64*-img-*)
+           mips_cpu=mips64r6
+           ;;
          mips*-img-*)
            mips_cpu=mips32r6
            ;;
index 2ab77706d4c685d76d95c94178c00cafd2b8d396..0bde39992cf69a5746255f5fb730fd97fdcd6907 100644 (file)
@@ -394,6 +394,9 @@ changequote([,])dnl
        esac
        # If Vendor is IMG, then MIPSr6 is used
        case ${target} in
+         mips64*-img-*)
+           mips_cpu=mips64r6
+           ;;
          mips*-img-*)
            mips_cpu=mips32r6
            ;;
index fbd0166f7e85e54141839ac9439ee46b39847f1c..1b6efda6eda10d10904142740f756984b843747c 100644 (file)
@@ -481,7 +481,8 @@ mips_arch_create mips32r5 32        mips32r3 { fpisa3 fpisa4 fpisa5 ror } \
 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-*-* }
@@ -500,7 +501,7 @@ mips_arch_create mips64r5 64        mips64r3 { mips32r5 ror } \
 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       {} \