[v3,1/2] Gold/MIPS: Improve MIPS support in configure.tgt
Checks
Commit Message
1. Drop mips*le triple pattern, which will consider as big endian
by other components of binutils.
2. Use EM_MIPS instead of EM_MIPS_RS3_LE for little endian.
EM_MIPS_RS3_LE has been deprecated quite long ago, and in fact
most of current LE ELF files are using EM_MIPS.
3. Add targ_extra_size=64 for mips32 triples.
4. Add targ_extra_little_endian=true for big endian triples.
5. Add mips64 triples support, and define targ_extra_little_endian/
targ_extra_big_endian, and targ_extra_size=32.
Let's use `targ_extra_little_endian` in configure.ac/configure,
so that littlen endian can be enabled if the targets are all big endian.
---
gold/configure | 8 ++++++++
gold/configure.ac | 8 ++++++++
gold/configure.tgt | 24 +++++++++++++++++++++---
3 files changed, 37 insertions(+), 3 deletions(-)
Comments
@Maciej W. Rozycki How about this patch?
@Nick Clifton Is there any policy of backport policy of 2.41?
If OK, I'd like to backport this patch to 2.41. As it is really a bug:
../configure --enable-targets=mipsel-linux-gnu only will fail to build.
See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1049455
and
https://buildd.debian.org/status/fetch.php?pkg=binutils-mipsen&arch=amd64&ver=10%2Bc5&stamp=1692086940&raw=0
On Fri, 25 Aug 2023, YunQiang Su wrote:
> @Maciej W. Rozycki How about this patch?
This will have to be split as I previously outlined. Also I won't have
any time to review patches in the next few weeks as I am out of capacity
right now.
Maciej
Maciej W. Rozycki <macro@orcam.me.uk> 于2023年8月25日周五 11:31写道:
>
> On Fri, 25 Aug 2023, YunQiang Su wrote:
>
> > @Maciej W. Rozycki How about this patch?
>
> This will have to be split as I previously outlined. Also I won't have
Generally, we should split patches by code logic, instead of make it fragments.
For distrubutions, cherry-pick patches from master is needed usally.
Fragmental patches will make lots of trobule to them.
We should have a trade off, instead of be extrame.
> any time to review patches in the next few weeks as I am out of capacity
> right now.
>
> Maciej
@@ -5266,6 +5266,10 @@ for targ in $target $canon_targets; do
-o "$targ_extra_big_endian" = "true"; then
targ_32_big=yes
fi
+ if test "$targ_little_endian" = "true" \
+ -o "$targ_extra_little_endian" = "true"; then
+ targ_32_little=yes
+ fi
if test "$targ_big_endian" = "false" \
-o "$targ_extra_big_endian" = "false"; then
targ_32_little=yes
@@ -5276,6 +5280,10 @@ for targ in $target $canon_targets; do
-o "$targ_extra_big_endian" = "true"; then
targ_64_big=yes
fi
+ if test "$targ_little_endian" = "true" \
+ -o "$targ_extra_little_endian" = "true"; then
+ targ_64_little=yes
+ fi
if test "$targ_big_endian" = "false" \
-o "$targ_extra_big_endian" = "false"; then
targ_64_little=yes
@@ -193,6 +193,10 @@ for targ in $target $canon_targets; do
-o "$targ_extra_big_endian" = "true"; then
targ_32_big=yes
fi
+ if test "$targ_little_endian" = "true" \
+ -o "$targ_extra_little_endian" = "true"; then
+ targ_32_little=yes
+ fi
if test "$targ_big_endian" = "false" \
-o "$targ_extra_big_endian" = "false"; then
targ_32_little=yes
@@ -203,6 +207,10 @@ for targ in $target $canon_targets; do
-o "$targ_extra_big_endian" = "true"; then
targ_64_big=yes
fi
+ if test "$targ_little_endian" = "true" \
+ -o "$targ_extra_little_endian" = "true"; then
+ targ_64_little=yes
+ fi
if test "$targ_big_endian" = "false" \
-o "$targ_extra_big_endian" = "false"; then
targ_64_little=yes
@@ -153,19 +153,37 @@ aarch64*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
-mips*el*-*-*|mips*le*-*-*)
+mips64*el-*-*)
targ_obj=mips
- targ_machine=EM_MIPS_RS3_LE
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_extra_size=32
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
+mips*el-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
targ_size=32
+ targ_extra_size=64
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips64*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_extra_size=32
+ targ_big_endian=true
+ targ_extra_little_endian=true
+ ;;
mips*-*-*)
targ_obj=mips
targ_machine=EM_MIPS
targ_size=32
+ targ_extra_size=64
targ_big_endian=true
- targ_extra_big_endian=false
+ targ_extra_little_endian=true
;;
s390-*-*)
targ_obj=s390