mips64*-linux-gnuabi64 ld tests

Alan Modra amodra@gmail.com
Thu Mar 19 09:12:47 GMT 2026


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.

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]])
    } {

-- 
Alan Modra


More information about the Binutils mailing list