This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] MIPS TESTSUITE LD: Skip 32bit test if ld emulations not support


Hi,

The following test fails on mips64<el>-openbsd.

FAIL: MIPS incompatible objects:  "-mabi=eabi -mgp32" "-mips4 -mabi=32"
FAIL: MIPS incompatible objects:  "-mips4 -mabi=o64"  "-mips3 -mabi=eabi"
FAIL: MIPS incompatible objects:  "-march=vr5500 -32"     "-march=sb1 -32"
FAIL: MIPS incompatible objects:  "-march=vr5400 -32"     "-march=4120 -32"
FAIL: MIPS incompatible objects:  "-march=r3900 -32"      "-march=r6000 -32"
FAIL: MIPS incompatible objects:  "-march=r4010 -32"      "-march=r4650 -32"
FAIL: MIPS incompatible objects:  "-mips3 -mgp32 -32"     "-mips32 -32"
FAIL: MIPS incompatible objects:  "-march=sb1 -mgp32 -32" "-mips32r2 -32"
FAIL: MIPS incompatible objects:  "-march=sb1 -32"        "-mips64r2 -32"
FAIL: MIPS incompatible objects:  "-march=vr4100 -32"     "-march=r10000 -32"
FAIL: MIPS incompatible objects:  "-march=r5900 -32"      "-march=vr4111 -32"
FAIL: MIPS incompatible objects:  "-march=loongson2e -32"
"-march=loongson2f -32"
FAIL: MIPS incompatible objects:  "-march=loongson3a -32"
"-march=loongson2f -32"
FAIL: MIPS incompatible objects:  "-march=interaptiv-mr2 -32"
"-march=r4010 -32"
FAIL: MIPS incompatible objects:  "-march=interaptiv-mr2 -mnan=2008
-mfp64 -32"  "-mips32r6 -32"
FAIL: MIPS incompatible objects:  "-march=interaptiv-mr2 -32"  "-mips3 -32"
FAIL: MIPS incompatible objects:  "-march=interaptiv-mr2 -32"  "-mips64r2 -32"
FAIL: MIPS incompatible objects:  "-march=interaptiv-mr2 -32"
"-march=octeon -32"
FAIL: MIPS incompatible objects:  "-mips4 -mgp64 -mabi=o64"         "-mips2 -32"
FAIL: MIPS incompatible objects:  "-mips4 -mabi=o64"
"-mips4 -mabi=32"
FAIL: MIPS incompatible objects:  "-mips4 -mabi=eabi -mgp32"
"-mips4 -mabi=eabi -mgp64"
FAIL: MIPS incompatible objects:  "-march=vr5000 -mgp64 -mabi=o64"
"-march=vr5000 -mgp32 -32"
FAIL: MIPS incompatible objects:  "-mips32 -32"
"-mips64 -mabi=o64"
FAIL: MIPS incompatible objects:  "-mips32r2 -32"
"-mips64 -mabi=o64"
FAIL: MIPS incompatible objects:  "-mips32r2 -32"
"-mips64r2 -mabi=o64"
FAIL: MIPS compatible objects:  "-mips4 -mgp32 -32"  "-mips2 -32"
FAIL: MIPS compatible objects:  "-mips4 -mabi=32"    "-mips2 -32"
FAIL: MIPS compatible objects:  "-mips2 -32"         "-mips4 -mabi=32"
FAIL: MIPS compatible objects:  "-mips2 -mabi=eabi"  "-mips4 -mabi=eabi -mgp32"
FAIL: MIPS compatible objects:  "-mips2 -32"         "-mips32 -32"
"-mips32r2 -32"
FAIL: MIPS compatible objects:  "-mips1 -32"         "-mips32r2 -32"
"-mips32 -32"
FAIL: MIPS compatible objects:  "-march=vr4100 -32"  "-march=vr4120 -32"
FAIL: MIPS compatible objects:  "-march=vr5400 -32"  "-march=vr5500
-32" "-mips4 -32"
FAIL: MIPS compatible objects:  "-mips3 -32"         "-mips4 -32"
  "-march=sb1 -32"  "-mips5 -32"
