mips64*-linux-gnuabi64 ld tests

Message ID abu-D2bGfxm1kAGV@squeak.grove.modra.org
State New
Headers
Series mips64*-linux-gnuabi64 ld tests |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Alan Modra March 19, 2026, 9:12 a.m. UTC
  I noticed recently that my mips64-linux-gnuabi64 binutils build was
not doing compiled ld tests due to check_compiler_available returning
false, despite having a cross-compiler installed.  My compiler fails
to build the test executable when both -mabi=n32 and -L options with
the lib64 dir first are passed, complaining
ld-new: .../lib64/libgcc_s.so.1: error adding symbols: file in wrong format

The -mabi=n32 comes from config/default.exp, the -L options from
genscripts.sh via libpath.exp.  The -mabi=n32 is wrong because
contrary to the comment in default.exp, the abi64 compiler does not
default to N32.  And the -L options interfere with the correct -L
passed by the compiler for -mabi=n32.

	* testsuite/config/default.exp (mips64*-*-linux*): Do not
	supply -mabi=n32 for abi64 configuration.
  

Comments

Maciej W. Rozycki March 19, 2026, 2:01 p.m. UTC | #1
On Thu, 19 Mar 2026, Alan Modra wrote:

> diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
> index ba73f11aeb1..8a67721fa4e 100644
> --- a/ld/testsuite/config/default.exp
> +++ b/ld/testsuite/config/default.exp
> @@ -183,7 +183,7 @@ if {! [info exists env(CCC_OVERRIDE_OPTIONS)]} {
>  # installed, but to the O32 ABI in the build tree, because of some
>  # specs-file hacks.  Make sure we use an ABI that is compatible with
>  # the one we expect.
> -if {[istarget mips64*-*-linux*] &&
> +if {[istarget mips64*-*-linux*] && ![istarget *abi64] &&
>      (![board_info [target_info name] exists multilib_flags] ||
>       ![string match "*-mabi" [board_info [target_info name] multilib_flags]])
>     } {

 IMO this should instead be something along the lines of reverted commit 
d49f2dd78b08 ("MIPS: Use N64 by default for mips*64*-*-linux-gnuabi64"), 
which wasn't ever resubmitted for proper review.

  Maciej
  

Patch

diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index ba73f11aeb1..8a67721fa4e 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -183,7 +183,7 @@  if {! [info exists env(CCC_OVERRIDE_OPTIONS)]} {
 # installed, but to the O32 ABI in the build tree, because of some
 # specs-file hacks.  Make sure we use an ABI that is compatible with
 # the one we expect.
-if {[istarget mips64*-*-linux*] &&
+if {[istarget mips64*-*-linux*] && ![istarget *abi64] &&
     (![board_info [target_info name] exists multilib_flags] ||
      ![string match "*-mabi" [board_info [target_info name] multilib_flags]])
    } {