[v2,4/4] Gold/MIPS: Add MIPS64 support for --eanble-targets option

Message ID 20230820145838.1215027-4-yunqiang.su@cipunited.com
State Superseded
Headers
Series [v2,1/4] MIPS: Use 64-bit ABIs by default for `mipsisa64*-*-linux*' targets |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed

Commit Message

YunQiang Su Aug. 20, 2023, 2:58 p.m. UTC
  Currently, if we pass only mips64 triples to --eanble-targets,
gold itself will link fail:

/usr/bin/ld: /usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, true>::sort_before(gold::Output_reloc<9, true, 32, true> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2b44): undefined reference to `gold::Output_reloc<9, true, 32, true>::compare(gold::Output_reloc<9, true, 32, true> const&) const'
/usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, false>::sort_before(gold::Output_reloc<9, true, 32, false> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2bb4): undefined reference to `gold::Output_reloc<9, true, 32, false>::compare(gold::Output_reloc<9, true, 32, false> const&) const'
/usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, true>::sort_before(gold::Output_reloc<9, true, 32, true> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2d28): undefined reference to `gold::Output_reloc<9, true, 32, true>::compare(gold::Output_reloc<9, true, 32, true> const&) const'
/usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, false>::sort_before(gold::Output_reloc<9, true, 32, false> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2df8): undefined reference to `gold::Output_reloc<9, true, 32, false>::compare(gold::Output_reloc<9, true, 32, false> const&) const'

Here, we add:
  mips64*el-*-* | mipsisa64*el-linux* for MIPS64 little endian;
  mips64*-*-* | mipsisa64*-linux* for MIPS64 big endian.
---
 gold/configure.tgt | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Patch

diff --git a/gold/configure.tgt b/gold/configure.tgt
index 03e33f32baf..1e6dc18d4b6 100644
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -153,6 +153,13 @@  aarch64*-*)
  targ_big_endian=false
  targ_extra_big_endian=true
  ;;
+mips64*el-*-* | mipsisa64*el-linux*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
 mips*el-*-*)
  targ_obj=mips
  targ_machine=EM_MIPS
@@ -160,6 +167,13 @@  mips*el-*-*)
  targ_big_endian=false
  targ_extra_big_endian=true
  ;;
+mips64*-*-* | mipsisa64*-linux*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=true
+ targ_extra_big_endian=false
+ ;;
 mips*-*-*)
  targ_obj=mips
  targ_machine=EM_MIPS