Add -Av9 to AFLAGS_PIC and AFLAGS_PIE in the ld test suite on SPARC. Fixes the following ld test failures on sparcv9-linux-gnu: FAIL: Build pr23162a FAIL: Build pr23162b FAIL: Build pr23161a FAIL: Build pr23161b FAIL: Build pr22263-1 due to: tmpdir/pr22263-1a.s:26: Error: Architecture mismatch on "return %i7+8". tmpdir/pr22263-1a.s:26: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; requested architecture is sparclite.) which happens when gcc generates v9 code by default. This extends a similar fix made for Solaris/SPARC recently. ld/ * testsuite/ld-elf/shared.exp: Add -Av9 to AFLAGS_PIE on sparc*-*-*. * testsuite/ld-elf/tls.exp: Add -Av9 to AFLAGS_PIC on sparc*-*-*. --- ld/testsuite/ld-elf/shared.exp | 3 +++ ld/testsuite/ld-elf/tls.exp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 66da7203df..d791356afd 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -1541,6 +1541,9 @@ if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } { set AFLAGS_PIE "-mrelax-relocations=yes" } +if [istarget "sparc*-*-*"] { + set AFLAGS_PIE "-Av9" +} if { ([istarget "*-*-linux*"] || [istarget "*-*-nacl*"] diff --git a/ld/testsuite/ld-elf/tls.exp b/ld/testsuite/ld-elf/tls.exp index 8afbb9f129..99ca3aba00 100644 --- a/ld/testsuite/ld-elf/tls.exp +++ b/ld/testsuite/ld-elf/tls.exp @@ -36,7 +36,7 @@ if { ![check_compiler_available] } { # This target requires extra GAS options when building PIC/PIE code. set AFLAGS_PIC "" if [istarget "sparc*-*-*"] { - append AFLAGS_PIC " -K PIC" + append AFLAGS_PIC " -K PIC -Av9" } run_ld_link_tests [list \ -- 2.25.4