ld: enable elf32loongarch as extra target for elf64loongarch and vice versa

Message ID 20260514171358.789613-1-xry111@xry111.site
State New
Headers
Series ld: enable elf32loongarch as extra target for elf64loongarch and vice versa |

Checks

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

Commit Message

Xi Ruoyao May 14, 2026, 5:13 p.m. UTC
  Allow people to build GCC with multilib support even without
--enable-targets=all in binutils configuration.
---
 ld/configure.tgt | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Alan Modra May 14, 2026, 10:32 p.m. UTC | #1
On Fri, May 15, 2026 at 01:13:58AM +0800, Xi Ruoyao via Binutils wrote:
> Allow people to build GCC with multilib support even without
> --enable-targets=all in binutils configuration.
> ---
>  ld/configure.tgt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/ld/configure.tgt b/ld/configure.tgt
> index 5eb10f52611..00c109e5079 100644
> --- a/ld/configure.tgt
> +++ b/ld/configure.tgt
> @@ -1024,8 +1024,10 @@ z8k-*-coff)		targ_emul=z8002
>  			targ_extra_ofiles=
>  			;;
>  loongarch32-*)		targ_emul=elf32loongarch
> +			targ_extra_libpath=elf64loongarch
>  			;;
>  loongarch64-*)		targ_emul=elf64loongarch
> +			targ_extra_libpath=elf32loongarch
>  			;;
>  *-*-ieee*)		targ_emul=vanilla
>  			targ_extra_ofiles=

This is OK.
  

Patch

diff --git a/ld/configure.tgt b/ld/configure.tgt
index 5eb10f52611..00c109e5079 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -1024,8 +1024,10 @@  z8k-*-coff)		targ_emul=z8002
 			targ_extra_ofiles=
 			;;
 loongarch32-*)		targ_emul=elf32loongarch
+			targ_extra_libpath=elf64loongarch
 			;;
 loongarch64-*)		targ_emul=elf64loongarch
+			targ_extra_libpath=elf32loongarch
 			;;
 *-*-ieee*)		targ_emul=vanilla
 			targ_extra_ofiles=