]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
MIPS: default r6 if vendor is img
authorYunQiang Su <yunqiang.su@cipunited.com>
Wed, 10 May 2023 10:07:23 +0000 (18:07 +0800)
committerYunQiang Su <yunqiang.su@cipunited.com>
Mon, 5 Jun 2023 03:00:14 +0000 (11:00 +0800)
This behavior is used by downstream toolchain since 2014.
We also set the default ABI for mips*-img-elf to O32.
The previous value is NO_ABI, which is not good default ABI.

We don't support mips64*-img* due to GCC doesn't support it,
and We believe that the multilib should be used for this case.

bfd/config.bfd
gas/configure
gas/configure.ac

index 954837033c8bbbb8ee0d1f9a79415edd9841f2a7..78752994456204a3c1184f9bca457f2d966afc29 100644 (file)
@@ -1537,7 +1537,7 @@ case "${targ_defvec} ${targ_selvecs}" in
 esac
 
 case "${targ}" in
-  mipsisa32r6* | mipsisa64r6*)
+  mipsisa32r6* | mipsisa64r6* | mips*-img-*)
     targ_cflags="$targ_cflags -DMIPS_DEFAULT_R6=1"
     ;;
 esac
index 868f4a911a9d261c18afeefb70726e46e56d04af..580022d858d767e78a151917f87374ec950e792b 100755 (executable)
@@ -12211,6 +12211,12 @@ _ACEOF
            use_e_mips_abi_o32=1
            ;;
        esac
+       # If Vendor is IMG, then MIPSr6 is used
+       case ${target} in
+         mips*-img-*)
+           mips_cpu=mips32r6
+           ;;
+       esac
        # Decide whether to generate 32-bit or 64-bit code by default.
        # Used to resolve -march=from-abi when an embedded ABI is selected.
        case ${target} in
@@ -12230,7 +12236,7 @@ _ACEOF
          | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
            mips_default_abi=N32_ABI
            ;;
-         mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
+         mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu | mips*-img-elf)
            mips_default_abi=O32_ABI
            ;;
          mips64*-openbsd*)
index 03728ffce4de1285696577b933c734bf53d01380..c1571a49fbb69be1faaa5daba1db0377faa351b3 100644 (file)
@@ -380,6 +380,12 @@ changequote([,])dnl
            use_e_mips_abi_o32=1
            ;;
        esac
+       # If Vendor is IMG, then MIPSr6 is used
+       case ${target} in
+         mips*-img-*)
+           mips_cpu=mips32r6
+           ;;
+       esac
        # Decide whether to generate 32-bit or 64-bit code by default.
        # Used to resolve -march=from-abi when an embedded ABI is selected.
        case ${target} in
@@ -399,7 +405,7 @@ changequote([,])dnl
          | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
            mips_default_abi=N32_ABI
            ;;
-         mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
+         mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu | mips*-img-elf)
            mips_default_abi=O32_ABI
            ;;
          mips64*-openbsd*)