[binutils-gdb] ld: testsuite: Fix several CTF tests on 32-bit SPARC
Rainer Orth
ro@sourceware.org
Sun Aug 17 10:26:03 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ddc09604ad38dd325c1cf7f5d9ce37ba4c28464e
commit ddc09604ad38dd325c1cf7f5d9ce37ba4c28464e
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Sun Aug 17 12:25:43 2025 +0200
ld: testsuite: Fix several CTF tests on 32-bit SPARC
Several ld CTF tests FAIL on 32-bit SPARC, e.g.
FAIL: Arrays (conflicted)
The failure mode is always the same:
./tmpdir/array-char-conflicting-1.s: Assembler messages:
./tmpdir/array-char-conflicting-1.s:89: Error: Architecture mismatch on "return %i7+8".
./tmpdir/array-char-conflicting-1.s:89: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; requested architecture is sparclite.)
The problem is that gcc emits v8plus code by default, and thus invokes
as with -xarch=v8plus (equivalent to -Av8plus), while the testcase lacks
the latter.
Fixed by setting ASFLAGS to match.
Tested on sparc-sun-solaris2.11, sparc-unknown-linux-gnu,
sparcv9-sun-solaris2.11, and sparc64-unknown-linux-gnu.
2025-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
ld:
* testsuite/ld-ctf/ctf.exp (ASFLAGS): Append -Av8plus on
sparc-*-*.
Diff:
---
ld/ChangeLog | 5 +++++
ld/testsuite/ld-ctf/ctf.exp | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7b03989a59d..959a44951ec 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2025-08-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * testsuite/ld-ctf/ctf.exp (ASFLAGS): Append -Av8plus on
+ sparc-*-*.
+
2025-07-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/ld-elfweak/elfweak.exp: Enable on *-*-solaris2* rather
diff --git a/ld/testsuite/ld-ctf/ctf.exp b/ld/testsuite/ld-ctf/ctf.exp
index c314f2995af..3ce5e1e9dfe 100644
--- a/ld/testsuite/ld-ctf/ctf.exp
+++ b/ld/testsuite/ld-ctf/ctf.exp
@@ -38,6 +38,11 @@ if {[info exists env(LC_ALL)]} {
}
set env(LC_ALL) "C"
+set saved_ASFLAGS "$ASFLAGS"
+if [istarget "sparc-*-*"] {
+ append ASFLAGS " -Av8plus"
+}
+
set ctf_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
foreach ctf_test $ctf_test_list {
@@ -50,6 +55,8 @@ foreach ctf_test $ctf_test_list {
run_dump_test [file rootname $ctf_test] { { cc "-gctf -fPIC" } }
}
+set ASFLAGS "$saved_ASFLAGS"
+
if {[info exists old_lc_all]} {
set env(LC_ALL) $old_lc_all
} else {
More information about the Binutils-cvs
mailing list