aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2020-04-09 13:10:40 +0200
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2020-04-09 13:10:40 +0200
commitae4b1d73f97e0b2a5975b3c0039b12a7f64b793b (patch)
tree80f823554e1014e23393d73fc419293764d59af6
parent3071b197da66dce3877b785c8176352762b45ccc (diff)
downloadgdb-ae4b1d73f97e0b2a5975b3c0039b12a7f64b793b.zip
gdb-ae4b1d73f97e0b2a5975b3c0039b12a7f64b793b.tar.gz
gdb-ae4b1d73f97e0b2a5975b3c0039b12a7f64b793b.tar.bz2
ld: Fix pr22269-1 on 32-bit Solaris/SPARC
pr22269-1.s currently FAILs to assemble on 32-bit Solaris/SPARC: ERROR: -K PIC tmpdir/pr22269-1.s: assembly failed UNRESOLVED: pr22269-1 (static pie undefined weak) tmpdir/pr22269-1.s: Assembler messages: tmpdir/pr22269-1.s:27: Error: Architecture mismatch on "be,pn %icc,.LL4 ,pn %icc,.LL4". tmpdir/pr22269-1.s:27: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; requested architecture is sparclite.) tmpdir/pr22269-1.s:32: Error: Architecture mismatch on "return %i7+8". tmpdir/pr22269-1.s:32: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; requested architecture is sparclite.) tmpdir/pr22269-1.s:36: Error: Architecture mismatch on "return %i7+8". tmpdir/pr22269-1.s:36: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; requested architecture is sparclite.) I could trace this to the fact that gcc on sparc-sun-solaris2.* defaults to --with-cpu=v9. So the gcc -S step of compiling the testcase is run with -mcpu=v9, while the manual invocation of as-new lacks the corresponding -Av9, creating a mismatch. Solaris seems to be the only affected target, otherwise only 64-bit-default configurations default to --with-cpu=v9 or --with-cpu=ultrasparc: sparcv9-*-*, sparc64-*-*, sparc64-*-freebsd*, ultrasparc-*-freebsd*, and sparc64-*-openbsd*. This patch just adds -Av9 to AFLAGS_PIC in ld-elf/shared.exp. It has a precedent in ld-elfvers/vers.exp where -Av9a is added to as_options on sparc-*-*. It lets the test pass and causes no other changes in sparc-sun-solaris2.11 test results. * testsuite/ld-elf/shared.exp: Add -Av9 to AFLAGS_PIC on sparc*-*-*.
-rw-r--r--ld/ChangeLog4
-rw-r--r--ld/testsuite/ld-elf/shared.exp2
2 files changed, 5 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c8ade29..0a8842e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * testsuite/ld-elf/shared.exp: Add -Av9 to AFLAGS_PIC on sparc*-*-*.
+
2020-04-02 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/config/default.exp (NOCF_PROTECTION_CFLAGS): Replace
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index b1762af..3366430 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -46,7 +46,7 @@ if [istarget "tic6x-*-*"] {
append AFLAGS_PIC " -mpic -mpid=near"
}
if [istarget "sparc*-*-*"] {
- append AFLAGS_PIC " -K PIC"
+ append AFLAGS_PIC " -K PIC -Av9"
}
# GAS options to disable program property note.