FAIL: MIPS compatible objects:  "-mips1 -32"         "-march=3900 -32"
FAIL: MIPS compatible objects:  "-mips3 -32"         "-mips64r2 -32" "
  -mips64 -32"
FAIL: MIPS compatible objects:  "-march=vr4120 -mabi=32"  "-mips3 -mabi=32"
FAIL: MIPS compatible objects:  "-march=sb1 -mgp32 -32"   "-march=4000
-mgp32 -32"
FAIL: MIPS compatible objects:  "-mips32 -mabi=32"        "-march=sb1 -mabi=32"
FAIL: MIPS compatible objects:  "-mips64r2 -mabi=32"      "-mips32 -mabi=32"
FAIL: MIPS compatible objects:  "-mips5 -mabi=o64"        "-mips64r2 -mabi=o64"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -32" "-mips1 -32"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -32" "-mips32r2 -32"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -32"
"-march=interaptiv -32"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -32" "-mips32r3 -32"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -32" "-mips32r3
-mips16 -32"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -mips16 -32"
"-mips32r3 -32"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -32" "-mips32r5 -32"
FAIL: MIPS compatible objects:  "-march=interaptiv-mr2 -32" "-march=m5100 -32"

The mips64*-openbsd ld not support the 32bit emulation. The attached
patch skips 32bit test when check ld not support 32bit emulation.

Ok for commit ?

Paul Hua

ld/ChangeLog
2018-08-24  Chenghua Xu  <paul.hua.gm@gmail.com>

        * testsuite/ld-mips-elf/mips-elf-flags.exp
        (check_ld_support_32bit, check_is_32bit_args): New procedures.
        (good_combination, bad_combination): Skip 32bit test if ld
        not support 32bit emulations.
diff --git a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
index 654f8ae..de97939 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
@@ -36,6 +36,32 @@ if {[istarget mips*-*-irix6*]} {
     set ldemul ""
 }
 
+# Check is ld supported 32bit emulations.
+proc check_ld_support_32bit { } {
+    global ld
+    global echo
+
+    set ld_output [remote_exec host $ld "-V"]
+    if [string match "*elf32*" $ld_output] then {
+	return 1
+    } else {
+	return 0
+    }
+}
+
+# Check args is 32bit abis.
+proc check_is_32bit_args {arg} {
+
+    if { [string match "*-32*" $arg]
+         || [string match "*-mabi=32*" $arg]
+         || [string match "*-mabi=o64*" $arg]
+         || [string match "*-mgp32*" $arg] } {
+	return 1
+    } else {
+	return 0
+    }
+}
+
 # Assemble jr.s using each of the argument lists in ARGLIST.  Return the
 # list of object files on success and an empty list on failure.
 proc assemble_for_flags {arglist} {
@@ -70,6 +96,13 @@ proc good_combination {arglist flags args} {
     set testname "MIPS compatible objects: $arglist"
     set objs [assemble_for_flags $arglist]
 
+    foreach argsl $arglist {
+        if { [check_is_32bit_args $argsl] && ![check_ld_support_32bit] } {
+	    unsupported $testname
+	    return 0
+	}
+    }
+
     if {$objs == ""} {
 	unresolved $testname
     } elseif {![ld_link "$ld $ldemul" $finalobj "-r $objs"]} {
@@ -156,6 +189,13 @@ proc bad_combination {arglist message} {
     set testname "MIPS incompatible objects: $arglist"
     set objs [assemble_for_flags $arglist]
 
+    foreach argsl $arglist {
+        if { [check_is_32bit_args $argsl] && ![check_ld_support_32bit] } {
+	    unsupported $testname
+	    return 0
+	}
+    }
+
     if {$objs == ""} {
 	unresolved $testname
     } elseif {[ld_link "$ld $ldemul" $finalobj "-r $objs"]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]